This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgcj/13212] AttachCurrentThread() not working
- From: "alessio at itapac dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Dec 2003 09:58:55 -0000
- Subject: [Bug libgcj/13212] AttachCurrentThread() not working
- References: <20031127132523.13212.alessio@itapac.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From alessio at itapac dot net 2003-12-02 09:58 -------
I have investigated deeper. Hope this will help.
The problem is triggered mainly by Java::lang::Thread constructor, which calls
object allocation functions. GC_local_gcj_malloc() blindly gets TSD referred to
memory management (see the line just before the crash reported by GDB), but the
slot for the new created thread has not yet been configured (normally, the
pthread_create() call is wrapped and sets all up, but native threads call the
real pthread_create()). One solution (and hotfix) I have found is to force the
generation of this pool by calling
GC_init_thread_local(GC_new_thread(pthread_self()));
This should be done automatically, but I have never studied nor touched GCC
before, hope only this will help.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13212