Skip to content

Segfault when auto-scaling plot including moving average with input too short #978

@timp3289

Description

@timp3289

On very recent version built from source on Windows 11 (using MSYS2 UCRT64)
The way I triggered this was the following:

  1. Add a multimeter measuring voltage at a few Hz sample rate
  2. Wire the multimeter output to a Trend block
  3. Wire the Trend output block to a moving average block
  4. Set the moving average block to average more than the currently accumulated number of samples (e.g. set 10K)
    (this does at least show a warning on the block)
  5. Attempt to auto-scale the vertical axis on the waveform viewer
  6. Segfault

GDB backtrace:

#0 0x00007ff75f97520e in WaveformArea::AutofitVertical (this=0x180dd9a0) at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/WaveformArea.cpp:4530 #1 0x00007ff75f96ae88 in WaveformArea::RenderYAxis (this=0x180dd9a0, size=..., gridmap=std::map with 13 elements = {...}, vbot=12.0768929, vtop=12.7280216) at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/WaveformArea.cpp:2734 #2 0x00007ff75f95fdbe in WaveformArea::Render (this=0x180dd9a0, iArea=0, numAreas=1, clientArea=...) at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/WaveformArea.cpp:770 #3 0x00007ff75f97753c in WaveformGroup::Render (this=0x180dd6e0) at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/WaveformGroup.cpp:219 #4 0x00007ff75f8849ad in MainWindow::RenderUI (this=0x2ee2340) at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/MainWindow.cpp:703 #5 0x00007ff75f94c6f1 in VulkanWindow::Render (this=0x2ee2340) at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/VulkanWindow.cpp:495 #6 0x00007ff75f880d4b in MainWindow::Render (this=0x2ee2340) at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/MainWindow.cpp:552 #7 0x00007ff75f984e31 in main (argc=4, argv=0x79c370) at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/main.cpp:280

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions