Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Rare java crash - invalid access in Poller_run_1poll #24
On Linux x86, jdk1.6u20/22 using latest zmq and jzmq, the bug happens occassionally (sometimes 4 times in a row, sometimes once a day). Happened with older (j)zmq too.
Compiled jzmq without optimalizations, made disassembly and identified the line and place of code of the invalid access. See details attached to https://gist.github.com/769657 (interesting places in files marked).
It seems that in Poller.cpp line 101,
By the way, the the cycle at Poller.cpp:100 seems suspicious, since above in the file it is notet that the sockets array can be sparse, and at :72 this sparseness is checked, so while the cycle at :70 runs from
However, at the :100 cycle
Also, what happens if the check at :90 fails? Should it be an assertion?
See experimental patch at https://github.com/robinp/jzmq/commit/04c29009adfe6c66e856b27b6100eac6a9e3b242
(Haven't run long yet to be decisive, but at least it didn't break anything yet:)
This java file reproduces that the Poller_run_1poll last cycle not checking for sparsity produces unexpected behavior.
It can be seen when run unpatched, that