bugGNUstep - Bugs: bug #38680, Crash when observing notifications...

 
 

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

bug #38680: Crash when observing notifications via a forwarded selector

Submitted by:  Wolfgang Lux <wlux>
Submitted on:  Sun 07 Apr 2013 10:18:31 AM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Tue 09 Apr 2013 06:56:26 AM UTC, comment #2:

I've updated gnustep-base from svn and observing notifications with forwarded methods now works fine for me.

Thanks

Wolfgang Lux <wlux>
Mon 08 Apr 2013 05:02:09 PM UTC, comment #1:

Thanks ... should be fixed in trunk now.

Richard Frith-Macdonald <CaS>
Project Member
Sun 07 Apr 2013 10:18:31 AM UTC, original submission:

I have recently stumbled across this nasty bug when using the StepTalk framework to handle notifications in a script.
The attached test program crashes under GNUstep when the notification is posted. I had a tough time tracking this bug down. It happens because when an observer is registered the notification center saves the method's implementation. As -test: is a forwarded method, the code for -methodForSelector: returns a fresh closure by calling cifframe_closure. But this closure is allocated in an autoreleased memory block, so at the time the notification is posted, the closure is no longer valid and the closure's code has been overwritten by some random data.
Incidentally, the test program works fine under OS X.

Wolfgang Lux <wlux>

 

Attached Files
file #27803:  GNUmakefile added by wlux (192B - application/octet-stream)
file #27804:  main.m added by wlux (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by wlux (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 10 Apr 2013 12:43:04 PM UTCCaSOpen/ClosedIn Test=>Closed
    Mon 08 Apr 2013 05:02:09 PM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>In Test
    Sun 07 Apr 2013 10:18:31 AM UTCwluxAttached File-=>Added GNUmakefile, #27803
      Attached File-=>Added main.m, #27804

    Back to the top


    Powered by Savane 3.1-cleanup1