qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] why does qemu i386 userspace emulation crashes when pthread used?
@ 2011-04-20  1:33 Yale Zhang
  2011-04-22 18:29 ` Yale Zhang
  0 siblings, 1 reply; 2+ messages in thread
From: Yale Zhang @ 2011-04-20  1:33 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 769 bytes --]

Hi. I'm want to run some pthread programs using qemu userspace emulation
(target=i386, host=x86_64,arm), but see NPTL support isn't supported for the
i386 target. I have applied a patch from here
http://patchwork.ozlabs.org/patch/45206/ and used it to run a simple pthread
fork, join program. The program is able to launch multiple threads, but the
1st thread that exits causes the program to crash inside the pthread
library.

What are the reasons NPTL isn't supported for i386 and was it ever supported
in the past? I even wrote another simple program that does the equivalent,
but with using fork(), waitpid() instead of pthread_create(),
pthread_join(), and it works correctly. This seems to suggest thread local
storage wasn't implemented correctly?

Thanks,
Yale

[-- Attachment #2: Type: text/html, Size: 946 bytes --]

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

* Re: [Qemu-devel] why does qemu i386 userspace emulation crashes when pthread used?
  2011-04-20  1:33 [Qemu-devel] why does qemu i386 userspace emulation crashes when pthread used? Yale Zhang
@ 2011-04-22 18:29 ` Yale Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: Yale Zhang @ 2011-04-22 18:29 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

I have found the problem and fix. NEW_STACK_SIZE for clone()  should be
increased from the default 16384 (x86_64) to  256 KiB.

On Tue, Apr 19, 2011 at 6:33 PM, Yale Zhang <yzhang1985@gmail.com> wrote:

> Hi. I'm want to run some pthread programs using qemu userspace emulation
> (target=i386, host=x86_64,arm), but see NPTL support isn't supported for the
> i386 target. I have applied a patch from here
> http://patchwork.ozlabs.org/patch/45206/ and used it to run a simple
> pthread fork, join program. The program is able to launch multiple threads,
> but the 1st thread that exits causes the program to crash inside the pthread
> library.
>
> What are the reasons NPTL isn't supported for i386 and was it ever
> supported in the past? I even wrote another simple program that does the
> equivalent, but with using fork(), waitpid() instead of pthread_create(),
> pthread_join(), and it works correctly. This seems to suggest thread local
> storage wasn't implemented correctly?
>
> Thanks,
> Yale
>
>

[-- Attachment #2: Type: text/html, Size: 1432 bytes --]

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

end of thread, other threads:[~2011-04-22 18:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-20  1:33 [Qemu-devel] why does qemu i386 userspace emulation crashes when pthread used? Yale Zhang
2011-04-22 18:29 ` Yale Zhang

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