Pretty much any of the examples can fail when multiple sequential puts are performed (at least on Mac OS X).
For example, adding this fragment to the comparator
example and running the compiled code 3-5 times reproduces this issue:
And this is the response I get from running this code (as you can see it star failing after couple of runs):
$ leveldb-example-comparator
[("a","a"),("b","b"),("c","c"),("d","d"),("e","e"),("f","f"),("g","g"),("h","h"),("i","i"),("j","j"),("k","k"),("l","l"),("m","m "),("n","n"),("o","o"),("p","p"),("q","q"),("r","r"),("s","s"),("t","t"),("u","u"),("v","v"),("w","w"),("x","x"),("xxx",""),("y ","y"),("yyy",""),("z","z"),("zzz","")]
$ leveldb-example-comparator
[("a","a"),("b","b"),("c","c"),("d","d"),("e","e"),("f","f"),("g","g"),("h","h"),("i","i"),("j","j"),("k","k"),("l","l"),("m","m "),("n","n"),("o","o"),("p","p"),("q","q"),("r","r"),("s","s"),("t","t"),("u","u"),("v","v"),("w","w"),("x","x"),("xxx",""),("y ","y"),("yyy",""),("z","z"),("zzz","")]
$ leveldb-example-comparator
[("a","a"),("b","b"),("c","c"),("d","d"),("e","e"),("f","f"),("g","g"),("h","h"),("i","i"),("j","j"),("k","k"),("l","l"),("m","m "),("n","n"),("o","o"),("p","p"),("q","q"),("r","r"),("s","s"),("t","t"),("u","u"),("v","v"),("w","w"),("x","x"),("xxx",""),("y ","y"),("yyy",""),("z","z"),("zzz","")]
$ leveldb-example-comparator
[1] 63389 segmentation fault
$ leveldb-example-comparator
leveldb-example-comparator: schedule: re-entered unsafely.
Perhaps a 'foreign import unsafe' should be 'safe'?
[1] 63400 segmentation fault
$ leveldb-example-comparator
leveldb-example-comparator: schedule: re-entered unsafely.
Perhaps a 'foreign import unsafe' should be 'safe'?