[erlang-bugs] crash in re:compile

Michael Santos michael.santos@REDACTED
Tue May 12 03:01:51 CEST 2009


Compiling a regexp crashes the vm.

--cut
-module(xx).
-export([start/0,start/1]).

start() ->
    start(1000).
start(N) ->
    re:compile(lists:flatten([lists:duplicate(N, $(), lists:duplicate(N, $))])).
--cut

$ uname -a
Linux nul 2.6.24-24-generic #1 SMP Wed Apr 15 15:54:25 UTC 2009 i686 GNU/Linux

$ erl -s xx start
Erlang R13B (erts-5.7.1) [source] [rq:1] [async-threads:0] [hipe]
[kernel-poll:false]

*** stack smashing detected ***:
/media/opt/local/lib/erlang/erts-5.7.1/bin/beam terminated
=======
Backtrace:
=========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0xb7e90138]
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x0)[0xb7e900f0]
/media/opt/local/lib/erlang/erts-5.7.1/bin/beam(erts_pcre_compile2+0x5d7)[0x8182337]
/media/opt/local/lib/erlang/erts-5.7.1/bin/beam(re_compile_2+0x189)[0x811afd9]

$ uname -a
Darwin ack 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386

$ erl -s xx start
Erlang R13B (erts-5.7.1) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false] 
Bus error





More information about the erlang-bugs mailing list