This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libobjc/38307] Calling of the +initialize method is not completely thread-safe
- From: "rfm at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 17 Mar 2011 06:20:49 +0000
- Subject: [Bug libobjc/38307] Calling of the +initialize method is not completely thread-safe
- Auto-submitted: auto-generated
- References: <bug-38307-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38307
--- Comment #6 from rfm at gnu dot org 2011-03-17 06:20:42 UTC ---
I spent some hours looking at your code and I like it ... it's certainly
clearer than mine.
I found three problems which i've fixed on my system:
1. failure to check CLS_ISRESOLV early enough (I added a check at the very
start of __objc_install_dtable_for_class,
2. I needed to add a check immediately after installing the dispatch table of
the superclass ... in case the +initialize in the superclass had actually
initialized the subclass too. In this case we need to return immediately from
__objc_install_dtable_for_class rather than trying to install the table again.
3. The +initialize method of class can cause changes to the methods of the
class, so the prepared dispatch table can need to be replaced during the
executing of +initialize. I added changes for that.
I've been working on an old copy of libobjc ... once I can get your patch plus
my modifications workng with svn trunk, I'll post a patch against the current
runtime code.