bugGNUstep - Bugs: bug #21415, gdnc segfaults on OpenBSD

 
 

bug #21415: gdnc segfaults on OpenBSD

Submitted by:  Riccardo Mottola <rmottola>
Submitted on:  Wed 24 Oct 2007 07:58:58 PM UTC  
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned 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.

 

( Jump to the original submission)

Wed 20 Feb 2008 09:49:23 AM UTC, comment #8: 

it was on sparc32/openbsd

As the problem was discovered on my machine, I'll mark the bug as closed and invalid.

The problem was related to a bad libobj runtime. Installing ours fixed. The problem happened inside a thr-pthread.m call form the autorelease pool creation.

I think that this bug was unrelated to other bugs and confused things.

Riccardo Mottola <rmottola>
Project Member
Wed 20 Feb 2008 07:24:36 AM UTC, comment #7: 

I'm losing track here ...

The initial report was for sparc32/openbsd, but the problem is not a general sparc32 issue as sparc32/solaris works fine.

Sebastian has a crash on sparc64/openbsd.  His stacktrace looks like an ffcall related issue and is totally different from the original one.

Greg's problem does not specify whether it's 32 or 64 bit.  The stack looks like the original problem, but Greg says this is on startup, and Sebastian's is clearly after startup when a client is sending a message to the server.

So it looks like there might be two separate problems, one on sparc32/openbsd and the other on sparc64/openbsd.

If someone can give me access to an account on the relevant machines I can look at things under debug today (tomorrow I set off for FOSDEM and won't be back until Tuesday).  Alternatively/additionally it would be good to get some clarity by, for each os/architecture, checking the following.
1. is the crash actually on startup or when a client connects?
2. does the crash occur both when running autolaunched and when started manually and when started manually without forking?

Richard Frith-Macdonald <CaS>
Project Member
Tue 19 Feb 2008 10:43:31 PM UTC, comment #6: 

The backtrace is corrupted on OpenBSD sparc.   From tracing it through the debugger it is dying on this call:

Breakpoint 4, main (argc=1, argv=0xf7fe715c, env=0xf7fe7164)
    at NSProcessInfo.m:910
910       _gnu_process_args(argc, argv, env);

Specifically, it's dying here:

(gdb) step
_gnu_process_args (argc=1, argv=0xf7fe715c, env=0xf7fe7164)
    at NSProcessInfo.m:231
231       CREATE_AUTORELEASE_POOL(arp);
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x0fb5b57c in -[NSString initWithFormat:locale:arguments:] (self=Cannot access memory at address 0xf7bffeb4
)
    at NSString.m:1064
1064      unichar       *fmt = fbuf;
(gdb)

The location at the end is wrong because of the stack corruption, but it's definitely happening in CREATE_AUTORELEASE_POOL somewhere.  GC

Gregory John Casamento <gcasa>
Project Administrator
Sun 17 Feb 2008 11:57:30 AM UTC, comment #5: 

I've seen this on OpenBSD 4.2-current sparc64:

(gdb) bt
#0  0x000000004e880d68 in __builtin_avcall () from /usr/local/lib/libavcall.so.1.0
#1  0x00000000423dd074 in GSFFCallInvokeWithTargetAndImp (_inv=0x42be3b10, anObject=0x8, imp=0x4bf9e51a) at GSFFCallInvocation.m:636
#2  0x000000004224abf4 in callframe_do_call (ctxt=0xfffffffffffbf470, decoder=0x422c9f00 <callDecoder>, encoder=0x422ca07c <callEncoder>) at callframe.m:453
#3  0x00000000422ca854 in -[NSConnection(Private) _service:forwardForProxy:] (self=0x4893a210, _cmd=0x4274c240, aRmc=0x4893bd10) at NSConnection.m:2473
#4  0x00000000422c92d8 in -[NSConnection(Private) handlePortMessage:] (self=0x4893b210, _cmd=0x42794388, msg=0x4e750650) at NSConnection.m:2231
#5  0x00000000423d8930 in -[NSMessagePort handlePortMessage:] (self=0x40aedfd0, _cmd=0x42794388, m=0x4e750650) at NSMessagePort.m:1555
#6  0x00000000423d5c28 in -[GSMessageHandle receivedEvent:type:extra:forMode:] (self=0x4893aa10, _cmd=0x42794578, data=0x1, type=ET_RPORT, extra=0x0, mode=0x427940e8) at NSMessagePort.m:881
#7  0x00000000423d8f18 in -[NSMessagePort receivedEvent:type:extra:forMode:] (self=0x40aedfd0, _cmd=0x4893aa10, data=0x40aedfd0, type=ET_RPORT, extra=0x0, mode=0x427773a8) at NSMessagePort.m:1694
#8  0x00000000424142f4 in -[GSRunLoopCtxt pollUntil:within:] (self=0x42be2810, _cmd=0x427771a0, milliseconds=0, contexts=0x42be0790) at GSRunLoopCtxt.m:592
#9  0x00000000423723fc in -[NSRunLoop acceptInputForMode:beforeDate:] (self=0x42be0350, _cmd=0x427771f0, mode=0x427773a8, limit_date=0x4bf9e210) at NSRunLoop.m:969
#10 0x00000000423728bc in -[NSRunLoop runMode:beforeDate:] (self=0x42be0350, _cmd=0x42777210, mode=0x427773a8, date=0x4bf9e310) at NSRunLoop.m:1041
#11 0x0000000042372b8c in -[NSRunLoop runUntilDate:] (self=0x42be0350, _cmd=0x42777200, date=0x4bf9e310) at NSRunLoop.m:1072
#12 0x0000000042372aac in -[NSRunLoop run] (self=0x42be0350, _cmd=0x3078f8) at NSRunLoop.m:1055
#13 0x000000000010568c in gnustep_base_user_main (argc=2, argv=0xfffffffffffc0168, env=0x4e73b890) at gdnc.m:1163
#14 0x0000000000101d58 in ___start ()
#15 0x0000000040b02f24 in _dl_start () from /usr/libexec/ld.so
#16 0x0000000040b02f24 in _dl_start () from /usr/libexec/ld.so
(gdb) list GSFFCallInvocation.m:636
631                 break;
632             }
633         }
634
635       /* Do it */
636       av_call(alist);
637     }
638
639     - (void) invokeWithTarget: (id)anObject
640     {
(gdb) list callframe.m:453
448       inv->_selector = selector;
449       inv->_cframe = cframe;
450       inv->_info = [sig methodInfo];
451       inv->_numArgs = [sig numberOfArguments];
452       ctxt->objToFree = (id)inv;
453       GSFFCallInvokeWithTargetAndImp((NSInvocation *)inv, object,
454                                      method_implementation);
455       ctxt->objToFree = nil;
456       NSDeallocateObject((NSInvocation *)inv);
457
(gdb) frame 1
#1  0x00000000423dd074 in GSFFCallInvokeWithTargetAndImp (_inv=0x42be3b10, anObject=0x8, imp=0x4bf9e51a) at GSFFCallInvocation.m:636
636       av_call(alist);
Current language:  auto; currently objective-c
(gdb) print alist
$1 = {func = 0x103340 <-[GDNCServer addObserver:selector:name:object:suspensionBehavior:for:]>, flags = 4, raddr = 0x0, rtype = __AVvoid, rsize = 0, aptr = 0xfffffffffffbe9a8, eptr = 0xfffffffffffbf168, anum = 8, farg_mask = 0, darg_mask = 0, args = {1085196176, 1114984000, 1182022736, 1333736400, 0,
    1316293136, 2, 1119763728, 0, 0, 1174790112, 19140298416324608, 0, 0, 1135189984, 0, 59596966199296, 0, 0, 0, 0, 0, 0, 0, 1085145056, 0, 1135189984, 0, 0, 4294967296, 1119762688, 5, 1174790112, 6648151301549554358, 1119762816, 8589934593, 0, 8589934593, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4294967296, 1119762176,
    5, 1174790112, 0, 1119762560, 1316291008, 1119762704, 4294967296, 0, 0, 1174790112, -266781, 1119762816, 1119762816, 1119762704, 5611211344, 9, 9216, 16896, 22589922064, 1118522912, 1115228760, 1274668224, 40, 1112650960, 6648151301549554358, 43, -269295, 1096220640, 1115228760, 1316292864, 33792, 33792,
    0, 1115103432, 0, 1118522912, 1316292880, 1115068312, 1316292880, 59392, 1115085584, 2, -269167, -7723941601572167021, 1244313984, 1115086096, 1115154376, 1, 6648151301549554358, 0, -269103, -7723941601572290497, 1114892440, 1171128288, 1115068312, 1115068328, 0, 16896, 1114869432, 1118522912, 1316292304,
    1115068872, 1217641744, 1, 1115085584, 2, -268959, -7723941601572368129, 1115228760, 1274668320, 40, 587202597, 1115154264, 3, -281470682012414, 100334859266, 1316292880, 1114954432, 1115068872, 1114892680, 33792, 33792, 1114978624, 1115103432, 1, 1118522912, 1316292304, 1115085728, 1217641744,
    1217634832, 1115085176, 2, -268751, -7723941601572282405, -268719, -7723941601572286037, 1073741824, 48, 1274668128, 5845553585, 3173768, 72057594037927939, -268687, 4294967297, 1115085744, 0, -1, 1115085728, 31744, 1114978624, 18432, 1118522912, 1217641744, 1115068872, 1114937104, -266368, 1115085176, 2,
    -268543, -7723941601572368129, 1115085176, 4, 12884633553, -7723941601571891009, 1217641912, 32, 1217641744, 1114916256, 1119748944, 1115243048, 1115068872, 1217634832, 33792, 33792, 1217641912, 1115103432, 31744, 1118522912, 1217641744, 1114946496, 64, 1316291314, 1114945560, 1114937104, -268335,
    -7723941601571651109, 1217634832, 1115085728, 1217641912, 2, -268111...}}
(gdb)

This happened when running: openapp AddressManager (or any other application I've tried)

I haven't seen these problems on OpenBSD i386.

I'll see that I get my sparc and vax up and running, to see what happens there too.

Sebastian Reitenbach <buzzdee>
Project Member
Tue 29 Jan 2008 10:22:56 PM UTC, comment #4: 

just as a test I tried halving the arrays (and the test) and it did not help.

Riccardo Mottola <rmottola>
Project Member
Sun 06 Jan 2008 11:42:48 PM UTC, comment #3: 

since you thought about stack, I unlimited stack. gdnc just hung. minutes. Then I got a segfault and the .core file filled up my disk, more than 200MB of core! I needed to remove it.

I fear some sort of recursion?

Riccardo Mottola <rmottola>
Project Member
Sun 06 Jan 2008 11:24:41 PM UTC, comment #2: 

first a stacktrace of a rpetty current build.
Program received signal SIGSEGV, Segmentation fault.
0x0e9124b0 in -[NSString initWithFormat:locale:arguments:] (self=Cannot access memory at address 0xf7bff31c
)
    at NSString.m:1064
1064      unichar       *fmt = fbuf;
Current language:  auto; currently objective-c

#0  0x0e9124b0 in -[NSString initWithFormat:locale:arguments:] (self=Cannot access memory at address 0xf7bff31c
)
    at NSString.m:1064
#1  0x9556a9de in ?? ()
#2  0x9556a9de in ?? ()
Previous frame identical to this frame (corrupt stack?)

Riccardo Mottola <rmottola>
Project Member
Tue 01 Jan 2008 05:51:23 PM UTC, comment #1: 

Is this problem still open? If so, you could try to half the size of all the arrays in this method. Use
  unsigned char buf[1024];
  GSStr_t f;
  unichar fbuf[512];
and 512 for the following test.

The method initWithFormat:locale:arguments: on NSString (and the similar on GSString) is really using up a lot of stack space, perhaps that is more limited for OpenBSD on sparc and so the tools fails there.
If this hack solves the problem, we should think about using the macros GS_BEGINITEMBUF and GS_ENDITEMBUF from GSPrivate.h here. This would make it easier to adjust the stack usage for different environments.

Fred Kiefer <FredKiefer>
Project Member
Wed 24 Oct 2007 07:58:58 PM UTC, original submission:  

on OepnBSD sparc32 gdnc segfaults on launch (this apparently also blocks the building of gui since probably plist aborts)

There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-unknown-openbsd4.1"...
(gdb) run
Starting program: /usr/GNUstep/System/Tools/gdnc

Program received signal SIGSEGV, Segmentation fault.
0x0a27ce78 in -[NSString initWithFormat:locale:arguments:] (self=Cannot access memory at address 0xf7bff544
)
    at NSString.m:1064
1064      unichar       *fmt = fbuf;
Current language:  auto; currently objective-c
(gdb) bt
#0  0x0a27ce78 in -[NSString initWithFormat:locale:arguments:] (self=Cannot access memory at address 0xf7bff544
)
    at NSString.m:1064
#1  0x057b08bd in ?? ()
#2  0x057b08bd in ?? ()
Previous frame identical to this frame (corrupt stack?)
(gdb)

Riccardo Mottola <rmottola>
Project Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by gcasa (Posted a comment)
  • -email is unavailable- added by buzzdee (Posted a comment)
  • -email is unavailable- added by FredKiefer (Posted a comment)
  • -email is unavailable- added by rmottola (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-02-20 rmottola StatusIn Progress => Invalid
        Open/ClosedOpen => Closed
    2008-02-19 gcasa StatusNone => In Progress

    Back to the top


    Powered by Savane 3.7