zbenjamin / vec_noise

Vectorized perlin noise library for Python
Other
4 stars 2 forks source link

Segfault in Python 3 / Linux in py_noise_common() #3

Closed craftyjon closed 7 years ago

craftyjon commented 7 years ago

Ubuntu 17.04, Python 3.5.3, numpy 1.13.1, vec-noise 1.1.3 I get this crash in Firemix right away (i.e. when first noise preset draws) This might also happen on Mac OS but not right away (I have been seeing random segfaults after running for a while but haven't investigated yet)

Thread 19 "FireMixApp" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffa66c6700 (LWP 27127)]
py_noise_common (args=0x7fffa66c4800) at _simplex.c:524
524 _simplex.c: No such file or directory.
(gdb) bt
#0  0x00007fffbd5a75f5 in py_noise_common (args=0x7fffa66c4800)
    at _simplex.c:524
#1  0x00007fffbd5a75f5 in py_noise3 (self=<optimized out>, args=<optimized out>, kwargs=<optimized out>) at _simplex.c:665
(...)
(gdb) info locals
all_scalars = 0
ret = 0x0
i = 3
float_type = 0x0
(gdb) frame 1
#1  py_noise3 (self=<optimized out>, args=<optimized out>, 
    kwargs=<optimized out>) at _simplex.c:665
665 in _simplex.c
(gdb) info locals
dim_vals = {0x7fffbc249a30, 0x7fffbc2c9990, 0x7fffbc2b79d8}
op = {0x0, 0x0, 0x0, 0x0}
op_flags = {3178943040, 32767, 3157921234, 32767}
op_dtypes = {0x7fffbc2cd480, 0x9dc991257725c000, 
  0x7fffee211fa0 <array_multiply>, 0x7fffbc2bd320}
nargs = {ndims = 3, nops = 4, dim_vals = 0x7fffa66c4860, op = 0x7fffa66c4880, 
  op_flags = 0x7fffa66c4850, op_dtypes = 0x7fffa66c48a0, 
  scalar_func = 0x7fffbd5a8640 <noise3_scalar>, 
  dispatch_func = 0x7fffbd5a8610 <dispatch_noise3_args>, octaves = 1, 
  persistence = 0.5, lacunarity = 2, repeatx = 0, repeaty = 0, z = 0}
kwlist = {0x7fffbd5aad8d "x", 0x7fffbd5aad7b "y", 0x7fffbd5aad82 "z", 
  0x7fffbd5aad4e "octaves", 0x7fffbd5aad56 "persistence", 
  0x7fffbd5aad62 "lacunarity", 0x0}
craftyjon commented 7 years ago

@zbenjamin let me know if you can't reproduce and I can do a debug build and give a better trace.

zbenjamin commented 7 years ago

Just released version 1.1.4 that fixes this crash. The other segfaults you're seeing must be a different bug because this was just a failure to initialize on the Python 3 code path.