[erlang-questions] Erlang VM segfault?

Paul Davis <>
Mon Feb 23 22:26:21 CET 2009


Quick follow up,

This has been tested on Erlang versions 5.6.[2-5] with CouchDB trunk
on multiple machines. If anyone wants to duplicate and has a CouchDB
install, the steps are pretty simple:

$ cd /path/to/couchdb
$ make dev
$ cd tmp/lib
$ wget http://www.davispj.com/rev_errors.couch
$ cd ../..
$ ./utils/run

In a different terminal
$ curl -X DELETE 'http://127.0.0.1:5984/rev_errors/1?rev=4270118160'

Other than that, I think I'll take a look at trying to minimize the
test case later.

Thanks,
Paul Davis

On Mon, Feb 23, 2009 at 3:44 PM, Paul Davis <> wrote:
> As weird as it sounds, I've come across a repeatable segfault in
> erlang. I haven't minimized it to a simple test case yet, but I
> figured I'd describe it and give some GDB output in case it triggers
> an idea from anyone.
>
> The context of the segfault is when working in CouchDB with documents
> that have a 29,107 element revision history. I'm only specific on the
> 29,107 because I duplicated in two databases with two different docs
> and both of them are exactly 29,107. No idea if that's important.
>
> My first thought was to watch the segfault with GDB to see if that
> illuminated anything. It didn't really. I've pasted the first 10
> frames for reference. I figured I might as well scroll down to the
> 58,214th frame, but at about 58,203 gdb segfaulted.
>
> With some help from a couple of the guys in # I
> tried bumping the atom table sizes to see if that was the issue. After
> changing both the ATOM_SIZE and ATOM_LIMIT define's to 1GiB I'm still
> getting segfaults.
>
> Next on the list is to try R12B-5.
>
> Anyone have any thoughts?
>
> Thanks,
> Paul Davis
>
> #0  0x000000000049d822 in enc_atom (dep=<value optimized out>,
> atom=<value optimized out>,
>    ep=<value optimized out>) at beam/external.c:405
> #1  0x000000000049e41c in enc_term (dep=0x0, obj=75, ep=<value
> optimized out>, dflags=1924) at beam/external.c:561
> #2  0x000000000049e2f7 in enc_term (dep=0x0, obj=139755318628650,
> ep=0x4 <Address 0x4 out of bounds>, dflags=1924)
>    at beam/external.c:678
> #3  0x000000000049e2f7 in enc_term (dep=0x0, obj=139755318628674,
> ep=0x4 <Address 0x4 out of bounds>, dflags=1924)
>    at beam/external.c:678
> #4  0x000000000049e7fc in enc_term (dep=0x0, obj=139755318628705,
> ep=0x4 <Address 0x4 out of bounds>, dflags=1924)
>    at beam/external.c:654
> #5  0x000000000049e2f7 in enc_term (dep=0x0, obj=139755318628722,
> ep=0x4 <Address 0x4 out of bounds>, dflags=1924)
>    at beam/external.c:678
> #6  0x000000000049e7fc in enc_term (dep=0x0, obj=139755318628753,
> ep=0x4 <Address 0x4 out of bounds>, dflags=1924)
>    at beam/external.c:654
> #7  0x000000000049e2f7 in enc_term (dep=0x0, obj=139755318628770,
> ep=0x4 <Address 0x4 out of bounds>, dflags=1924)
>    at beam/external.c:678
> #8  0x000000000049e7fc in enc_term (dep=0x0, obj=139755318628801,
> ep=0x4 <Address 0x4 out of bounds>, dflags=1924)
>    at beam/external.c:654
> #9  0x000000000049e2f7 in enc_term (dep=0x0, obj=139755318628818,
> ep=0x4 <Address 0x4 out of bounds>, dflags=1924)
>    at beam/external.c:678
> #10 0x000000000049e7fc in enc_term (dep=0x0, obj=139755318628849,
> ep=0x4 <Address 0x4 out of bounds>, dflags=1924)
>    at beam/external.c:654
>



More information about the erlang-questions mailing list