emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems building trunk in OpenBSD/i386


From: Jan Djärv
Subject: Re: problems building trunk in OpenBSD/i386
Date: Fri, 13 Jul 2007 09:23:24 +0200
User-agent: Thunderbird 2.0.0.4 (Macintosh/20070604)



Ken Raeburn skrev:

The other parts of the stack trace indicate that the rest of the loop is in the C library -- pthread_once calls pthread_mutex_lock, which initializes some thread support code, which is causing some priority queue code to try to allocate storage, which winds up calling into gmalloc, which again ensures that initialization has been done by calling pthread_once.

This sounds like a bug in pthread_once.


The thread support in gmalloc.c appears to be turned on when gtk is available and selected and has the new file chooser interface, and pthread support is available.

As to how to fix it... I have no good idea at the moment. I assume OpenBSD uses GCC exclusively; if the platform supports constructor attributes on functions, perhaps we could force __malloc_initialize to be called at program startup, without thread protection, and hope that threads don't get created before main starts. It seems a bit dicey, but hey, so is replacing malloc. :-) Trying to detect recursive calls as opposed to simultaneous calls from multiple threads seems tricky, with some of the thread support unavailable until after we finish.


I think we safely can call malloc_initialize from main itself without thread protection. The protection is from threads created by the file dialog, and they get created when the dialog is first used. So we should be safe.

        Jan D.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]