bugGNU Enscript - Bugs: bug #28769, 1.6.5 segfaults in CFG_FATAL on...

 
 

bug #28769: 1.6.5 segfaults in CFG_FATAL on x86_64-sun-solaris2.10 with old enscript.cfg

Submitted by:  Tim Mooney <enchanter>
Submitted on:  Sat 30 Jan 2010 12:15:43 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 02 Jun 2010 11:54:59 PM UTC, comment #5:

Fixed in GNU Enscript 1.6.5.2.

Tim Retout <diocles>
Project Member
Wed 02 Jun 2010 06:45:52 PM UTC, comment #4:

Thanks for the analysis. I only reported it because it caused a segfault -- now that I know what's going on, I can work around it.

I see what you mean about the macro referencing random variables that aren't arguments. It might be time to promote CFG_FATAL from a macro to a full function that handles variadic arguments.

Thanks again!

Tim Mooney <enchanter>
Tue 01 Jun 2010 10:56:37 PM UTC, comment #3:

The segmentation fault is coming from the CFG_FATAL macro in src/util.c. It tries to print out 'fname' as part of the debugging information, but this has been changed in read_config to be a 'Buffer' struct rather than a string now.

(The CFG_FATAL macro is being triggered when there's an option the parser doesn't understand, which I think is fair enough.)

So. Hmm.

I don't particularly like the macro referencing random variables that aren't arguments... but for the moment, I'll make a new macro which uses Buffer objects.

Tim Retout <diocles>
Project Member
Wed 10 Feb 2010 10:34:13 PM UTC, comment #2:

I just attached the enscript.cfg that seems to be causing the issues.

Tim Mooney <enchanter>
Wed 10 Feb 2010 09:57:59 PM UTC, comment #1:

Hey Tim,

Would it be possible for you to post the config file that's causing the problem to Savannah?

Then I can figure out whether it happens on other platforms, and what should be done.

Thanks,

Tim Retout <diocles>
Project Member
Sat 30 Jan 2010 12:15:43 AM UTC, original submission:

I currently have enscript 1.6.1 installed on my x86_64-sun-solaris2.10 workstation.

When building 1.6.5, ever test fails and even the simplest invokation of enscript causes a segfault. It looks like the
fault is coming in the options file parsing for my (1.6.1-era) options file:

$ dbx enscript
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.7' in your .dbxrc
Reading enscript
Reading ld.so.1
Reading libintl.so.8.0.2
Reading libc.so.1
Reading libm.so.2
(dbx) run
Running: enscript
(process id 6107)
enscriptsignal SEGV (no mapping at the fault address) in strlen at 0xfffffd7fff274b50
0xfffffd7fff274b50: strlen+0x0020: cmpb $0x0000000000000000,(%rsi)
Current function is read_config
437 CFG_FATAL ((stderr, _("illegal option: %s"), token));
(dbx) where
[1] strlen(0xffffffffffffff76, 0x8a, 0xfffffd7fffdfc9a8, 0x73, 0xfffffffffffffffa, 0x45f678), at 0xfffffd7fff274b50
[2] _ndoprnt(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff2d04da
[3] _fprintf(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff2d12ba
=>[4] read_config(path = 0x42ec50 "/etc/local/gnu", file = 0x42ec60 "enscript.cfg"), line 437 in "util.c"
[5] main(argc = 1, argv = 0xfffffd7fffdfed88), line 1062 in "main.c"
(dbx) quit

Doing a bit more digging, it looks like the option it's complaining about is

StatesColorModel:

Tim Mooney <enchanter>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #19672:  enscript.cfg added by enchanter (5KiB - application/octet-stream - my enscript.cfg)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by diocles (Posted a comment)
  • -unavailable- added by enchanter (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 02 Jun 2010 11:54:59 PM UTCdioclesOpen/ClosedOpen=>Closed
    Wed 10 Feb 2010 10:33:43 PM UTCenchanterAttached File-=>Added enscript.cfg, #19672

    Back to the top


    Powered by Savane 3.1-cleanup1