Bug 209877 - PTHREAD_STACK_MIN is smaller than page size.
Summary: PTHREAD_STACK_MIN is smaller than page size.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: ppc64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks: FC6Blocker 206172
TreeView+ depends on / blocked
 
Reported: 2006-10-07 10:34 UTC by David Woodhouse
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 2.5-3
Clone Of:
Environment:
Last Closed: 2006-10-09 18:53:41 UTC
Type: ---
Embargoed:


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

Description David Woodhouse 2006-10-07 10:34:23 UTC
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 10:35:14 UTC
Created attachment 137969 [details]
Test code.

Comment 2 David Woodhouse 2006-10-07 10:38:12 UTC
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 10:38:49 UTC
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 11:38:45 UTC
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 18:28:28 UTC
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 10:46:49 UTC
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.