[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #BSC-631634]: Multi threading support in NetCDF4 C lib



Hello,

netCDF is not thread safe; two different threads cannot write to two separate 
files, as there is global file information which would be overwritten when the 
second file was opened.

I'm sorry I can't provide a positive response, but hopefully this information 
is useful,

-Ward

> Hello,
> 
> I have compiled the netcdf dll files by downloading netcdf-c-4.4.1-rc2.7z and 
> other required tools like CMake, curl, HDF5, etc...
> 
> I see that the system crash when two threads try to access the different 
> netcdf files.
> Is the netcdf lib thread safe?
> Can two different thread write to two separate files?
> 
> However if I just continue to write from one thread it works just fine!!
> 
> ================  following is the stack of core dump 
> =============================
> 
> ExceptionCode:    c0000005
> ExceptionAddress: 025e5e8d
> ExceptionFlags:   00000000
> ExceptionInfo[0]: 00000000
> ExceptionInfo[1]: 0000000c
> 
> Snapshot for thread 6716.
> 
> EAX:    00000000
> EBX:    0854a118
> ECX:    00000000
> EDX:    00000001
> EDI:    00000003
> ESI:    08cd7b00
> EIP:    025e5e8d
> ESP:    001bbfb8
> EBP:    001bbfdc
> EFLAGS: 00010203
> 
> 01:EIP/ESP/EBP: 025e5e8d/001bbfb8/001bbfdc
> --:Symbol:      NCD2_open+414541
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+745101
> 02:EIP/ESP/EBP: 025e7ab7/001bbfe4/001bbff4
> --:Symbol:      NCD2_open+421751
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+752311
> 03:EIP/ESP/EBP: 0267faf0/001bbffc/001bc028
> --:Symbol:      NCD2_open+1044400
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+1374960
> 04:EIP/ESP/EBP: 025bf000/001bc030/001bc060
> --:Symbol:      NCD2_open+255168
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+585728
> 05:EIP/ESP/EBP: 0268ba2f/001bc068/001bc0e4
> --:Symbol:      NCD2_open+1093359
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+1423919
> 06:EIP/ESP/EBP: 0268bcb2/001bc0ec/001bcd8c
> --:Symbol:      NCD2_open+1094002
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+1424562
> 07:EIP/ESP/EBP: 026ae059/001bcd94/001bcdb0
> --:Symbol:      NCD2_open+1234201
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+1564761
> 08:EIP/ESP/EBP: 02655ef5/001bcdb8/001bce6c
> --:Symbol:      NCD2_open+873397
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+1203957
> 09:EIP/ESP/EBP: 025d2fce/001bce74/001bce8c
> --:Symbol:      NCD2_open+337038
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+667598
> 10:EIP/ESP/EBP: 025d308c/001bce94/001bcea0
> --:Symbol:      NCD2_open+337228
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+667788
> 11:EIP/ESP/EBP: 0258a475/001bcea8/001bceb8
> --:Symbol:      NCD2_open+39221
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+369781
> 12:EIP/ESP/EBP: 025ef3e5/001bcec0/001bced8
> --:Symbol:      NCD2_open+452773
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+783333
> 13:EIP/ESP/EBP: 0258a518/001bcee0/001bcefc
> --:Symbol:      NCD2_open+39384
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+369944
> 14:EIP/ESP/EBP: 025d46e0/001bcf04/001bcf20
> --:Symbol:      NCD2_open+342944
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+673504
> 15:EIP/ESP/EBP: 025d9d0a/001bcf28/001bcf44
> --:Symbol:      NCD2_open+365002
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+695562
> 16:EIP/ESP/EBP: 025db9d3/001bcf4c/001bcf64
> --:Symbol:      NCD2_open+372371
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+702931
> 17:EIP/ESP/EBP: 025dbadb/001bcf6c/001bcf78
> --:Symbol:      NCD2_open+372635
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+703195
> 18:EIP/ESP/EBP: 025899f4/001bcf80/001bcf94
> --:Symbol:      NCD2_open+36532
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+367092
> 19:EIP/ESP/EBP: 02560e94/001bcf9c/001bcfa8
> --:Symbol:      NC4_redef+212
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+200340
> 20:EIP/ESP/EBP: 02561718/001bcfb0/001bcfbc
> --:Symbol:      NC4_sync+88
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+202520
> 21:EIP/ESP/EBP: 02532565/001bcfc4/001bcfd0
> --:Symbol:      nc_sync+37
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\libnetcdf\dll\netcdf.dll+9573
> 22:EIP/ESP/EBP: 01343c4c/001bcfd8/001bcfdc
> --:Symbol:      NetCDFAPI::ncSync+12
> --:Line:        
> c:\vaisala\blviewsrc\library\netcdfinterfacelib\netcdfapi.cpp:108+9
> --:Module:      
> C:\Vaisala\BLViewSrc\arch\i686-win32-vc100\build\Debug\netcdf_srv.exe+277580
> 
> 
> 
> Thanks
> Suresh Panara
> 
> 


Ticket Details
===================
Ticket ID: BSC-631634
Department: Support netCDF
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.