Summary: | pthread_atfork misbehaves in initial thread | ||
---|---|---|---|
Product: | Base System | Reporter: | Douglas Wells <sysmaint> |
Component: | threads | Assignee: | freebsd-threads (Nobody) <threads> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | kib, sysmaint |
Priority: | Normal | ||
Version: | 6.2-RELEASE | ||
Hardware: | Any | ||
OS: | Any |
Description
Douglas Wells
2007-08-05 10:40:01 UTC
Hi, On FreeBSD-CURRENT, if I do: gcc pthread_atforkbug.c -lkse && ./a.out This is the output: parent pid (48871) Child exiting: (48872) child (48872) returned If I do: gcc pthread_atforkbug.c -lkse && ./a.out parent pid (48877) af_prepare: pid (48877) af_parent: pid (48877) af_child: pid (48878) Child exiting: (48878) child (48878) returned On FreeBSD 6.2, -pthread is mapped to -lkse, while on CURRENT, it is mapped to -lthr. Can you try your test again with -lthr on FreeBSD 6.2? This looks like a libkse bug. -- Craig Rodrigues rodrigc@crodrigues.org > Hi,
>
> On FreeBSD-CURRENT, if I do:
>
> gcc pthread_atforkbug.c -lkse && ./a.out
>
> This is the output:
>
> parent pid (48871)
> Child exiting: (48872)
> child (48872) returned
>
> If I do:
>
> gcc pthread_atforkbug.c -lkse && ./a.out
>
> parent pid (48877)
> af_prepare: pid (48877)
> af_parent: pid (48877)
> af_child: pid (48878)
> Child exiting: (48878)
> child (48878) returned
>
>
> On FreeBSD 6.2, -pthread is mapped to -lkse, while on CURRENT, it is mapped
> to -lthr. Can you try your test again with -lthr on FreeBSD 6.2?
> This looks like a libkse bug.
>
> --
> Craig Rodrigues
> rodrigc@crodrigues.org
Yes, I can verify that using:
-pthread => erroneous behavior
-lthr => expected behavior
on my installation of 6.2.
- dmw
|