Crash after reload script (F8)

In development of Sverchok I faced with strange sort of crashes (ACCESS_VIOLATION). There are two conditions when it occurs.

  • The file should be saved on disk.
  • After that Blender should be rebooted with script.reload command.

Without this two condition everything works fine.

The triggers of crashes can be different. For example just switching tree property can cause it. Even if the property is doing absolutely nothing. Actually can’t understand how to debug such errors. I go to update function of the property see that it is doing nothing what next step should I do?

To debug such crashes, it’s best to compile a debug build of Blender yourself and start it with a debugger. This should provide more information about where the crash is actually happening.

You can also try to create a very small addon that triggers the crash, that would make it much easier for others to look into the issue.

I think for being able to do such frightening things I have to learn C++ first. C++ would be definitely nice to know but in this case it will take several (years?) to fix the bug. And creating little addon for reproducing the bug nearly equal to find cause of the bug.

I have a guess that it can be connected with pointers. I’m creating pointers to a tree and use them somewhere in code. After they was saved on disk and rebooted they probably does not restore their links correctly.

It looks like my suspicions confirmed.

I have replaced all pointers by strings in the code and did not manage to crash Blender anymore. It looks like using pointer properties is also not so safe as keeping direct references to Blender data.
It would be nice to find time for creating little addon for confirmation.