Problem with threads in Scratchbox with Qemu for ARM
Hello,
I'm trying the Scratchbox/Maemo devkit for the Nokia770/N800 ARM device, and I'm having a problem running a multi-threaded program under application Qemu ARM emulation on my x86 linux box. The application I'm trying to run is the Boehm GC, which seems to run fine on the N770 device, but fails to work on that scratchbox/qemu ARM emulation.
The application is available here:
http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc7.0alpha7.tar.gz
In order to make it work on scratchbox/maemo you have to change the line 1729 of include/private/gcconfig.h from:
# define LINUX_STACKBOTTOM
to:
# define HEURISTIC2
For a real ARM the original file should work.
To reproduce the problem:
./configure
make
make gctest
./gctest
This deadlocks and strace hints that signals sent by pthreads are delivered to the wrong threads. We've discussed this already on the GC mailing list there:
http://article.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/1556
Does anyone know of known problems under Qemu for ARM and pthreads ? Or any way I could verify that it's really Qemu's fault ? Thanks.
Quoted 2 lines
Does anyone know of known problems under Qemu for ARM and pthreads ?
Yes, it is known ... last occurence in the mailing list archive is :
On Saturday 20 January 2007 14:43, Paul Brook wrote:
[...]
Quoted 5 lines
Threaded applications don't work reliably under qemu.
See mailing list archives for discussions of the technical reasons why.Paul
Signature · 1 line
Vincent
Quoted 3 lines · Vincent Palatin
Quoted 1 line
Does anyone know of known problems under Qemu for ARM and pthreads ?
Yes, it is known ... last occurence in the mailing list archive is :
Thanks, I guess I failed to find the exact posts mentioning the reasons.
Any idea if this area will improve in the near future ? Or if there is a good reason why it will not improve ?
Quoted 8 lines · Stephane Epardaud
Quoted 3 lines · Vincent Palatin
Quoted 1 line
Does anyone know of known problems under Qemu for ARM and pthreads ?
Yes, it is known ... last occurence in the mailing list archive is :
Thanks, I guess I failed to find the exact posts mentioning the reasons. Any idea if this area will improve in the near future ? Or if there is a good reason why it will not improve ?
I think some useful information on this topic are in the thread "[PATCH]ish NPTL support." on qemu-devel list.
The thread starts at this message :
http://lists.gnu.org/archive/html/qemu-devel/2006-12/msg00079.html
the following message gives interesting ideas :
http://lists.gnu.org/archive/html/qemu-devel/2006-12/msg00208.html
( portability issue on host without modern NPTL)
Another big issue is that dynamic translator is not thread safe, see Fabrice post :
http://lists.gnu.org/archive/html/qemu-devel/2006-12/msg00163.html
Signature · 1 line
Vincent
Thanks for the infos!