• RuntimesBugs
  • spine runtime crushes in release build

3.8 is very old and we no longer make bug fixes to it. Please try with the latest 4.1.

Related Discussions
...

We are trying to find problem , but after each changing code problem is disappeared.
4.1 has no crash , but PathConstraint file has alot of changes in 4.1 and problem may still present but not appears.
Maybe its known problem and already fixed in 4.1

PS: We can`t use 4.1 as a main version because runtimes is not backward compatible.

To use the 4.1 runtimes you would need to export using the 4.1 editor. This may be a lot of work, but has many advantages if you can do it.

Have you tried to debug it to determine where in PathConstraint the problem is? There are many places in PathConstraint that index a Vector. If we can identify where it happens, maybe looking at the 4.1 code will help to find a fix.

  • rgsv respondió a esto
    • Editado

    Nate

    We have a strange behavior, but nothing strange for release build .
    ` Vector<float>& PathConstraint::computeWorldPositions(PathAttachment &path, int spacesCount, bool tangents, bool percentPosition, bool percentSpacing) {

    Slot &target = *_target;
    float position = _position;
    _positions.setSize(spacesCount * 3 + 2, 0);
    Vector<float> &out = _positions;
    Vector<float> &world = _world;
    bool closed = path.isClosed();
    int verticesLength = path.getWorldVerticesLength();
    int curveCount = verticesLength / 6;
    int prevCurve = NONE;
    
    float pathLength;
    if (!path.isConstantSpeed()) {
    	Vector<float> &lengths = path.getLengths();
    	curveCount -= closed ? 1 : 2;
    	pathLength = lengths[curveCount];
    	if (percentPosition) position *= pathLength;
    
    	if (percentSpacing) {
    		for (int i = 1; i < spacesCount; ++i)
    			_spaces[i] *= pathLength; /// assert is here 
    	}

    But percentSpacing parameter is false , and this block should not be executed. We are put console output in begin of function and see that _spaces size is correct and spacesCount less than _spaces size value is 7.
    If we add additional outputs assert may disappear or move to another vector operator []

    PS: we can`t change assets of done projets so we cant use 4.1

    • Nate respondió a esto

      rgsv we can`t change assets of done projets so we cant use 4.1

      OK, I just wanted to be sure. 🙂

      If the assert really fails there, percentSpacing must be true!

      This code is quite tricky, as there are many variables that change the sizes. You may be able to apply a hack without needing to fully understand all of the many code paths. For example, maybe size _spaces to be larger than necessary:

      _spaces.setSize(spacesCount + 1, 0); // + 1 was added

      That is probably not technically correct, but it may stop the crash. You'll need to check if the path constraint is applied properly in your application when it otherwise would have crashed.

      Your code is inside if (!path.isConstantSpeed()) {. You could try enabling constant speed for the path. That will use different code to apply the path constraint and may avoid the crash. It is the default and I think most people use constant speed, so that code path may have fewer bugs.

      rgsv We are put console output in begin of function and see that _spaces size is correct and spacesCount less than _spaces size value

      If these things are true, it should not be possible to crash. Maybe there is a buffer overrun somewhere. Are you using multiple threads? If two threads try to call PathConstraint computeWorldPositions at the same time, it could cause a problem like you see.

      The percentSpacing is realy false . And we have constant speed too .
      So if must fails twice in this case, but debugger put stop on this point.
      It should be O2 optimization mystic. Everthing fine in 64bits in debug and in release (O2), but it crashes in release with -m32 option.
      Its single thread test app.
      PS: I can pass test projet to you. it needs only install freeglut3:i386 , gcc-multilib ang g++-multilib . We try gcc-7 gcc-9 gcc-11 gcc-12 and gcc-13

      I see, that's really nutty. You can send the test project here: contact@esotericsoftware.com
      I'm not sure if we'll be able to find something, but we'll take a look.

      • rgsv respondió a esto

        Nate Bad news. We exported this animation to 4.1 and we have the same behavior.
        i will send both test projects.

        • A Nate le gusta esto.

        Please also let me know what Linux distribution and version you are using. This smells more and more like a compiler or stdlib bug we are hitting.

        I use ubuntu 22.04 LTS now And also i reproduce in Debian 12 on virtual machine.
        clang-14 has same behavior .

        You are using bit old version..
        Please Try to use update version which is version 4.1

        • rgsv respondió a esto

          nora 4.1 has the same behavior , i sent test app with 4.1 runtime too.