[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #38680] Crash when observing notifications via a forwarded selector
From: |
Wolfgang Lux |
Subject: |
[bug #38680] Crash when observing notifications via a forwarded selector |
Date: |
Sun, 07 Apr 2013 10:18:32 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-US) AppleWebKit/533.21.1+(KHTML, like Gecko, Safari/533.19.4) Version/5.11.1 OmniWeb/622.18.0 |
URL:
<http://savannah.gnu.org/bugs/?38680>
Summary: Crash when observing notifications via a forwarded
selector
Project: GNUstep
Submitted by: wlux
Submitted on: So 07 Apr 2013 10:18:31 GMT
Category: Base/Foundation
Severity: 3 - Normal
Item Group: Bug
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
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.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: So 07 Apr 2013 10:18:31 GMT Name: GNUmakefile Size: 192B By: wlux
<http://savannah.gnu.org/bugs/download.php?file_id=27803>
-------------------------------------------------------
Date: So 07 Apr 2013 10:18:31 GMT Name: main.m Size: 3kB By: wlux
<http://savannah.gnu.org/bugs/download.php?file_id=27804>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?38680>
_______________________________________________
Nachricht gesendet von/durch Savannah
http://savannah.gnu.org/
- [bug #38680] Crash when observing notifications via a forwarded selector,
Wolfgang Lux <=