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

Submitter:  Tim Mooney <enchanter>
Submitted:  Sat 30 Jan 2010 12:15:43 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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

Fixed in GNU Enscript 1.6.5.2.

Tim Retout <diocles>
Group 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>
Group 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>
Group 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 Files:
   
   
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
  • -email is unavailable- added by diocles (Posted a comment)
  • -email is unavailable- added by enchanter (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-06-02 diocles Open/ClosedOpen Closed
    2010-02-10 enchanter Attached File- Added enscript.cfg, #19672

    Back to the top

    Powered by Savane 3.13-aa77.
    Corresponding source code