sigrokproject / pulseview

Read-only mirror of the official repo at git://sigrok.org/pulseview. Pull requests welcome. Please file bugreports at sigrok.org/bugzilla.
http://sigrok.org/wiki/PulseView
GNU General Public License v3.0
487 stars 157 forks source link

PulseView crashing when opening invalid sr file #67

Closed timyig closed 8 months ago

timyig commented 8 months ago

hs-ul-with-ofh.zip

Had to rename the file to be able upload to GH.

I can not reproduce this reliably, when I get this error message, I can close on retry to open PV without problem:


~/Applications/pulseview-NIGHTLY-x86_64-debug_75105373b6965954344a42ee104aad0d.appimage -c tests/resources/bticino/rts/extracted/call.sr
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
srd: ModuleNotFoundError: Failed to load decoder ir_irmp: import by name failed: No module named '_ctypes'
srd: Traceback (most recent call last):
  File "/tmp/.mount_pulsevSfCTzq/usr/share/libsigrokdecode/decoders/ir_irmp/__init__.py", line 25, in <module>
    from .pd import Decoder
  File "/tmp/.mount_pulsevSfCTzq/usr/share/libsigrokdecode/decoders/ir_irmp/pd.py", line 22, in <module>
    from . import irmp_library
  File "/tmp/.mount_pulsevSfCTzq/usr/share/libsigrokdecode/decoders/ir_irmp/irmp_library.py", line 25, in <module>
    import ctypes
  File "/tmp/.mount_pulsevSfCTzq/usr/share/pyshared/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'

Notifying user of session error:  "Failed to load tests/resources/bticino/rts/extracted/call.sr" ;  "data is invalid"

When it started crashing the last line was:

Exception: data is invalid

abraxa commented 8 months ago

Thanks, fixed in https://sigrok.org/gitaction?p=pulseview.git;a=commit;h=d00efc65ef47090b71c4da12797056033bee795f

abraxa commented 8 months ago

For the record, the issue was that PV was crashing when trying to restore a previous session on startup that referenced a file with invalid data. This would raise an exception that wasn't caught, leading to a crash. This is fixed by the commit and the check for device_ is to provide better feedback when failing to load files.