Ticket #219 (new defect)
napi error reporting not thread safe
| Reported by: | Tobias Richter | Owned by: | Unassigned |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | napi | Version: | 4.2.0 |
| Keywords: | Cc: |
Description
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.
Change History
comment:10 Changed 16 months ago by Tobias Richter
comment:11 Changed 16 months ago by Tobias Richter
comment:12 Changed 7 months ago by Tobias Richter
Note: See
TracTickets for help on using
tickets.

(In [1423]) refs #210 #219
work around threading issue in c api by getting environment dynamically simplify error reporting