Bug 1065 - ASSERTs and crash using "sainsmart_dds120_powerup_scl_analog.sr"
Summary: ASSERTs and crash using "sainsmart_dds120_powerup_scl_analog.sr"
Status: RESOLVED FIXED
Alias: None
Product: PulseView
Classification: Unclassified
Component: Other (show other bugs)
Version: unreleased development snapshot
Hardware: All Windows
: Normal major
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-29 15:48 CET by Peter Mortensen
Modified: 2018-04-22 09:09 CEST (History)
3 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Mortensen 2017-11-29 15:48:55 CET
Opening one of the files in the standard dump, 
\sigrok-dumps\i2c\eeprom_24xx\microchip_24lc64\sainsmart_dds120_powerup_scl_analog.sr, results in 4 ASSERTs:

(pulseview.exe:4872): GLib-?[1;35mCRITICAL?[0m **: g_hash_table_lookup: assertion 'hash_table != NULL' failed

(pulseview.exe:4872): GLib-?[1;35mCRITICAL?[0m **: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed

(pulseview.exe:4872): GLib-?[1;35mCRITICAL?[0m **: g_hash_table_lookup: assertion 'hash_table != NULL' failed

(pulseview.exe:4872): GLib-?[1;35mCRITICAL?[0m **: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed


That sigrok file has several logic channels and one analog channel.



After opening this file, PulveView crashes if "Conversion threshold display mode (analog traces only)" in "Settings" is changed.



PulveView version: 0.5.0-git-F97274B6 (nightly build, end of 2017-11).

Platform: Windows XP 64-bit (Windows Server 2003 equivalent).
Comment 1 Peter Mortensen 2017-11-29 15:53:43 CET
Visual Studio claims:

""Unhandled exception at 0x00000000 in pulseview.exe: 0xC0000005: Access violation reading location 0x00000000.""
Comment 2 Peter Mortensen 2017-11-29 18:32:31 CET
I also get it with sigrok-cli, debug build, 2017-11-29 (on Windows):




    "sigrok-cli -i sainsmart_dds120_powerup_scl_analog.sr"

returns a single ASSERT failure:

    g_hash_table_lookup: assertion 'hash_table != NULL' failed
Comment 3 Peter Mortensen 2017-11-29 18:48:12 CET

Running PulseView with "-l 5" resulted in (for opening the file and the crash (but there was no extra output after opening the file)):




sr: [01:26.801000] session-file: Detected sigrok session file version 2.

(pulseview.exe:4508): GLib-?[1;35mCRITICAL?[0m **: g_hash_table_lookup: assertion 'hash_table != NULL' failed

(pulseview.exe:4508): GLib-?[1;35mCRITICAL?[0m **: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed

(pulseview.exe:4508): GLib-?[1;35mCRITICAL?[0m **: g_hash_table_lookup: assertion 'hash_table != NULL' failed

(pulseview.exe:4508): GLib-?[1;35mCRITICAL?[0m **: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
sr: [01:26.802000] device: virtual-session: Opening device instance.
sr: [01:26.803000] hwdriver: sr_config_set(): key 40000 (sessionfile) sdi 0624CBD0 cg NULL -> 'T:/toDelete/2017-11-23/sigrok/sigrok-dumps/i2c/eeprom_24xx/microchip_2
4lc64/sainsmart_dds120_powerup_scl_analog.sr'
sr: [01:26.803000] virtual-session: Setting sessionfile to 'T:/toDelete/2017-11-23/sigrok/sigrok-dumps/i2c/eeprom_24xx/microchip_24lc64/sainsmart_dds120_powerup_scl_
analog.sr'.
sr: [01:26.804000] hwdriver: sr_config_set(): key 40001 (capturefile) sdi 0624CBD0 cg NULL -> 'logic-1'
sr: [01:26.804000] virtual-session: Setting capturefile to 'logic-1'.
sr: [01:26.804000] hwdriver: sr_config_set(): key 30027 (logic_channels) sdi 0624CBD0 cg NULL -> 8
sr: [01:26.804000] hwdriver: sr_config_set(): key 30000 (samplerate) sdi 0624CBD0 cg NULL -> uint64 8000000
sr: [01:26.805000] virtual-session: Setting samplerate to 8000000.
sr: [01:26.805000] hwdriver: sr_config_set(): key 30028 (analog_channels) sdi 0624CBD0 cg NULL -> 1
sr: [01:26.805000] hwdriver: sr_config_set(): key 40002 (capture_unitsize) sdi 0624CBD0 cg NULL -> uint64 1
sr: [01:26.811000] hwdriver: sr_config_get(): key 30000 (samplerate) sdi 0624CBD0 cg NULL -> uint64 8000000
sr: [01:26.811000] session: Using thread-default main context.
sr: [01:26.812000] session: Starting.
sr: [01:26.812000] hwdriver: virtual-session: Starting acquisition.
sr: [01:26.812000] virtual-session: Opening archive T:/toDelete/2017-11-23/sigrok/sigrok-dumps/i2c/eeprom_24xx/microchip_24lc64/sainsmart_dds120_powerup_scl_analog.s
r file logic-1
sr: [01:26.813000] std: virtual-session: Sending SR_DF_HEADER packet.
sr: [01:26.813000] session: bus: Received SR_DF_HEADER packet.
sr: [01:26.814000] virtual-session: Opened logic-1-1.
sr: [01:26.824000] session: bus: Received SR_DF_LOGIC packet (2621440 bytes, unitsize = 1).
sr: [01:26.905000] virtual-session: Opened logic-1-2.
sr: [01:26.915000] session: bus: Received SR_DF_LOGIC packet (2621440 bytes, unitsize = 1).
sr: [01:26.992000] virtual-session: Opened logic-1-3.
sr: [01:26.996000] session: bus: Received SR_DF_LOGIC packet (771370 bytes, unitsize = 1).
sr: [01:27.017000] virtual-session: Opened analog-1-9-1.
sr: [01:27.031000] session: bus: Received SR_DF_ANALOG packet (1048576 samples).
sr: [01:27.097000] session: bus: Received SR_DF_ANALOG packet (1048576 samples).
sr: [01:27.134000] session: bus: Received SR_DF_ANALOG packet (524288 samples).
sr: [01:27.146000] virtual-session: Opened analog-1-9-2.
sr: [01:27.163000] session: bus: Received SR_DF_ANALOG packet (1048576 samples).
sr: [01:27.201000] session: bus: Received SR_DF_ANALOG packet (1048576 samples).
sr: [01:27.251000] session: bus: Received SR_DF_ANALOG packet (524288 samples).
sr: [01:27.263000] virtual-session: Opened analog-1-9-3.
sr: [01:27.313000] session: bus: Received SR_DF_ANALOG packet (771370 samples).
sr: [01:27.334000] std: virtual-session: Sending SR_DF_END packet.
sr: [01:27.334000] session: bus: Received SR_DF_END packet.
sr: [01:27.335000] session: fd_source_finalize: key FFFFFFFF
sr: [01:27.335000] session: Stopped.
Comment 4 Soeren Apel 2017-11-29 23:21:05 CET
Thanks for the report but I can't reproduce this on linux.

Needs verification on Windows.
Comment 5 Uwe Hermann 2017-12-09 23:12:24 CET
Not reproducible on Linux as well for me, it is reproducible on Windows though, indeed.
Comment 6 fenugrec 2017-12-10 04:00:26 CET
(summarized from IRC) - I've taken a look at this using the nightly builds dated 2017-12-09, running on win7-64.

- the assertion failed in sigrok-cli are unrelated to any particular input file, and IMO unrelated to the crash reported here. Seems to originate within glib. The call stack leads to g_key_file_new(), called from sr_sessionfile_read_metadata() @ src/session_file.c line 97

- the series of assertion failures in PV are also IMO unrelated to the crash. These too originate in the greasy bowels of glib, like so:
 * Also g_key_file_new() called from the sr_sessionfile_read_metadata()
 * g_key_file_load_from_data() called from same
 * g_key_file_get_string() called from sr_session_load

- the crash itself would appear to be in pv::views::trace::AnalogSignal::on_settingViewConversionThresholdDispMode_change
d(QVariant)
Comment 7 Soeren Apel 2017-12-10 18:06:46 CET
Can't reproduce this bug on Windows with a local build using sainsmart_dds120_powerup_scl_sda_analog.sr example. Please describe how to reproduce.
Comment 8 Uwe Hermann 2017-12-10 23:24:13 CET
Steps to reproduce:
 - Start PV (i686 installer as of 5 minutes ago).
 - Load sainsmart_dds120_powerup_scl_analog.sr.
 - Add conversion "to logic via threhold" for "SCL analog".
 - Click the settings icon at the top (next to the Run button).
 - In "Views" click on "Conversion threshold display mode (analog traces only)" and change from "Background" to "Dots" (for example; any change seems to trigger this) -> this will crash.


Doesn't seem to happen with the file you mentioned though, sainsmart_dds120_powerup_scl_sda_analog.sr, which could be a hint. That one has *only* analog traces, the one where it crashes has analog and logic.
Comment 9 Soeren Apel 2017-12-10 23:33:41 CET
Hm, now that's odd.

> Doesn't seem to happen with the file you mentioned though,
> sainsmart_dds120_powerup_scl_sda_analog.sr, which could be a hint.
> That one has *only* analog traces, the one where it crashes has analog and logic.

I can 100% reliably crash PV with the currently nightly on Win XP by simply loading sainsmart_dds120_powerup_scl_sda_analog.sr, going to the settings dialog and selecting anything in the drop-down for the "Conversion threshold display mode (analog traces only)" setting.

I didn't set up any conversions, mind you.
Comment 10 Peter Mortensen 2017-12-13 19:25:33 CET
To be clear, I used "sainsmart_dds120_powerup_scl_analog.sr", not "sainsmart_dds120_powerup_scl_sda_analog.sr".
Comment 11 Uwe Hermann 2018-04-22 02:14:16 CEST
I can no longer reproduce this (no crash), neither on Linux, nor Windows XP, nor Windows 10.

I tested sainsmart_dds120_powerup_scl_analog.sr, and sainsmart_dds120_powerup_scl_sda_analog.sr.

Can anyone else still reproduce this? If yes, please reopen the bug report; otherwise it seems this got fixed in the mean time.
Comment 12 Soeren Apel 2018-04-22 09:09:27 CEST
I was able to reproduce this with b732b48 (Jan 2018) but no longer with bf84211 (March 2018). I thought maybe glib received an update in the meanwhile but that doesn't seem to be the case. Either way, I agree that we can consider this bug fixed.