You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NXIReportError and NXpData are held as global variables in napi.c. So changing the error reporting (NXMSetError) in one thread affects all threads.
We see occasional crashes of the JVM. The Java binding stores thread information in NXpData. If that is overwritten in another thread and an error occurs in the first thread the JNI code tries to throw an exception in the wrong thread. At least I think this is what is happening. Now that I have come up with that theory I can more easily test it.
But I am pretty sure the implementation is broken (for all bindings using napi.c).
Please correct me if I am wrong.
(In [1552]) Error reporting may have failed due to memory corruption or whatever
but was masked by threading problems. If we get a fresh class reference
every time we want to throw an error that helps. refs #219
Activity
stuartcampbell commentedon May 6, 2014
Original reporter: zjttoefs
(In [1423]) refs #210 #219
work around threading issue in c api by getting environment dynamically
simplify error reporting
stuartcampbell commentedon May 6, 2014
Original reporter: zjttoefs
(In [1542]) allow setting of error reporting in thread local storage so that
multiple threads can have their own error reporting
refs #219
stuartcampbell commentedon May 6, 2014
Original reporter: zjttoefs
(In [1543]) use threaded version of error handling setters in Java
refs #219
stuartcampbell commentedon May 6, 2014
Original reporter: zjttoefs
(In [1546]) use Disable and Enable ErrorReporting so that threaded versions are respected
refs #219
stuartcampbell commentedon May 6, 2014
Original reporter: zjttoefs
(In [1548]) create new error reporting function that only takes a message as parameter
and use that throughout the api
refs #219
stuartcampbell commentedon May 6, 2014
Original reporter: zjttoefs
(In [1552]) Error reporting may have failed due to memory corruption or whatever
but was masked by threading problems. If we get a fresh class reference
every time we want to throw an error that helps. refs #219
stuartcampbell commentedon May 6, 2014
Original reporter: zjttoefs
(In [1553]) check for thread local storage
MacOS X doesn't have it (this way)
refs #219
stuartcampbell commentedon May 6, 2014
Original reporter: zjttoefs
(In [1556]) remove DEBUG define left in there
refs #219
stuartcampbell commentedon May 6, 2014
Original reporter: zjttoefs
(In [1557]) fix backwards logic the issued the waring when everything was fine
refs #219
stuartcampbell commentedon May 6, 2014
Original reporter: zjttoefs
(In [1562]) for additional safety bring back the detection of jvm
refs #219
stuartcampbell commentedon May 6, 2014
Original reporter: zjttoefs
(In [1567]) changes to fix the threading problems in the error reporting
refs #219
stuartcampbell commentedon May 6, 2014
Original reporter: zjttoefs
(In [1598]) changes to fix the threading problems in the error reporting
refs #219