This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgcj/13212] AttachCurrentThread() not working


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]