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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitter:  John Wiersba <jrw>
Submitted:  Wed 17 May 2017 07:09:35 PM UTC
   
 
Severity:  4 - Important Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Jump to the original submission

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

Good.  Thanks for confirming.

Benno Schulenberg <bens>
Group administrator
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>
Group administrator
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>
Group administrator
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.)

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
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by jrw (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.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-05-19 bens Severity3 - Normal 4 - Important
        Open/ClosedOpen Closed
    2017-05-18 bens StatusNone Fixed
    2017-05-17 jrw Attached File- Added my.patch, #40728
    2017-05-17 bens Assigned toNone bens
        SummaryBuild on SunOS 5.10 segfaults when built on SunOS 5.10, nano segfaults during startup
    2017-05-17 jrw Attached 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.13-02a9.
    Corresponding source code