Open SL-RU opened 2 years ago
The problem seems to be caused by a change in libusb, specifically commit 32a22069428cda9d63aa666e92fb8882a83d4515. Since this commit, usbi_default_context is only initialized in certain cases, but DSView relies on it being always initialized.
As a temporary fix, downgrading libusb from 1.0.25-2 to 1.0.24-2 works.
@[SL-RU], you can pull the last version code, than swith to branch 'dev-tai', and rebuild your project. We have fixed the usb hotplug_lcallback_registor bug on archlinux. thank you!
I am also getting segfaults in Debian testing. Rolling back libusb 1.0.24-3 solved it for now. I've also tried the dev-tai branch but is also segfaults with the latest libusb.
+1
@zelea2 @noodlefighter My system is an archlinux virtual machine. I execute the command Pacman - Syu to update all packages to the latest. However, the DSView does not cause libusb problems. If you like, please pull the latest code, switch to the 'dev-tai' branch, recompile and run it in terminal mode to see the output program version.
I cannot compile the dev-tai branch: git pull ; git switch dev-tai ; git checkout cd DSView ; cmake . ; make
/usr/src/DSView/DSView/pv/sigsession.cpp: In member function 'void pv::SigSession::start_capture(bool)':
/usr/src/DSView/DSView/pv/sigsession.cpp:471:9: error: 'sr_check_session_start_before' was not declared in this scope
471 | if (sr_check_session_start_before() != 0){
| ^~~~~~~~~
/usr/src/DSView/DSView/pv/sigsession.cpp: In member function 'void pv::SigSession::hotplug_proc()':
/usr/src/DSView/DSView/pv/sigsession.cpp:1234:13: error: 'sr_hotplug_wait_timout' was not declared in this scope
1234 | sr_hotplug_wait_timout(_sr_ctx);
| ^~~~~~
/usr/src/DSView/DSView/pv/sigsession.cpp: In member function 'void pv::SigSession::register_hotplug_callback()':
/usr/src/DSView/DSView/pv/sigsession.cpp:1256:9: error: 'sr_listen_hotplug' was not declared in this scope
1256 | if (sr_listen_hotplug(_sr_ctx, hotplug_callback, NULL) != 0){
| ^~~~~
/usr/src/DSView/DSView/pv/sigsession.cpp: In member function 'void pv::SigSession::deregister_hotplug_callback()':
/usr/src/DSView/DSView/pv/sigsession.cpp:1263:5: error: 'sr_close_hotplug' was not declared in this scope
1263 | sr_close_hotplug(_sr_ctx);
| ^~~~
make[2]: *** [CMakeFiles/DSView.dir/build.make:659: CMakeFiles/DSView.dir/pv/sigsession.cpp.o] Error 1
@zelea2 The libsigrok4DSL lib old header file have be installed to /usr/include, so you need to execute make clean command。Please consult INSTALL file in the parent directory. Don't forget libsigrokdecode4DSL lib, They all need to be recompiled and installed. Finally, it's the turn to compile the dsview project.
i rebulid libsigrok4dsl & libsigrokdecode4dsl, and install them.. and then compile dsview, failed:
/home/r/.cache/yay/dsview/src/DSView-dev-tai/DSView/pv/view/ruler.cpp: In static member function 'static QString pv::view::Ruler::format_freq(double, unsigned int)':
/home/r/.cache/yay/dsview/src/DSView-dev-tai/DSView/pv/view/ruler.cpp:102:12: error: no match for 'operator<<' (operand types are 'QTextStream' and '<unresolved overloaded function type>')
102 | ts << fixed << 1 / (period * multiplier) <<
@noodlefighter What is the version of your qt class? have you installed qt6.0 class? and your linux distribution is? this project can not build with qt6.0 class. thank you!
@dreamsource-tai Manjaro Linux qt6 is installed, but i sure it is built with qt5:
==> Starting prepare()...
CMake Deprecation Warning at CMakeLists.txt:22 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Using Qt5
-- Found libusb-1.0:
-- - Includes: /usr/include/libusb-1.0
-- - Libraries: /usr/lib/libusb-1.0.so
...
/home/r/.cache/yay/dsview/src/DSView-dev-tai/DSView/pv/view/ruler.cpp: In static member function 'static QString pv::view::Ruler::format_freq(double, unsigned int)':
/home/r/.cache/yay/dsview/src/DSView-dev-tai/DSView/pv/view/ruler.cpp:102:12: error: no match for 'operator<<' (operand types are 'QTextStream' and '<unresolved overloaded function type>')
102 | ts << fixed << 1 / (period * multiplier) <<
| ~~~^~~~~~~~
In file included from /usr/include/qt/QtCore/QTextStream:1,
from /home/r/.cache/yay/dsview/src/DSView-dev-tai/DSView/pv/view/ruler.cpp:39:
/usr/include/qt/QtCore/qtextstream.h:174:18: note: candidate: 'QTextStream& QTextStream::operator<<(QChar)'
174 | QTextStream &operator<<(QChar ch);
...
$ pacman -Qo /usr/include/qt/QtCore/qtextstream.h
/usr/include/qt/QtCore/qtextstream.h is owned by qt5-base 5.15.2+kde+r297-1.1
@noodlefighter I removed QTextStream in pv/rule.cpp, please try again.
@dreamsource-tai compile done! seems to work fine, thx
After another git pull I've managed to compile it. But there was a quirk: the first 2-3 times when I've tried to run it I've got the following:
$ DSView
----------------- version: 1.2.0-RC5 -----------------
decode script path is: "/usr/local/share/libsigrokdecode4DSL/decoders"
receive event:DreamSourceLab Hardware attached!
receive event:DreamSourceLab Hardware attached!
receive event:DreamSourceLab Hardware detached!
process event:DreamSourceLab hardware detached!
Segmentation fault
$ DSView
----------------- version: 1.2.0-RC5 -----------------
decode script path is: "/usr/local/share/libsigrokdecode4DSL/decoders"
qt.qpa.xcb: QXcbConnection: XCB error: 148 (Unknown), sequence: 209, resource id: 0, major code: 140 (Unknown), minor code: 20
sr: session: sr_session_destroy: session was NULL
$ DSView
----------------- version: 1.2.0-RC5 -----------------
decode script path is: "/usr/local/share/libsigrokdecode4DSL/decoders"
receive event:DreamSourceLab Hardware attached!
receive event:DreamSourceLab Hardware attached!
receive event:DreamSourceLab Hardware detached!
process event:DreamSourceLab hardware detached!
Segmentation fault
and then it started to work by itself:
$ DSView
----------------- version: 1.2.0-RC5 -----------------
decode script path is: "/usr/local/share/libsigrokdecode4DSL/decoders"
receive event:DreamSourceLab Hardware attached!
receive event:DreamSourceLab Hardware attached!
qt.qpa.xcb: QXcbConnection: XCB error: 148 (Unknown), sequence: 209, resource id: 0, major code: 140 (Unknown), minor code: 20
start capture, device title: "DSLogic"
session run loop start
session run loop end
sr: session: sr_session_destroy: session was NULL
This version does not remember the number of channels selected (it always starts with 16) while the previous "origin" branch does.
After plugging in the DSLogic and launching DSView I get a segfault in version 1.2.0-RC5. If you launch DSView again then it works. So it seems this issue is not solved completely. I am attaching a strace when it segfaults. I'm going back to master branch and libusb 1.0.24-3 until this is solved. strace.txt.gz
@zelea2 This is a Qt error, not a DSView error. please execute command as 'apt intall qtbase5-dev ' to install qt5 on your debian.
@zelea2 This is a Qt error, not a DSView error. please execute command as 'apt intall qtbase5-dev ' to install qt5 on your debian.
What is a Qt error? The segfault? Your code still segfaults after a fresh plugin of the DSLogic. I am already at the latest version on qt5: $ sudo apt install qtbase5-dev qtbase5-dev is already the newest version (5.15.2+dfsg-14).
I'm using archlinux. I've cloned sources from master (commit
a80c82d07f2058b389645d4158322101947a8936
). Compilation was finished without errors. But execution fails:Click to view the log
``` $ DSView --loglevel 5 sr: libsigrok loglevel set to 5. srd: libsigrokdecode loglevel set to 5. sr: Sanity-checking all drivers. sr: Sanity-checking all input modules. sr: Sanity-checking all output modules. srd: Initializing libsigrokdecode. srd: Adding '/usr/share/libsigrokdecode4DSL/decoders' to module path. srd: Adding '/usr/share/libsigrokdecode4DSL/decoders' to module path. srd: Protocol decoder search paths: - /usr/share/libsigrokdecode4DSL/decoders - /usr/share/libsigrokdecode4DSL/decoders srd: Python system search paths: - /usr/share/libsigrokdecode4DSL/decoders - /usr/share/libsigrokdecode4DSL/decoders - /usr/lib/python310.zip - /usr/lib/python3.10 - /usr/lib/python3.10/lib-dynload - /home/lyra/.local/lib/python3.10/site-packages - /usr/lib/python3.10/site-packages srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Dictionary has no attribute 'type'. srd: Failed to load decoder ir_sirc: import by name failed:ImportError:cannot import name 'bitpack_lsb' from 'common.srdhelper' (/usr/share/libsigrokdecode4DSL/decoders/common/srdhelper/__init__.py). srd: Traceback (most recent call last): File "/usr/share/libsigrokdecode4DSL/decoders/ir_sirc/__init__.py", line 26, inGDB output:
Versions of the libraries: