letmaik / rawpy

📷 RAW image processing for Python, a wrapper for libraw
https://pypi.python.org/pypi/rawpy
MIT License
587 stars 67 forks source link

SIGSEGV when debugging in PyCharm #164

Open TheTomer opened 2 years ago

TheTomer commented 2 years ago

Hi, I'm trying to debug my code, which uses the following line:

with rawpy.imread(img_arw_path) as img_raw:

Whenever I set a break point after the scope of the 'with', PyCharm throws the following error: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) Has this happened to anyone here? How do I resolve it?

letmaik commented 2 years ago

The only way rawpy can crash is when raw.raw_image is accessed after the file is closed, which is documented. I'm guessing that you have some code like im = raw.raw_image inside the with and then Python being Python, this variable still exists after the with block. The debugger in PyCharm probably tries to visualize everything and accesses this variable. A work-around would be to del im at the end inside the with block. Then the variable is gone for good.