1 | If Coro causes segfaults a lot on calls to libc functions, the cause is |
1 | If Coro causes segfaults a lot on calls to libc functions, the cause is |
2 | probably a glibc compiled for i386 and kernel 2.2. |
2 | probably a glibc compiled for i386 and kernel 2.2 (for example, debian |
|
|
3 | only supplies 2.2 and 2.6-optimized libraries, not 2.4). |
3 | |
4 | |
4 | Glibc contains a bug that causes any program linked against pthreads AND |
5 | Glibc contains a bug that causes any program linked against pthreads AND |
5 | using coroutines (of any kind, not only Coro) or alternate stacks to |
6 | using coroutines (of any kind, not only Coro, but including most userspace |
|
|
7 | thread libraries like gnu-pth) or alternate stacks to segfault on calls to |
6 | segfault on calls to pthread functions. And glibc happens to do a lot of |
8 | pthread functions. And glibc happens to do a lot of these calls. |
7 | these calls. |
9 | |
|
|
10 | (Even if your perl is not compiled against pthreads, e.g. Time::HiRes links |
|
|
11 | against -lrt, which drags in pthreads. The same is true for other modules, |
|
|
12 | so watch out). |
8 | |
13 | |
9 | The bug is rather difficult to fix. This is not a problem, however, since |
14 | The bug is rather difficult to fix. This is not a problem, however, since |
10 | glibcs compiled for linux-2.4 use a much more efficient method to locate |
15 | glibcs compiled for linux-2.4 use a much more efficient method to locate |
11 | their data, which happens to work tiwh coroutines. |
16 | their data, which happens to work with coroutines. |
12 | |
17 | |
13 | So the easy fix is to install a libc which was compiled for linux-2.4, |
18 | So the easy fix is to install a libc which was compiled for linux-2.4 (or |
14 | using the --enable-kernel=2.4 configure option. WARNING: This kernel will |
19 | 2.6) using the "--enable-kernel=2.4 i586-pc-linux-gnu" configure options. |
|
|
20 | |
15 | no longer run on linux-2.2 or lower! |
21 | WARNING: This libc will no longer run on linux-2.2 or lower! |
|
|
22 | |
|
|
23 | UPDATE: Time::HiRes in current perl snapshots does no longer link against |
|
|
24 | -lrt. That still means you need to patch it until 5.9.x gets out. |