bugGNUstep - Bugs: bug #24239, _NS_COUNT_HACK causes SIGBUS on...

 
 

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

bug #24239: _NS_COUNT_HACK causes SIGBUS on NetBSD/AMD64

Submitted by:  David Wetzel <dwetzel>
Submitted on:  Wed 10 Sep 2008 08:56:10 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Wont Fix
Privacy: PublicAssigned to: None
Open/Closed: Declined

Thu 11 Sep 2008 05:42:56 PM UTC, comment #4:

I stand corrected... in a simplified test program I get:

./obj/QuickTest: Uncaught exception NSGenericException, reason: Exception
Abort trap (core dumped)

... so ignore me for now...

David Ayers <ayers>
Project Member
Thu 11 Sep 2008 09:39:33 AM UTC, comment #3:

Are you by some chance using an old version of the base library?

You say 'The effect here is that the uncought exception is not logged' ... but that's not how it should be working.

The effect you should be seeing is:

1. exception is raised and NSCountFrames() is called
2. NSCountFrames sets signal handler
3. stack frames are counted to the point where SIGBUS is sent
4. signal handler catches signal and terminates frame count
5. NSCountFrames returns to the exception code
6. The exception is caught, or NSUncaughtExceptionhander is called.

Richard Frith-Macdonald <CaS>
Project Member
Thu 11 Sep 2008 09:19:47 AM UTC, comment #2:

From NSException -raise:
#if defined(DEBUG)
if (_e_stack == nil)
{
ASSIGN(_e_stack, GSPrivateStackAddresses());
}
#endif

Would you accept another define/configure option to turn this part off for NetBSD/AMD64? Or probably even better in GSPrivatStackAdresses itself to return nil...

It seems that the error is triggerd by unnecessary (albeit very usefull if it works) functionality. The effect here is that the uncought exception is not logged anymore so a developer could be mislead to believe that there is a bug in -base rather than in his code.

It will be be quite a while before NetBSD will have a new system compiler.

David Ayers <ayers>
Project Member
Thu 11 Sep 2008 07:56:15 AM UTC, comment #1:

This is a known bug in the builtin function provided by gcc to perform the stack frame count.... which is why gnustep-base catches the sigbus with an exception handler and terminates the frame count at this point.
If/when the issue is fixed in gcc, we might want to remove the signal handling code to improve performance of exception handling, but as exceptions should be rare events, I think even that would be a low priority issue.

Richard Frith-Macdonald <CaS>
Project Member
Wed 10 Sep 2008 08:56:10 PM UTC, original submission:

Program received signal SIGBUS, Bus error.
0x00007f7ffd2c46b4 in NSCountFrames () at NSDebug.m:1006
1006 _NS_COUNT_HACK(60); _NS_COUNT_HACK(61); _NS_COUNT_HACK(62);
Current language: auto; currently objective-c
(gdb) bt
#0 0x00007f7ffd2c46b4 in NSCountFrames () at NSDebug.m:1006
#1 0x00007f7ffd2cb262 in GSPrivateStackAddresses () at NSDebug.m:1100
#2 0x00007f7ffd2e1a2b in -[NSException raise] (self=0x10fd410, _cmd=0x7f7ffd678500) at NSException.m:824
#3 0x00007f7ffd2e14ff in +[NSException raise:format:arguments:] (self=0x7f7ffd6780a0, _cmd=0x7f7ffd6784d0, name=0x7f7ffd677c20, format=0x7f7ffd6aae20,
argList=0x7f7fffffbe30) at NSException.m:767
#4 0x00007f7ffd2e1435 in +[NSException raise:format:] (self=0x7f7ffd6780a0, _cmd=0x7f7ffd6aaf30, name=0x7f7ffd677c20, format=0x7f7ffd6aae20)

David Wetzel <dwetzel>
Project Member

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ayers (Posted a comment)
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by dwetzel (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
    Thu 11 Sep 2008 07:56:15 AM UTCCaSStatusNone=>Wont Fix
      Open/ClosedOpen=>Declined

    Back to the top


    Powered by Savane 3.1-cleanup1