Heisenbug in v2.0.3

  • From: Pierre-Yves Gérardy <pygy79@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 1 Apr 2015 01:00:11 +0200

Hello Mike, hello list,

I encounter a problem with LuaJIT v2.0.3 that disappears when I try to debug it.

To test LuLPeg, I use a modified version of the LPeg test suite, with
`assert` modified to gather stats rather than crashing on error.

The following line† errors out three times (out of 550) when run as follows:

git clone https://github.com/pygy/LuLPeg.git
cd LuLPeg
git checkout 9855c3d85e9  # the master HEAD as of this post

luajit tests/lpeg.0.12.test.lua lulpeg abcdefgh

But this works fine:

luajit tests/lpeg.0.12.test.lua lulpeg abcdefg

Note that the last parameter (abcdefg(h)) is not used by the program.

(When I say that it works fine, I mean that it errors out 70 times out
of 6000+, as expected for now).

I've tried to narrow down the issue, but slight modifications make the
bug go away. It doesn't happen with -joff.

I'm using MacOS 10.8.5, and that LuaJIT version was installed through
Homebrew. These optimisations are enabled: JIT: ON CMOV SSE2 SSE3
SSE4.1 fold cse dce fwd dse narrow loop abc sink fuse

LuLPeg compiles patterns to Lua code using a parser combinator
approach, which are a pain to debug :-). Hopefully you can guide me in
providing you more useful information.

—Pierre-Yves

† https://github.com/pygy/LuLPeg/blob/master/tests/lpeg.0.12.test.lua#L240

Other related posts: