Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault after using workspace() #19

Closed
micahjsmith opened this issue May 19, 2016 · 6 comments
Closed

Segfault after using workspace() #19

micahjsmith opened this issue May 19, 2016 · 6 comments

Comments

@micahjsmith
Copy link

I get a segfault with the following commands in the REPL:

using Blosc
workspace()
using Blosc
exit()

The full error output can be seen here: https://gist.github.com/micahjsmith/60b4556d67c47665ba587b11afa1d6b7

See also:

julia> versioninfo()
Julia Version 0.4.5
Commit 2ac304d* (2016-03-18 00:58 UTC)
Platform Info:
  System: Linux (x86_64-redhat-linux)
  CPU: Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
@stevengj
Copy link
Member

Looking at the Blosc source code, it seems like it is not safe to call blosc_init twice, which is what will happen here (__init__ is called twice).

One thing we could do instead is to call blosc_set_nthreads(blosc_get_nthreads()), which from the source automatically calls blosc_init if it hasn't been initialized yet, and otherwise does nothing.

Another option might be to just not call blosc_init at all, since it looks from the source like blosc_init() is lazily called by any routine that needs it, but I'm wary of this because the Blosc documentation says you are supposed to call blosc_init. Even the set_nthreads trick seems iffy according to Blosc/c-blosc#150, but since g_initlib is a static (unexported) variable I don't see much choice.

@FrancescAlted
Copy link

Perhaps Blosc/c-blosc@5905212 would help?

@stevengj
Copy link
Member

stevengj commented Jun 7, 2016

@FrancescAlted, I think you also need a if (g_initlib) return; check in blosc_init itself to prevent blosc_init from doing anything if it is called twice.

@FrancescAlted
Copy link

Good point. Fixed in Blosc/c-blosc@4b271d1.

@stevengj
Copy link
Member

stevengj commented Jun 7, 2016

Great, thanks!

@stevengj
Copy link
Member

Should be fixed on the latest master by the bump to c-blosc 1.11.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants