[erlang-bugs] Segmentation fault with ETS bag implementation in 64-bit Erlang

Diego Llarrull diego.llarrull@REDACTED
Fri Feb 17 16:24:58 CET 2012


Hello everyone,

I'm currently developing a distributed store written entirely in Erlang, and we are having a somewhat awkward problem: the app runs fine in 32-bit Erlang VMs but ALWAYS crashes in 64-bit Erlang VMs.
We've tested 64-bit Erlang VMs running on Linux (XUbuntu 11.04/Fedora 15) 64-bit, OS X Lion 64-bit, and FreeBSD 8.2 64-bit with exactly the same result: a segmentation fault as soon as we try to
to use the store.

We managed to track down one bug, which was caused by inserting the same record twice, on a compressed, named ETS table with bag implementation. This causes, inexplicably, a segmentation fault which
is solved my changing the Ets table to a set.


To replicate the bug, the following code can be run:

	-module(segviola14).
	-compile(export_all).

	init() ->
	S = 	{
                {1316110174588445,1316110174588583},
                {1316110174588445,1316110174588590}
	},
	DB=ets:new(childName, [named_table, bag, compressed]),
	ets:insert(DB, S), io:format("guau!~n"),
	ets:insert(DB, S), io:format("guau!~n").

	
	The output for this code is:

>  segviola14:init().
guau!
Segmentation fault (core dumped)


In 32-bit Erlang VMs this code works just fine. We are, however, having segmentation faults throught our code that make us think the bug affects a core area of the VM-code. 32-bit Erlang showed
none of these problems, with everything running fine.

Any ideas?

Thank you all in advance.


Diego

  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20120217/802e63e0/attachment.htm>


More information about the erlang-bugs mailing list