Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#276800: erlang segmentation faults

2 views
Skip to first unread message

Brian Campbell

unread,
Jan 23, 2005, 4:30:13 PM1/23/05
to
I've taken a look into these problems.

Short version: Disable HiPE (--disable-hipe) or use Linux 2.6 if you
need to get Erlang 10 working properly on x86 as a matter of urgency.
Note that erlang 9 has similar problems, but they don't seem to occur
during startup.

The problem stems from the use of an alternate signal stack (see
erts/emulator/hipe/hipe_x86_signal.c for details) interacting badly with
Linuxthreads. If you look at the straces, you'll see the SIGSEGV comes
immediately after SIGCHLD -- that's because it's the signal handler
wrapper in Linuxthreads that's dying. If you use Linux 2.6, glibc
appears to give you NPTL instead of Linuxthreads, and it works.

I think the only reason Erlang 9 works is that the SIGCHLD is received
before the alternate stack stuff is set up, but I'm not sure. You can
see the same effect if you start up erl and hit Ctrl-C though -- it
crashes rather than bringing up the break handler. If Erlang needs to
handle other signals then it may well crash then too.

It's probably worth asking the debian glibc folks about this problem
(it'll break other programs too, this isn't a bug in erlang itself). As
far as I can see, this would work if glibc is told it can assume at
least a 2.4 kernel when built (see the thread around
http://sources.redhat.com/ml/libc-alpha/2001-09/msg00035.html for
instance), but I can't really test it and don't know if it would cause
other difficulties which would prevent Debian using it.

Oh, and gentoo appear to have the same problem:

http://bugs.gentoo.org/show_bug.cgi?id=69041

Brian

--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Brian Campbell

unread,
Jan 24, 2005, 2:10:14 PM1/24/05
to
On Sun, Jan 23, 2005 at 09:13:11PM +0000, I wrote:
>
> The problem stems from the use of an alternate signal stack (see
> erts/emulator/hipe/hipe_x86_signal.c for details) interacting badly with
> Linuxthreads. If you look at the straces, you'll see the SIGSEGV comes
> immediately after SIGCHLD -- that's because it's the signal handler
> wrapper in Linuxthreads that's dying. If you use Linux 2.6, glibc
> appears to give you NPTL instead of Linuxthreads, and it works.

Nearly forgot: You can also see the problem under 2.6 if you force
glibc to use Linuxthreads by setting the environment variable
LD_ASSUME_KERNEL=2.4.1.

0 new messages