Bug 209877 - PTHREAD_STACK_MIN is smaller than page size.
PTHREAD_STACK_MIN is smaller than page size.
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
rawhide
ppc64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks: FC6Blocker 206172
  Show dependency treegraph
 
Reported: 2006-10-07 06:34 EDT by David Woodhouse
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 2.5-3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-10-09 14:53:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test code. (2.95 KB, text/plain)
2006-10-07 06:35 EDT, David Woodhouse
no flags Details

  None (edit)
Description David Woodhouse 2006-10-07 06:34:23 EDT
See attached test program.

See correct behaviour when run on ppc32 kernel.
See timer_create() returning -EAGAIN when run on ppc64 kernel.

pmac /home/dwmw2 $ ./sigev_thread 
Creating timer
Create timer: Resource temporarily unavailable
pmac /home/dwmw2 $ ssh shinybook ./sigev_thread
Creating timer
Comment 1 David Woodhouse 2006-10-07 06:35:14 EDT
Created attachment 137969 [details]
Test code.
Comment 2 David Woodhouse 2006-10-07 06:38:12 EDT
This is what happens on ppc32 kernel (ignore the last few lines; that's just
strace being buggered and needing to be killed; bug 209873):


write(1, "Creating timer\n", 15Creating timer
)        = 15
rt_sigprocmask(SIG_SETMASK, ~[RT_1], [], 8) = 0
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x30002000
brk(0)                                  = 0x10011000
brk(0x10032000)                         = 0x10032000
mprotect(0x30002000, 4096, PROT_NONE)   = 0
clone(Process 18046 attached
child_stack=0x30005040,
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID,
parent_tidptr=0x30005508, tls=0x3000c940, child_tidptr=0x30005508) = 18046
[pid 18045] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid 18045] futex(0xf03017c, FUTEX_WAKE, 2147483647) = 0
[pid 18045] timer_create(CLOCK_REALTIME, {0x10011098, 32, SIGEV_THREAD_ID,
{18046}}, {0x1}) = 0
[pid 18045] exit_group(1)               = ?
[pid 18046] --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
[pid 18046] SYS_300(0x30005510, 0xc, 0x30005508, 0x3000c940, 0x30005508) = 0
[pid 18046] rt_sigtimedwait([RTMIN], Killed
Comment 3 David Woodhouse 2006-10-07 06:38:49 EDT
And this is what happens on ppc64...

write(1, "Creating timer\n", 15Creating timer
)        = 15
rt_sigprocmask(SIG_SETMASK, ~[RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
futex(0xefb017c, FUTEX_WAKE, 2147483647) = 0
dup(2)                                  = 3
fcntl64(3, F_GETFL)                     = 0x2 (flags O_RDWR)
brk(0)                                  = 0x10020000
brk(0x10050000)                         = 0x10050000
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 20), ...}) = 0
mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xf7fd0000
_llseek(3, 0, 0xff1aee38, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
write(3, "Create timer: Resource temporari"..., 47Create timer: Resource
temporarily unavailable
) = 47
close(3)                                = 0
munmap(0xf7fd0000, 65536)               = 0
exit_group(1)                           = ?
Process 7277 detached
Comment 6 David Woodhouse 2006-10-07 07:38:45 EDT
We fail to create the helper thread. This is because we try to create it with a
stack size of PTHREAD_STACK_MIN, which seems to be 16384.

That's not going to work on a machine with 64KiB pages.
Comment 7 Jakub Jelinek 2006-10-08 14:28:28 EDT
Please try glibc-2.5-3.
It isn't 100% POSIX conforming on ppc{,64}, because it doesn't reject
pthread_attr_setstack{,size} with sizes between 16K and 128K (new
PTHREAD_STACK_MIN), but that is only solvable with symbol versioning and
therefore only in glibc 2.6 which we can't ship in FC6.
Comment 8 David Woodhouse 2006-10-09 06:46:49 EDT
glibc-2.5-3 fixes the test case.

Note You need to log in before you can comment on or make changes to this bug.