{"action":"closed","issue":{"url":"https://api.github.com/repos/Unidata/thredds/issues/577","repository_url":"https://api.github.com/repos/Unidata/thredds","labels_url":"https://api.github.com/repos/Unidata/thredds/issues/577/labels{/name}","comments_url":"https://api.github.com/repos/Unidata/thredds/issues/577/comments","events_url":"https://api.github.com/repos/Unidata/thredds/issues/577/events","html_url":"https://github.com/Unidata/thredds/issues/577","id":162686809,"number":577,"title":"Seg fault when using multi threading Netcdf-Java","user":{"login":"LupusUmbrae","id":914585,"avatar_url":"https://avatars.githubusercontent.com/u/914585?v=3","gravatar_id":"","url":"https://api.github.com/users/LupusUmbrae","html_url":"https://github.com/LupusUmbrae","followers_url":"https://api.github.com/users/LupusUmbrae/followers","following_url":"https://api.github.com/users/LupusUmbrae/following{/other_user}","gists_url":"https://api.github.com/users/LupusUmbrae/gists{/gist_id}","starred_url":"https://api.github.com/users/LupusUmbrae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LupusUmbrae/subscriptions","organizations_url":"https://api.github.com/users/LupusUmbrae/orgs","repos_url":"https://api.github.com/users/LupusUmbrae/repos","events_url":"https://api.github.com/users/LupusUmbrae/events{/privacy}","received_events_url":"https://api.github.com/users/LupusUmbrae/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Unidata/thredds/labels/Area:%20NetCDF-4","name":"Area: NetCDF-4","color":"c5def5"},{"url":"https://api.github.com/repos/Unidata/thredds/labels/Type:%20General%20Question","name":"Type: General Question","color":"e99695"}],"state":"closed","locked":false,"assignee":{"login":"lesserwhirls","id":67096,"avatar_url":"https://avatars.githubusercontent.com/u/67096?v=3","gravatar_id":"","url":"https://api.github.com/users/lesserwhirls","html_url":"https://github.com/lesserwhirls","followers_url":"https://api.github.com/users/lesserwhirls/followers","following_url":"https://api.github.com/users/lesserwhirls/following{/other_user}","gists_url":"https://api.github.com/users/lesserwhirls/gists{/gist_id}","starred_url":"https://api.github.com/users/lesserwhirls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lesserwhirls/subscriptions","organizations_url":"https://api.github.com/users/lesserwhirls/orgs","repos_url":"https://api.github.com/users/lesserwhirls/repos","events_url":"https://api.github.com/users/lesserwhirls/events{/privacy}","received_events_url":"https://api.github.com/users/lesserwhirls/received_events","type":"User","site_admin":false},"assignees":[{"login":"lesserwhirls","id":67096,"avatar_url":"https://avatars.githubusercontent.com/u/67096?v=3","gravatar_id":"","url":"https://api.github.com/users/lesserwhirls","html_url":"https://github.com/lesserwhirls","followers_url":"https://api.github.com/users/lesserwhirls/followers","following_url":"https://api.github.com/users/lesserwhirls/following{/other_user}","gists_url":"https://api.github.com/users/lesserwhirls/gists{/gist_id}","starred_url":"https://api.github.com/users/lesserwhirls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lesserwhirls/subscriptions","organizations_url":"https://api.github.com/users/lesserwhirls/orgs","repos_url":"https://api.github.com/users/lesserwhirls/repos","events_url":"https://api.github.com/users/lesserwhirls/events{/privacy}","received_events_url":"https://api.github.com/users/lesserwhirls/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2016-06-28T13:33:00Z","updated_at":"2016-07-08T18:27:30Z","closed_at":"2016-07-08T18:27:30Z","body":"Hello,\r\n\r\nI was experimenting with trying to improve the write performance with the NetCDF-Java library (v4.6.5 & v4.6.6) by putting each file i write to in a new thread. This however did not end well.\r\n\r\nI've attached a simple piece of code that can be used to replicate the error, just simple change the number of threads to 1 to see it work without crashing.\r\n\r\n[NetcdfThreads.txt](https://github.com/Unidata/thredds/files/337091/NetcdfThreads.txt)\r\n[hs_err_pid2499.txt](https://github.com/Unidata/thredds/files/337118/hs_err_pid2499.txt)\r\n\r\nI had to compile the NetCDF library locally to get v4.4.0 so it's always possible I'm missing a flag needed at compile time, but couldn't see anything obvious in the compile docs.\r\n\r\n```\r\nNetCDF-4 C library loaded (jna_path='null', libname='netcdf').\r\nNetCDF-4 C library loaded (jna_path='null', libname='netcdf').\r\nNetCDF-4 C library loaded (jna_path='null', libname='netcdf').\r\nNetCDF-4 C library loaded (jna_path='null', libname='netcdf').\r\nNetcdf nc_inq_libvers='4.4.0 of Jun  2 2016 16:34:09 $' isProtected=false\r\nNetcdf nc_inq_libvers='4.4.0 of Jun  2 2016 16:34:09 $' isProtected=false\r\nNetcdf nc_inq_libvers='4.4.0 of Jun  2 2016 16:34:09 $' isProtected=false\r\nNetcdf nc_inq_libvers='4.4.0 of Jun  2 2016 16:34:09 $' isProtected=false\r\n#\r\n# A fatal error has been detected by the Java Runtime Environment:\r\n#\r\n#  SIGSEGV (0xb) at pc=0x00007fa583af967e, pid=16235, tid=140349870167808\r\n#\r\n# JRE version: OpenJDK Runtime Environment (8.0_91-b14) (build 1.8.0_91-8u91-b14-0ubuntu4~16.04.1-b14)\r\n# Java VM: OpenJDK 64-Bit Server VM (25.91-b14 mixed mode linux-amd64 compressed oops)\r\n# Problematic frame:\r\n# C  [libnetcdf.so+0x3a67e]  NC_create+0x12e\r\n#\r\n# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try \"ulimit -c unlimited\" before starting Java again\r\n#\r\n# An error report file with more information is saved as:\r\n# /home/robin/workspace/netcdf-threads/hs_err_pid16235.log\r\n#\r\n# If you would like to submit a bug report, please visit:\r\n#   http://bugreport.java.com/bugreport/crash.jsp\r\n# The crash happened outside the Java Virtual Machine in native code.\r\n# See problematic frame for where to report the bug.\r\n#\r\n```\r\n\r\n\r\n**nc-config --all**\r\n```\r\nThis netCDF 4.4.0 has been built with the following features: \r\n\r\n  --cc        -> gcc\r\n  --cflags    ->  -I/usr/local/include -I/usr/local/include\r\n  --libs      -> \r\n\r\n  --has-c++   -> no\r\n  --cxx       -> \r\n  --has-c++4  -> no\r\n  --cxx4      -> \r\n\r\n  --fc        -> \r\n  --fflags    -> \r\n  --flibs     -> \r\n  --has-f90   -> no\r\n\r\n  --has-dap   -> no\r\n  --has-nc2   -> yes\r\n  --has-nc4   -> yes\r\n  --has-hdf5  -> yes\r\n  --has-hdf4  -> no\r\n  --has-pnetcdf-> no\r\n\r\n  --prefix    -> /usr/local\r\n  --includedir-> /usr/local/include\r\n  --version   -> netCDF 4.4.0\r\n```\r\n\r\n\r\n"}}
{"actor":{"display_login":"lesserwhirls"}}