szcompressor / SZ

Error-bounded Lossy Data Compressor (for floating-point/integer datasets)
http://szcompressor.org
Other
151 stars 56 forks source link

Fix SZ threadsafe #77

Closed robertu94 closed 2 years ago

robertu94 commented 2 years ago

Calling SZ_Init in SZ_compress_customize_threadsafe can cause different threads to race when attempting to set confparams_cpr->maxRangeRadius and other parameters on this structure. Since SZ_Init zero initalizes the structure before filling it with the default value, there is a brief window where another executing SZ compression thread reads the 0 and segfaults or throws a SIGFPE. This change requires SZ_threadsafe users to call SZ Init before using this interface.