qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] bug in ARM thumb usermode emulation
@ 2006-09-18 20:05 Rafael Espíndola
  2006-09-18 20:16 ` Paul Brook
  0 siblings, 1 reply; 6+ messages in thread
From: Rafael Espíndola @ 2006-09-18 20:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: maemo-developers

Running python 2.4 in qemu sometimes causes this assert

Inconsistency detected by ld.so: rtld.c: 288: _dl_start_final:
Assertion `info->l.l_tls_modid == 0' failed!

The same error is present in all versions tested (0.8.1, 0.8.2 and CVS).

I have been able to create a "small" ARM chroot that contais a test
program and python 2.4. It is available at
http://www.maemo.org.br/platform/rafael/qemu-bug.tar.bz2

The test program sets some environment variables and execs python. The
test can be run with

sudo chroot bug/ ./test

An equivalent test program that skips qemu runs correctly in a real
ARM device, so I thing that the bug is really in qemu.

The bug is very dependent on the environment variables and argv. Small
changes can hide the bug.

Do you have any suggestions on how to debug this?

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] bug in ARM thumb usermode emulation
  2006-09-18 20:05 [Qemu-devel] bug in ARM thumb usermode emulation Rafael Espíndola
@ 2006-09-18 20:16 ` Paul Brook
  2006-09-18 20:43   ` Rafael Espíndola
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Paul Brook @ 2006-09-18 20:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: maemo-developers

On Monday 18 September 2006 21:05, Rafael Espíndola wrote:
> Running python 2.4 in qemu sometimes causes this assert
>
> Inconsistency detected by ld.so: rtld.c: 288: _dl_start_final:
> Assertion `info->l.l_tls_modid == 0' failed!

TLS and multithreaded applications are known to not work with usermode 
emulation.

Paul

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] bug in ARM thumb usermode emulation
  2006-09-18 20:16 ` Paul Brook
@ 2006-09-18 20:43   ` Rafael Espíndola
  2006-09-18 20:56     ` Paul Brook
  2006-09-19 20:36   ` Rafael Espíndola
  2006-09-29 10:59   ` Rafael Espíndola
  2 siblings, 1 reply; 6+ messages in thread
From: Rafael Espíndola @ 2006-09-18 20:43 UTC (permalink / raw)
  To: Paul Brook; +Cc: qemu-devel

> TLS and multithreaded applications are known to not work with usermode
> emulation.

We use python for compiling python modules inside scratchbox. So I
need to fix this  or find a workaround (undef  Py_HAVE_NATIVE_TLS?).

What must be done for implementing TLS + multithread in qemu? Maybe I can help.

> Paul
>

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] bug in ARM thumb usermode emulation
  2006-09-18 20:43   ` Rafael Espíndola
@ 2006-09-18 20:56     ` Paul Brook
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Brook @ 2006-09-18 20:56 UTC (permalink / raw)
  To: qemu-devel

> What must be done for implementing TLS + multithread in qemu? Maybe I can
> help.

* Implement the TLS syscalls (futexes and the architecture specific bits).
There's a patch for clone() here: https://nowt.dyndns.org/patch.qemu_nptl
* Fix all the bits of qemu that aren't threadsafe (mainly the TB cache IIRC).
* Fix guest atomic operations, and make sure guest coherency/ordering 
guaranteed are honoured, even which not guaranteed natively by the host.

Note that this only applies to usermode emulation. Full system emulation works 
fine because this is all handled by the guest kernel, exactly the same as on 
real hardware.

Paul

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] bug in ARM thumb usermode emulation
  2006-09-18 20:16 ` Paul Brook
  2006-09-18 20:43   ` Rafael Espíndola
@ 2006-09-19 20:36   ` Rafael Espíndola
  2006-09-29 10:59   ` Rafael Espíndola
  2 siblings, 0 replies; 6+ messages in thread
From: Rafael Espíndola @ 2006-09-19 20:36 UTC (permalink / raw)
  To: Paul Brook; +Cc: qemu-devel

On 9/18/06, Paul Brook <paul@codesourcery.com> wrote:
> TLS and multithreaded applications are known to not work with usermode
> emulation.
It looks like this is a memory corruption problem and the assert that
fails is just a coincidence!

I started to remove code from python to find what triggers the assert.
I ended up with an empty main linked only with libc!

I new version of the chroot is available at
http://www.maemo.org.br/platform/rafael/qemu-bug.tar.bz2

Any ideas on how to debug this?

> Paul

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] bug in ARM thumb usermode emulation
  2006-09-18 20:16 ` Paul Brook
  2006-09-18 20:43   ` Rafael Espíndola
  2006-09-19 20:36   ` Rafael Espíndola
@ 2006-09-29 10:59   ` Rafael Espíndola
  2 siblings, 0 replies; 6+ messages in thread
From: Rafael Espíndola @ 2006-09-29 10:59 UTC (permalink / raw)
  To: Paul Brook; +Cc: qemu-devel

> TLS and multithreaded applications are known to not work with usermode
> emulation.

In the end, it was an uninitialized stack allocated variable in libc
that was causing this problem
(http://sources.redhat.com/ml/libc-alpha/2006-09/msg00063.html).

> Paul
>

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-09-29 10:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-18 20:05 [Qemu-devel] bug in ARM thumb usermode emulation Rafael Espíndola
2006-09-18 20:16 ` Paul Brook
2006-09-18 20:43   ` Rafael Espíndola
2006-09-18 20:56     ` Paul Brook
2006-09-19 20:36   ` Rafael Espíndola
2006-09-29 10:59   ` Rafael Espíndola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).