bugGNU nano - Bugs: bug #51053, when built on SunOS 5.10, nano...

 
 

bug #51053: when built on SunOS 5.10, nano segfaults during startup

Submitted by:  John Wiersba <jrw>
Submitted on:  Wed 17 May 2017 07:09:35 PM UTC  
 
Severity: 4 - ImportantStatus: Fixed
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Fri 19 May 2017 10:16:44 AM UTC, comment #7:

Good. Thanks for confirming.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Thu 18 May 2017 10:52:38 PM UTC, comment #6:

Thanks! 2.8.3 works now with ./configure CC=/bin/cc && make

John Wiersba <jrw>
Thu 18 May 2017 08:42:38 AM UTC, comment #5:

Fixed in git, 9ce41543.

I've not guarded each call separately, because all windows are normally initialized together (except topwin when the sreen is too small). The fix will be released in 2.8.3 later today.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 17 May 2017 11:49:39 PM UTC, comment #4:

I also see 3 calls to delwin() in src/global.c. You may want to guard those also.

John Wiersba <jrw>
Wed 17 May 2017 09:50:00 PM UTC, comment #3:

It looks like it's segfaulting in window_init() in the first call to delwin(topwin), where topwin is NULL.

I changed each of the calls to delwin() to say instead:
if (whatever != NULL) delwin(whatever);

Now, it no longer segfaults. See attached patch.

(file #40728)

John Wiersba <jrw>
Wed 17 May 2017 07:48:40 PM UTC, comment #2:

Hmm... To me it looks as if it segfaults when asking for controlhome...

To find out, please edit src/nano.c and find the line that contains "set up windows" (without the quotes). Then sprinkle some more of those fprintf(stderr, ...) lines after each block of function calls that follow. For example:

fprintf(stderr, "After window_init\n");

And so on, until and including the get_keycode() calls.
Especially put such an fprintf() before "controlhome = ..." and after "controlend = ...". Compile and then catch a trail again.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 17 May 2017 07:16:29 PM UTC, comment #1:

Looks like valgrind is not available for SunOS5.10 (only 5.11).

John Wiersba <jrw>
Wed 17 May 2017 07:09:35 PM UTC, original submission:

$ patch -i ../g* -p0 # apply guiding-the-linker.patch
$ ./configure CC=/bin/cc
$ /gnu/blah/make
$ src/nano
Segmentation Fault(coredump)

When I run under truss:

$ truss src/nano 2>../truss.out

it locks my terminal session, which it doesn't do when I do not run under truss.

I've attached the truss output, truss.out.

Reconfigured with --enable-debug and ran again, both with and without truss: trail.out and truss_trail.out attached.

Don't have valgrind available at the moment.

John Wiersba <jrw>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #40728:  my.patch added by jrw (735B - application/octet-stream)
file #40725:  truss.out added by jrw (14KiB - application/octet-stream)
file #40726:  truss_trail.out added by jrw (167KiB - application/octet-stream)
file #40727:  trail.out added by jrw (27KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Posted a comment)
  • -unavailable- added by jrw (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 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 19 May 2017 10:16:44 AM UTCbensSeverity3 - Normal=>4 - Important
      Open/ClosedOpen=>Closed
    Thu 18 May 2017 08:42:38 AM UTCbensStatusNone=>Fixed
    Wed 17 May 2017 09:49:59 PM UTCjrwAttached File-=>Added my.patch, #40728
    Wed 17 May 2017 07:48:40 PM UTCbensAssigned toNone=>bens
      SummaryBuild on SunOS 5.10 segfaults=>when built on SunOS 5.10, nano segfaults during startup
    Wed 17 May 2017 07:09:35 PM UTCjrwAttached File-=>Added truss.out, #40725
      Attached File-=>Added truss_trail.out, #40726
      Attached File-=>Added trail.out, #40727

    Back to the top


    Powered by Savane 3.1-cleanup1