Segmentation fault: 11

EDIT : Sorry, I think I should have post this in the ‘Python Support’ forum!

Hi !

I’m writing a script that creates an HDRI lighting setup (https://github.com/Nikos-Prinios/HDRI-lighting-Shortcut).
It works but sometimes, I get a ‘Segmentation fault: 11’ when I load and reload several images.



# backtrace
0   blender                             0x0000000100c519ea BLI_system_backtrace + 58
1   blender                             0x000000010017c5cb blender_crash_handler_backtrace + 43
2   blender                             0x00000001001798d2 blender_crash_handler + 674
3   libsystem_platform.dylib            0x00007fffa0053eaa _sigtramp + 26
4   blender                             0x0000000100ba8705 pyrna_py_to_prop + 4165
5   blender                             0x0000000100ba81a3 pyrna_py_to_prop + 2787
6   blender                             0x000000010259bf1f PyObject_SetAttr + 79
7   blender                             0x00000001026117f4 PyEval_EvalFrameEx + 12596
8   blender                             0x0000000102619da0 fast_function + 304
9   blender                             0x00000001026148f6 PyEval_EvalFrameEx + 25142
10  blender                             0x0000000102619da0 fast_function + 304
11  blender                             0x00000001026148f6 PyEval_EvalFrameEx + 25142
12  blender                             0x0000000102619649 _PyEval_EvalCodeWithName + 3945
13  blender                             0x000000010260e69e PyEval_EvalCodeEx + 78
14  blender                             0x000000010257994d function_call + 381
15  blender                             0x00000001025509b1 PyObject_Call + 97
16  blender                             0x0000000100bb050d bpy_class_call + 1117
17  blender                             0x00000001007a9465 operator_execute + 117
18  blender                             0x00000001001830b5 wm_handler_fileselect_do + 277
19  blender                             0x0000000100186569 wm_handlers_do_intern + 1513
20  blender                             0x0000000100182bcc wm_handlers_do + 28
21  blender                             0x000000010018238b wm_event_do_handlers + 1723
22  blender                             0x000000010017cfd0 WM_main + 32
23  blender                             0x000000010017886a main + 1530
24  blender                             0x0000000100001534 start + 52

At first I thought I was referencing something that was not there anymore but the script works most of the time and the last function that is called works until the end. The crash comes after.

Also, I don’t think it happens because of memory limits because I run some test with tiny images.

Any thought ? I’m must be doing something wrong…

Alright, I found that I was misusing ‘self’ within a function. Problem solved.