Bug 1241 - re-load fails for some input file formats
Summary: re-load fails for some input file formats
Status: CONFIRMED
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
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-01 13:39 CEST by Gerhard Sittig
Modified: 2018-10-13 15:34 CEST (History)
0 users



Attachments

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