[erlang-bugs] Segmentation fault when running HIPE-compilled code

Mikael Pettersson <>
Fri Jan 16 18:43:45 CET 2009

Mikael Pettersson writes:
 > Sergey S writes:
 >  > Hello.
 >  > 
 >  > I reproduced this bug on two separate computers running the same software.
 >  > 
 >  > > Please give us some information about your system:
 >  > > 1. Which CPU type? Is it 32- or 64-bit?
 >  > 32-bit (i686)
 >  > 
 >  > > 2. Which C compiler and version?
 >  > GCC 4.3.2
 >  > 
 >  > > 3. Which OS / distribution / version?
 >  > Up-to-date Archinux i686.
 > Ok. I'll take a look at this issue tomorrow.

I've been able to reproduce the bug, and it's memory corruption
caused by an invalid optimisation performed by the compiler.
I've notified the rest of the HiPE team about the issue and
hopefully someone will know how to fix it (unfortunately it's
in a part of the compiler I'm not familiar with).

The combination of having a 'receive after infinity' after a
heap allocation (the fun expression) is what's triggering the
bug, so if you can put them in separate functions or move this
one function to a non-natively compiled module you should be
able to work around the bug for the time being.

More information about the erlang-bugs mailing list