Bug#575534: libc6: periodic timers hang fork()
Package: libc6
Version: 2.10.2-6
Severity: normal
Whenever a program uses some kind of periodic timer (profiling, Haskell
thread scheduler, ...) and makes a fork call that takes more time than the
timer's interval, it enters and endless loop of clone syscalls being
interrupted by the signal:
17:08:49.362528 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb765f938) = ? ERESTARTNOINTR (To be restarted) <0.031840>
17:08:49.394551 --- SIGPROF (Profiling timer expired) @ 0 (0) ---
17:08:49.394693 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb765f938) = ? ERESTARTNOINTR (To be restarted) <0.031548>
17:08:49.426335 --- SIGPROF (Profiling timer expired) @ 0 (0) ---
17:08:49.426475 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb765f938) = ? ERESTARTNOINTR (To be restarted) <0.031768>
17:08:49.458339 --- SIGPROF (Profiling timer expired) @ 0 (0) ---
[... and so on ...]
On my hardware, this happens for programs using more than 400 megs of memory
(there's a linear dependence between memory used and the duration of clone).
That means that any program that uses more than 400 megs of memory can't use
fork and be profiled at the same time.
A reproducer is at <http://store.lisk.in/tmp/perm/fork_profiling_hang.tar.gz>.
`make all' generates a graph of the said dependence and `make hang' launches a
test case that consumes 500 megs of memory and forks then. If that's not
enough, just raise the number in the Makefile.
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (990, 'testing'), (990, 'stable'), (500, 'unstable'), (500, 'stable'), (200, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.32.7-lis-00002-gd18ac29 (SMP w/2 CPU cores)
Locale: LANG=cs_CZ.UTF-8, LC_CTYPE=cs_CZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages libc6 depends on:
ii libc-bin 2.10.2-6 Embedded GNU C Library: Binaries
ii libgcc1 1:4.4.1-4 GCC support library
Versions of packages libc6 recommends:
ii libc6-i686 2.10.2-6 GNU C Library: Shared libraries [i
Versions of packages libc6 suggests:
ii debconf [debconf-2.0] 1.5.27 Debian configuration management sy
ii glibc-doc 2.10.2-6 Embedded GNU C Library: Documentat
ii locales 2.10.2-6 Embedded GNU C Library: National L
-- debconf information:
* glibc/upgrade: true
glibc/disable-screensaver:
glibc/restart-failed:
* glibc/restart-services:
--
Tomáš Janoušek, a.k.a. Liskni_si, http://work.lisk.in/
Reply to: