-
Notifications
You must be signed in to change notification settings - Fork 122
Description
Hi,
I spent the evening trying to debug a problem where selecting a data width of 16 bits in Setup > Preferences > Drivers > Siglent SDS HD causes ngscopeclient to crash with an access violation when selecting a memory depth 10 k or above.
I traced the error back to Oscilloscope::Convert16BitSamplesFMA, so I assumed there was a bug in the vector arithmetic, but it prevails when I patched out all vector optimizations and instead used Oscilloscope::Convert16BitSamplesGeneric.
Here is a gdb backtrace in case it helps:
Thread 40 "ngscopeclient" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff8ffef6c0 (LWP 26025)]
0x00007ffff649ab30 in Oscilloscope::Convert16BitSamplesFMA(float*, short const*, float, float, unsigned long) () from /lib/x86_64-linux-gnu/libscopehal.so
(gdb) bt
#0 0x00007ffff649ab30 in Oscilloscope::Convert16BitSamplesFMA(float*, short const*, float, float, unsigned long) () at /lib/x86_64-linux-gnu/libscopehal.so
ngscopeclient/scopehal-apps#1 0x00007ffff649b285 in ??? () at /lib/x86_64-linux-gnu/libscopehal.so
ngscopeclient/scopehal-apps#2 0x00007ffff71f241f in ??? () at /lib/x86_64-linux-gnu/libgomp.so.1
ngscopeclient/scopehal-apps#3 0x00007ffff4ea3d64 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:448
ngscopeclient/scopehal-apps#4 0x00007ffff4f373bc in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
For memory depth 2k, it usually works. In both modes after drawing the waveform, there is sometimes large-scale noise artefacts of the same length as the real data; not sure if those are related.
The issue does not occur when switching to 8-bit data width (but that negates the advantage of a 12 bit oscilloscope).
Let me know if you need more info.
Best regards
Andreas