Skip to content

Dragging a waveform from one group to another causes a crash #983

@timp3289

Description

@timp3289

Windows 11, compiled with MSYS2 UCRT64 gcc
OK on release v0.1.1
Crashes on version compiled from recent (~2 days old) source.

To reproduce:

Open:
sparse.scopesession.zip

Arm the trigger
Drag the waveform Add_2 into the plot with ACRMS_1.trend and ACRMS_4.trend

(crash)

Crash info:

C:/msys64/ucrt64/include/c++/15.2.0/bits/stl_vector.h:1263: constexpr std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::shared_ptr<DisplayedChannel>; _Alloc = std::allocator<std::shared_ptr<DisplayedChannel> >; reference = std::shared_ptr<DisplayedChannel>&; size_type = long long unsigned int]: Assertion '__n < this->size()' failed.
gdb: unknown target exception 0xc0000409 at 0x7ffc14fe4ace

Thread 1 received signal ?, Unknown signal.
0x00007ffc14fe4ace in ucrtbase!abort () from C:\WINDOWS\System32\ucrtbase.dll

Backtrace:

(gdb) bt
#0  0x00007ffc14fe4ace in ucrtbase!abort () from C:\WINDOWS\System32\ucrtbase.dll
#1  0x00007ffb5fc6a2fb in ?? () from C:\msys64\ucrt64\bin\libstdc++-6.dll
#2  0x00007ff6676bb577 in std::vector<std::shared_ptr<DisplayedChannel>, std::allocator<std::shared_ptr<DisplayedChannel> > >::operator[] (this=0x180dcf48, __n=0)
    at C:/msys64/ucrt64/include/c++/15.2.0/bits/stl_vector.h:1263
#3  0x00007ff6674e6c68 in WaveformArea::GetStream (this=0x180dcf10, i=0)
    at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/WaveformArea.h:480
#4  0x00007ff6674ba7fa in WaveformGroup::Render (this=0x181141f0)
    at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/WaveformGroup.cpp:257
#5  0x00007ff6673c4a97 in MainWindow::RenderUI (this=0x2f64660)
    at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/MainWindow.cpp:705
#6  0x00007ff66748f987 in VulkanWindow::Render (this=0x2f64660)
    at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/VulkanWindow.cpp:623
#7  0x00007ff6673c0e11 in MainWindow::Render (this=0x2f64660)
    at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/MainWindow.cpp:554
#8  0x00007ff6674c95cf in main (argc=1, argv=0x803fe0)
    at C:/msys64/home/tim/repos/scopehal-apps/src/ngscopeclient/main.cpp:320

Compiled with MSYS UCRT64, CMAKE_BUILD_TYPE=debugnoopt and launched from gdb

tim@TIMSPC UCRT64 ~/repos/scopehal-apps
$ gcc --version
gcc.exe (Rev8, Built by MSYS2 project) 15.2.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Version info:

tim@TIMSPC UCRT64 ~/repos/scopehal-apps
$ git submodule status
 6c4d9be819baddddc76d8e567574827b9959a14d doc (6c4d9be)
 4e122b687f25f3daeacddbfa8fe395236983ad4e lib (heads/master)
 2917cd9ec120bce7b4297e7f3afb660071707e05 src/ImGuiFileDialog (v0.6.4-75-g2917cd9)
 3ef1e5c131fffc521828b6c7ee90f6685da430c5 src/imgui (heads/docking)
 6047a3b2cce1f4fbc9e814b71da29eb9cbd7f650 src/imgui-node-editor (heads/master)
 3914f24ddd3a6369308efd48dfcace3bc6096783 src/imgui_markdown (3914f24)
 6db343ad341ba2d7166f1a71b5b182a380e5bc08 src/nativefiledialog-extended (v1.2.1-10-g6db343a)

tim@TIMSPC UCRT64 ~/repos/scopehal-apps
$ git log
commit 19697ef2485280a13c31b8bc98b780e8b704a7ce (HEAD -> master, tag: v0.0.0, origin/master, origin/HEAD)
Author: Andrew D. Zonenberg <azonenberg@drawersteak.com>
Date:   Tue Apr 7 11:14:15 2026 -0700

    Updated to latest scopehal

commit 7b37c6749fd76911d54fe5342adc5c2c1137242b
Author: Andrew Zonenberg <azonenberg@drawersteak.com>
Date:   Mon Apr 6 09:17:00 2026 -0700

    Updated to latest submodules

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions