[cups] Sending mail from a CentOS7 virtual machine to Fuji Xerox ApeosPort-IV C4475 problem revisted

Zdenek Dohnal zdohnal at redhat.com
Mon Nov 5 03:32:52 PST 2018


Hi Ian,

sorry for no update, I was on vacation. More info below.

On 10/29/18 5:50 AM, マスターズ・イアン wrote:
> Hi
>
> On 2018/10/26 17:17, Zdenek Dohnal wrote:
>> please run 'bt full', you will see whole backtrace with all variables.
>> My simple guess - two lines before when segfault happened returned NULL,
>> so program is trying to access a member of struct, which is NULL...
>
> Here we go:
>
> (gdb) bt full
> #0  fxGetPrintOptions (argc=argc at entry=6, argv=argv at entry=0xbf92dec4,
> opt=opt at entry=0x808cb80 <printOption>)
>     at fxlinuxprint.c:379
>         file_name = <optimized out>
>         num_dests = 3
>         i = <optimized out>
>         j = <optimized out>
>         num_options = <optimized out>
>         myalloc = <optimized out>
>         p_options = 0xbf92de28

>         dest = 0x0

That's the problem - 'dest' is NULL and the program is trying to access
it. It is an error which should be reported to developer of project -
you should not use the pointer on structure without checking if it is
NULL...

'dest' variable is NULL because of this line:

dest = cupsGetDest (NULL, NULL, num_dests, dests);

cupsGetDest returns NULL. cupsGetDest() is called with first parameter
as NULL, which means it wants to return default destination - default
printer. If there isn't default printer, then it returns NULL.

Ian, would you mind checking if you have default printer set? You can
check it by '$ lpstat -d'. If it isn't set or it isn't set to printer
you want to use, you can change the settings in CUPS web ui on
localhost:631 (if cups service is running), in 'Printers' tab.

>
>         dests = 0x9c5fe48
>         p_choice = <optimized out>
>         p_ppd = <optimized out>
>         p_option = <optimized out>
> #1  0x08048b41 in main (argc=6, argv=0xbf92dec4) at fxlinuxprint.c:302
>         ch = '\000' <repeats 262144 times>
>         chPJL = '\000' <repeats 1024 times>
>         pdf_file_name =
> "\001\000\000\000\000\000\000\000\001\000\000\000\000Is\267( \303\t
> *M\267\006\000\000\000<\037S\267\000\000\000\000\000\260/\267\001\000\000\000\000\000\000\000dޒ\277\274?s\267\350ݒ\277\000\000\000\000F\206\004\b\000Is\267h\224:\267C\327O\267\377\377\377\377\001\000\000\000P}M\267]\210\004\b0\366\066\267\001\000\000\000\000\300\004\b\022\235\004\b\006\000\000\000\304ޒ\277\340ޒ\277\315\330O\267"
>         fd_in = <optimized out>
>         len = 0
>         stbuf = {st_dev = 9775345565697, __pad1 = 3024, st_ino =
> 3077633656, st_mode = 134514246,
>           st_nlink = 3075310992, st_uid = 134513404, st_gid = 1,
> st_rdev = 0, __pad2 = 56836,
>           st_size = -1217183812, st_blksize = -163754450, st_blocks =
> -1217181000, st_atim = {tv_sec = -1080893904,
>             tv_nsec = -1217284490}, st_mtim = {tv_sec = -1080893984,
> tv_nsec = 134513404}, st_ctim = {
>             tv_sec = -1080893976, tv_nsec = -1217181092}, __unused4 =
> 0, __unused5 = 3067874256}
>
> Very pretty but what does it mean?
>
> ian

-- 
Zdenek Dohnal
Associate Software Engineer
Red Hat Czech - Brno TPB-C



More information about the cups mailing list