[erlang-questions] beam crasher: ets + write_concurrency

Angel Alvarez <>
Thu Oct 8 21:15:51 CEST 2009


This crash is repeatable, reproducced on OpenSUSE 10.3 

this code crash the emulator on SMP mode..

-module(crash).
-export([crash/0]).

crash() ->
	T = ets:new(?MODULE, [{write_concurrency, true}]),
	ets:insert_new(T, {foo, 1}),
	ets:match(T, {nosuchvalue, '$1'}).


:~/Documents/Personal/Erlang/Code> erl
Erlang R13B01 (erts-5.7.2) [source] [rq:1] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.2  (abort with ^G)
1> crash:crash().
[]
2>

3> :~/Documents/Personal/Erlang/Code> erl -smp on
Erlang R13B01 (erts-5.7.2) [source] [smp:1:1] [rq:1] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.2  (abort with ^G)
1> crash:crash().
Violación de segmento
:~/Documents/Personal/Erlang/Code>

/Angel

El Jueves, 8 de Octubre de 2009 Dave Smith escribió:
> Greetings,
> 
> I believe that I have identified a VM crasher when using ETS with
> write concurrency enabled. Sample code is as follows:
> 
> T = ets:new(?MODULE, [{write_concurrency, true}]),
> ets:insert_new(T, {foo, 1}),
> ets:match(T, {nosuchvalue, '$1'}).
> 
> GDB stack trace shows:
> 
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000008
> [Switching to process 69425]
> 0x00000001000c894b in db_select_chunk_hash (p=0x101466398,
> tbl=0x1013b6eb0, pattern=4330115329, chunk_size=0, reverse=0,
> ret=0x102185080) at beam/erl_db_hash.c:1426
> 1426		if (current->hvalue != INVALID_HASH &&
> (gdb) bt
> #0  0x00000001000c894b in db_select_chunk_hash (p=0x101466398,
> tbl=0x1013b6eb0, pattern=4330115329, chunk_size=0, reverse=0,
> ret=0x102185080) at beam/erl_db_hash.c:1426
> #1  0x00000001000c85f2 in db_select_hash (p=0x101466398,
> tbl=0x1013b6eb0, pattern=4330115329, reverse=0, ret=0x102185080) at
> beam/erl_db_hash.c:1344
> #2  0x00000001000b1c6f in ets_select_2 (A__p=0x101466398, A_1=262367,
> A_2=4330115329) at beam/erl_db.c:2136
> #3  0x00000001000b1524 in ets_match_2 (A__p=0x101466398, A_1=262367,
> A_2=4335025986) at beam/erl_db.c:1940
> #4  0x000000010011e5ed in process_main () at beam/beam_emu.c:2084
> #5  0x000000010007ed86 in sched_thread_func (vesdp=0x1007812e8) at
> beam/erl_process.c:3015
> #6  0x00000001001a3360 in thr_wrapper (vtwd=0x7fff5fbff0e0) at
> common/ethread.c:475
> #7  0x00007fff819a2e19 in thread_start ()
> (gdb)
> 
> 
> This crash was repeatable on the following platforms:
> 
> OS X 10.6 (Snow Leopard), 64-bit and 32-bit VM
> OS X 10.5 (Leopard), 32-bit VM
> Debian Linux 2.6 x86_64, 64-bit VM
> 
> Erlang versions tested: R13B01, R13B02-1
> 
> Thanks,
> 
> D.
> 
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
> 
> 



-- 
No imprima este correo si no es necesario. El medio ambiente está en nuestras manos.
->>-----------------------------------------------
    Clist UAH a.k.a Angel
---------------------------------[www.uah.es]-<<--

...being the second biggest search engine in the world is good enough for us. Peter @ Pirate Bay.


More information about the erlang-questions mailing list