jesterKing / import_3dm

Blender importer script for Rhinoceros 3D files
MIT License
305 stars 38 forks source link

Segmentation fault on Linux / Blender 3.0 #94

Closed tittel closed 2 years ago

tittel commented 2 years ago

Describe the bug Blender 3.0 crashes when trying to import a 3dm model. Blender 2.93 is working fine. Backtrace is:

# Blender 3.0.0, Commit date: 2021-12-02 18:35, Hash f1cca3055776

# backtrace
./blender(BLI_system_backtrace+0x20) [0xb0b3460]
./blender() [0x10babdb]
/lib/x86_64-linux-gnu/libc.so.6(+0x46520) [0x7f58a148f520]
./blender(inflate_fast+0xea) [0xb0c991a]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(z_inflate+0x1589) [0x7f5872383f17]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x8431fa) [0x7f58723791fa]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x842b75) [0x7f5872378b75]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x438f76) [0x7f5871f6ef76]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x3a654d) [0x7f5871edc54d]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x3da3aa) [0x7f5871f103aa]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x50f10d) [0x7f587204510d]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x510e30) [0x7f5872046e30]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x510fbb) [0x7f5872046fbb]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x50f014) [0x7f5872045014]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x1f349f) [0x7f5871d2949f]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x238c55) [0x7f5871d6ec55]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x22b861) [0x7f5871d61861]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x22013b) [0x7f5871d5613b]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0x220239) [0x7f5871d56239]
/home/xyz/.config/blender/3.0/scripts/addons/modules/rhino3dm/_rhino3dm.cpython-39-x86_64-linux-gnu.so(+0xdebd7) [0x7f5871c14bd7]
./blender() [0x9c717c3]
./blender(_PyObject_MakeTpCall+0x90) [0x9c334c0]
./blender(_PyEval_EvalFrameDefault+0x8f40) [0x10b7130]
./blender() [0x10ad28b]
./blender(_PyEval_EvalFrameDefault+0x59cc) [0x10b3bbc]
./blender() [0x10ad28b]
./blender(PyVectorcall_Call+0x5f) [0x9c32f1f]
./blender() [0x1c08d88]
./blender() [0x1bd5325]
./blender() [0x14c1469]
./blender() [0x14c426c]
./blender() [0x14c4ecd]
./blender(wm_event_do_handlers+0x42e) [0x14c563e]
./blender(WM_main+0x20) [0x14bb120]
./blender(main+0x31e) [0xfa3bbe]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dfd0) [0x7f58a1476fd0]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x7d) [0x7f58a147707d]
./blender() [0x10b753c]

# Python backtrace
  File "/home/xyz/.config/blender/3.0/scripts/addons/import_3dm/read3dm.py", line 136 in read_3dm
  File "/home/xyz/.config/blender/3.0/scripts/addons/import_3dm/__init__.py", line 137 in execute

To Reproduce Steps to reproduce the behavior:

  1. Install Blender 3.0
  2. In Terminal run: /3.0/python/bin/python3.9 -m ensurepip
  3. In Blender: Click Edit->Preferences->Add-ons and install import_3dm add-on
  4. In Blender: try to import any 3dm model -> Blender crashes

Desktop (please complete the following information):

jesterKing commented 2 years ago

I don't have currently access to a Linux machine, so I'll need some help here from a dev who has.

tittel commented 2 years ago

A little more background: the crash happens in the call to r3d.File3dm.Read()

I already followed the instructions for building rhino3dm from source but blender still crashes. I suspect the bug is in rhino3dm but I wonder why its working in blender 2.93 and not in 3.0.

jesterKing commented 2 years ago

I have tested import_3dm in Blender 3.0, there it works just fine. If the problem is in File3dm.Read() then the bug probably should be reported there. Best is if you can reproduce the crash with just importing rhino3dm in cpython on the console and then trying to load a file using the Read method. If that crashes then best report in the rhino3dm github project.

tittel commented 2 years ago

Thanks for looking into this and sorry for wasting your time.

Further investigation showed that any version of blender from https://download.blender.org/release/ crashes. Only the version shipped via Ubuntu repos work fine. Self-compiling blender with the recommended method (i.e. checking out precompiled dependencies) does not help fixing the crash. I will now try to compile blenders dependencies myself.