[NeXus-code-tickets] [NeXusCode] #219: napi error reporting not thread safe

NeXus Data Format Library and Applications noreply at nexusformat.org
Thu Feb 11 17:05:20 GMT 2010


#219: napi error reporting not thread safe
----------------------------+-----------------------------------------------
 Reporter:  Tobias Richter  |       Owner:  Unassigned
     Type:  defect          |      Status:  new       
 Priority:  major           |   Milestone:            
Component:  napi            |     Version:  4.2.0     
 Keywords:                  |  
----------------------------+-----------------------------------------------
 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.

-- 
Ticket URL: <http://trac.nexusformat.org/code/ticket/219>
NeXus Data Format Library and Applications <http://www.nexusformat.org/>
NeXus Data Format Library and Applications


More information about the NeXus-code-tickets mailing list