Bug 1241 - re-load fails for some input file formats
Summary: re-load fails for some input file formats
Alias: None
Product: PulseView
Classification: Unclassified
Component: File handling (show other bugs)
Version: unreleased development snapshot
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: Nobody
Depends on:
Reported: 2018-07-01 13:39 CEST by Gerhard Sittig
Modified: 2022-08-21 17:59 CEST (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Gerhard Sittig 2018-07-01 13:39:07 CEST
How to reproduce:  Load a CSV or VCD input file into Pulseview, and re-load 
that file by hitting "Run" or SPACE again.  Different file formats result in 
different behaviour (SEGV within libsigrok's input module, or Pulseview's 
application code).

$ pulseview -I csv -i digitized.csv
$ pulseview -I vcd -i chronovu_la8_spiflash_read16.vcd

A working theory is that behaviour is due to the difference in code paths 
taken, the first load executes InputFile::open() then InputFile::run(), 
while the second load skips ::open() and only does ::run().  More research 
is needed.
Comment 1 Gerhard Sittig 2018-07-02 20:37:48 CEST
Somehow I should have known this was discussed before.  Bug 1215 discusses 
the reason for the implementation detail, and the (undesired) consequences 
of removing and re-creating channels which get referenced in Pulseview 

It's uncertain whether this report here shall remain separate from bug 1215 
which is associated to Pulseview.  This report here could get associated to 
a requirement for input modules, to not change the channel list across reset() 
calls (or throw fatal errors if the channel list changes across reset(), and 
users need to close and re-open the file if they change such essential 
parameters in their setup.
Comment 2 Gerhard Sittig 2018-10-13 15:34:11 CEST
Commit 08f8421a9e82 (commits up to and including ~) provides common support 
code and adjusts the VCD input module, to cope with the situation and avoid 
the application side issue.  Other input modules can get adjusted in similar 
ways.  It's assumed that device drivers are not affected, the number and 
type of channels should be a property of the device, not the data stream.

Let's keep this item 1241 for the remaining input modules, while bug 1215 
discusses the Pulseview side of managing channels.
Comment 3 Gerhard Sittig 2019-10-19 21:40:58 CEST
Happy birthday to the CSV and WAV fixes. :)  The fix for CSV is on its way 
to mainline with the analog support patch series.  Which just leaves WAV as 
the last affected module (fix also available in my repo).
Comment 4 Uwe Hermann 2019-12-22 14:53:16 CET
The CSV part of this bug is now fixed in affaf540128f83c4f3396043077a94ba888cde1f, thanks!
Comment 5 Gerhard Sittig 2022-08-21 17:59:58 CEST
libsigrok commit 2581d204e0a3 addresses WAV, which completes all input modules