Skip to content

Segmentation fault while import stl file pyassimp 4.1.4 #2343

Closed

Description

@lianghongzhuo

Hi, I did the following code to import stl file using pyassimp. Got the following error.

import pyassimp
pyassimp.load("STL FILE PATH")

version 4.1.4
result:

Segmentation fault (core dumped)

I fixed it by reinstall version 3.3: pip install pyassimp==3.3
Hope you can confirm this bug and fix it in the newest version.
All the above are tested in a python2.7 conda environment and Ubuntu 16.04
Best regards

Activity

  1. jsfrancal commented on Feb 20, 2019

    @jsfrancal

    I can confirm having seen this issue also with Python3 on several Ubuntu 18.04 machines.
    pip3 install pyassimp==4.1.3 also seems to circumvent the problem.

  2. lianghongzhuo commented on Feb 20, 2019

    @lianghongzhuo
    Author

    @jsfrancal pyassimp==4.1.3 also works for me at python2.7

  3. added
    Bug
    on Mar 13, 2019
  4. devnoname120 commented on Mar 18, 2019

    @devnoname120
    Contributor

    I can confirm that I have the same issue on both Linux and Windows Python 3.7 and that pyassimp==4.1.3 fixed it.

  5. fetorres commented on Mar 20, 2019

    @fetorres

    same here, rolling back to pyassimp==4.1.3 on python 3.6 and MacOS works for me.

  6. Cgettys commented on Mar 29, 2019

    @Cgettys
    Contributor

    Can we get an example file to reproduce the issue with?

  7. Cgettys commented on Mar 29, 2019

    @Cgettys
    Contributor

    The good:

    • The issue wasn't with Assimp itself, it only showed up in PyAssimp (at least for me)
    • I was able to reproduce it on several fbx files on PyAssimp 4.1.4 (ran the test suite, it crashed on the first one)
      The bad:
    • Still no clue where the error is. This appears consistently directly before the segfault:
    assimp/code/TriangulateProcess.cpp:162: bool Assimp::TriangulateProcess::TriangulateMesh(aiMesh*): Assertion `numOut != pMesh->mNumFaces' failed.
    
    • This implies something is different about what pyassimp passes in/ how it calls things (maybe it's a function arguments issue or something like that). I couldn't find anything that stood out to me though. And there are a number of C++ files in that time frame that involve FBX, both various feature requests and bug fixes. Perhaps someone with more experience with it could use the automated regression test suite to figure out where it snuck in (if that's still updated)

    The ugly:

    • CI didn't catch this. Are there python test (e.g. the regression tests) that we should be running on commit? And am I doing something stupid or do the regression tests really eat all of your ram?
    • The bindings were once upon a time at least to some degree automatically generated by a script. Said script may or may not support python 3. The script also fails horribly on the current source tree. Hence, for some amount of time, all updates to keep it in line with the ABI (and thus functioning) may have been manual?

    I have no clue, I've never done much work on wrapper development, but it might be worth trying to use a framework like cppyy to reduce the toil required to keep the port working. I'm not personally interested in becoming the maintainer for pyassimp though, sorry.

  8. ravener commented on Jul 22, 2019

    @ravener

    This also happens for me too, downgrading to pyassimp==4.1.3 fixed it, i've tried some debugging and the issue is coming from _init function that is called inside load

  9. IcyChlorine commented on Apr 20, 2021

    @IcyChlorine

    I can confirm that the issue exists on Windows, with python ver. 3.7.2 and assimap ver. 4.1.4.
    The problem seems to occur in _init, as I've figured out through some simple debugging.
    Importantly, the issue seems to occur randomly- it occurs around 1 in 3 or 4 times. Not sure if it has anything to do with random initialization for stack.

  10. added
    pyassimp
    on Apr 5, 2025
  11. added
    STL
    Regression
    on Apr 15, 2025
  12. tellypresence commented on Apr 15, 2025

    @tellypresence
    Collaborator

    @lianghongzhuo Is this still a problem?

  13. lianghongzhuo commented on Apr 15, 2025

    @lianghongzhuo
    Author

    @lianghongzhuo Is this still a problem?

    not a problem anymore :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugRegressionSTLpyassimp

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions