Bug 1241

Summary: re-load fails for some input file formats
Product: PulseView Reporter: Gerhard Sittig <Gerhard.Sittig>
Component: File handlingAssignee: Nobody <nobody>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unreleased development snapshot   
Target Milestone: ---   
Hardware: All   
OS: All   

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 
sessions.

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).