cortexcontorl 0.10 or nightly crash at start

74 views
Skip to first unread message

Juan Pablo Carbajal

unread,
Jul 6, 2018, 12:02:04 PM7/6/18
to dynapse-users
Hi all,

Just starting with cortexcontrol. Following the installation instructions http://ai-ctx.gitlab.io/ctxctl/primer.html#install
I get

$ ./cortexcontrol
Illegal instruction (core dumped)

The same happens with nightly build and when using sudo.

Am I missing any dependency not mentioned in the manual?

I am running Ubuntu 18.04 with python3 as default python command.

If you have instructions on how to debug I will help.

Let me know if I should add this as an issue.

Thanks for the help

Juan Pablo Carbajal

unread,
Jul 6, 2018, 12:25:21 PM7/6/18
to dynapse-users
Runining with the intermediary script I get

$ ./cortexcontrol.bin
./cortexcontrol.bin: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.11' not found (required by ./cortexcontrol.bin)

Maybe is this?
I think the program is looking for libraries in my system folder, when it should look into its own lib folder, isn't that the case?
What's the correct way to call the function to tell it to look for libs in the cortexcontorl/lib folder?

I've tried without success ()it doesn't complain about missing libs though)

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib/; ./cortexcontrol.bin
Illegal instruction (core dumped)

carsten.nielsen

unread,
Jul 9, 2018, 2:47:58 AM7/9/18
to dynapse-users
Can you post the contents of the lib folder in the ctxctl bundle as well as the output of

    LD_LIBRARY_PATH=/path/to/cortexcontrol/lib ldd cortexcontrol.bin

Juan Pablo Carbajal

unread,
Jul 11, 2018, 4:51:53 AM7/11/18
to dynapse-users
For the stable release:
$ ls lib/
libcaer.so.2          libQt5Core.so.5             libusb-1.0.so.0
libexpat.so.1         libQt5DBus.so.5             libutil.so.1
libfontconfig.so.1    libQt5Gui.so.5              libXau.so.6
libfreetype.so.6      libQt5Network.so.5          libXcomposite.so.1
libgcc_s.so.1         libQt5Qml.so.5              libXdamage.so.1
libglib-2.0.so.0      libQt5QuickControls2.so.5   libXdmcp.so.6
libicudata.so.55      libQt5Quick.so.5            libXext.so.6
libicui18n.so.55      libQt5QuickTemplates2.so.5  libXfixes.so.3
libicuuc.so.55        libQt5Widgets.so.5          libXi.so.6
libm.so.6             libQt5XcbQpa.so.5           libXrender.so.1
libpcre.so.3          librt.so.1                  libz.so.1
libpng12.so.0         libstdc++.so.6
libpython3.6m.so.1.0  libudev.so.1

$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib/ ldd ./cortexcontrol.bin
    linux-vdso.so.1 (0x00007ffcf59b9000)
    libcaer.so.2 => ./lib/libcaer.so.2 (0x00007fba735bc000)
    libQt5Quick.so.5 => ./lib/libQt5Quick.so.5 (0x00007fba72f38000)
    libQt5Qml.so.5 => ./lib/libQt5Qml.so.5 (0x00007fba7293f000)
    libQt5Gui.so.5 => ./lib/libQt5Gui.so.5 (0x00007fba7212e000)
    libQt5Core.so.5 => ./lib/libQt5Core.so.5 (0x00007fba719a3000)
    libpython3.6m.so.1.0 => ./lib/libpython3.6m.so.1.0 (0x00007fba712de000)
    libstdc++.so.6 => ./lib/libstdc++.so.6 (0x00007fba70f5c000)
    libgcc_s.so.1 => ./lib/libgcc_s.so.1 (0x00007fba70d46000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fba70955000)
    libusb-1.0.so.0 => ./lib/libusb-1.0.so.0 (0x00007fba7073d000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fba7051e000)
    libm.so.6 => ./lib/libm.so.6 (0x00007fba70215000)
    libQt5Network.so.5 => ./lib/libQt5Network.so.5 (0x00007fba6fed8000)
    libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007fba6fc4c000)
    libicui18n.so.55 => ./lib/libicui18n.so.55 (0x00007fba6f7ea000)
    libicuuc.so.55 => ./lib/libicuuc.so.55 (0x00007fba6f456000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fba6f252000)
    libglib-2.0.so.0 => ./lib/libglib-2.0.so.0 (0x00007fba6ef41000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fba737ef000)
    libexpat.so.1 => ./lib/libexpat.so.1 (0x00007fba6ed18000)
    libz.so.1 => ./lib/libz.so.1 (0x00007fba6eafe000)
    libutil.so.1 => ./lib/libutil.so.1 (0x00007fba6e8fb000)
    libudev.so.1 => ./lib/libudev.so.1 (0x00007fba739b2000)
    libGLX.so.0 => /usr/lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fba6e6ca000)
    libGLdispatch.so.0 => /usr/lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fba6e414000)
    libicudata.so.55 => ./lib/libicudata.so.55 (0x00007fba6c95d000)
    libpcre.so.3 => ./lib/libpcre.so.3 (0x00007fba6c6ed000)
    librt.so.1 => ./lib/librt.so.1 (0x00007fba6c4e5000)
    libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fba6c1ac000)
    libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fba6bf84000)
    libXau.so.6 => ./lib/libXau.so.6 (0x00007fba6bd80000)
    libXdmcp.so.6 => ./lib/libXdmcp.so.6 (0x00007fba6bb7a000)

carsten.nielsen

unread,
Jul 11, 2018, 5:01:24 AM7/11/18
to dynapse-users
From the bundled lib folder remove: libpcre, librt and try again.

Juan Pablo Carbajal

unread,
Jul 11, 2018, 7:27:54 AM7/11/18
to dynapse-users
After removing those libraries, still the same result

$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib/ ./cortexcontrol.bin
Illegal instruction (core dumped)

shall I remove the (system) libraires one by one from the cortexcontrol/lib folder?

Isn't there a way to use gdb to pin out the offending command?

Juan Pablo Carbajal

unread,
Jul 11, 2018, 7:33:59 AM7/11/18
to dynapse-users
Testing my own idea:
$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib/ gdb ./cortexcontrol.bin
...
(gdb) run
Starting program: /home/juanpi/Documents/innoswiss_aiCTX/cortexcontrol/cortexcontrol.bin
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffee6c4700 (LWP 15038)]
[New Thread 0x7fffed687700 (LWP 15039)]

Thread 1 "cortexcontrol.b" received signal SIGILL, Illegal instruction.
0x00007ffff484e06f in ?? () from ./lib/libm.so.6

It seems libm is causing the trouble, removing that I get to move to the next problem

$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib/ ./cortexcontrol.bin
Segmentation fault (core dumped)

Is it difficult to compile coretexcontrol from sources? If you have source distribution I can give it a try (hopefully with a Makefile)

carsten.nielsen

unread,
Jul 11, 2018, 7:34:15 AM7/11/18
to dynapse-users
You can try using gdb to execute the binary, but if it is a system library issue it will usually crash before you get any useful information. You can also try strace.

The easiest thing to do is to remove the libraries one by one as you said. Let me know which ones were the offenders.

Juan Pablo Carbajal

unread,
Jul 11, 2018, 7:55:55 AM7/11/18
to dynapse-users
Ok, as said before

libm --> iIlegal instruction
libcaer (caerDeviceDiscover) --> segfault
libz --> not compatible with system's libpng16 (requires 1.2.9)

Using my own compiled version of libcaer (libcaer.so.2.4.3) I get to:
$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib/:/opt/lib/ ./cortexcontrol.bin
Failed to initialize libUSB
QQmlApplicationEngine failed to load component
qrc:///qml/main.qml:3 module "QtQuick.Controls" is not installed
qrc:///qml/main.qml:6 module "QtQuick.Controls" is not installed
qrc:///qml/main.qml:1 module "QtQuick" is not installed
qrc:///qml/main.qml:7 module "QtQuick.Layouts" is not installed
qrc:///qml/main.qml:2 module "QtQuick.Window" is not installed
qrc:///qml/main.qml:3 module "QtQuick.Controls" is not installed
qrc:///qml/main.qml:6 module "QtQuick.Controls" is not installed
qrc:///qml/main.qml:1 module "QtQuick" is not installed
qrc:///qml/main.qml:7 module "QtQuick.Layouts" is not installed
qrc:///qml/main.qml:2 module "QtQuick.Window" is not installed
qrc:///qml/main.qml:3 module "QtQuick.Controls" is not installed
qrc:///qml/main.qml:6 module "QtQuick.Controls" is not installed
qrc:///qml/main.qml:1 module "QtQuick" is not installed
qrc:///qml/main.qml:7 module "QtQuick.Layouts" is not installed
qrc:///qml/main.qml:2 module "QtQuick.Window" is not installed
qrc:///qml/main.qml:3 module "QtQuick.Controls" is not installed
qrc:///qml/main.qml:6 module "QtQuick.Controls" is not installed
qrc:///qml/main.qml:1 module "QtQuick" is not installed
qrc:///qml/main.qml:7 module "QtQuick.Layouts" is not installed
qrc:///qml/main.qml:2 module "QtQuick.Window" is not installed
qrc:///qml/main.qml:3 module "QtQuick.Controls" is not installed
qrc:///qml/main.qml:6 module "QtQuick.Controls" is not installed
qrc:///qml/main.qml:1 module "QtQuick" is not installed
qrc:///qml/main.qml:7 module "QtQuick.Layouts" is not installed
qrc:///qml/main.qml:2 module "QtQuick.Window" is not installed

At which point I need to kill the process because it hangs there. This seems a qt problem and I infer that you are using Qt5_11, but the best I can do is to get Qt5_9.5
So if I remove the bundled qt5 libraries I get

$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib/:/opt/lib/ ./cortexcontrol.bin

./cortexcontrol.bin: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.11' not found (required by ./cortexcontrol.bin)

Can you make cortexcontrol robust against subversions of qt5?
Anyway of getting a non-gui cortexcontrol? (or a flag --no-gui on the exec)

Juan Pablo Carbajal

unread,
Jul 11, 2018, 8:04:03 AM7/11/18
to dynapse-users
Another step forward
I removed libusd and libudev from the bundle and use my system's. I put back the libqT5 libraries form the bundle.
The gui now runs (empty canvas with a couple of menues), but the message

Failed to initialize libUSB

is still there

To make sure the device is not the root of the problem:
$ dmesg # after plugging the device
[28815.638186] usb 3-2: new high-speed USB device number 11 using xhci_hcd
[28815.786794] usb 3-2: New USB device found, idVendor=152a, idProduct=841d
[28815.786799] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[28815.786802] usb 3-2: Product: Dynap-se
[28815.786805] usb 3-2: Manufacturer: iniLabs
[28815.786808] usb 3-2: SerialNumber: 00000012

On Friday, July 6, 2018 at 6:02:04 PM UTC+2, Juan Pablo Carbajal wrote:

carsten.nielsen

unread,
Jul 11, 2018, 8:08:07 AM7/11/18
to dynapse-users
ctxctl is compiled against Qt 5.11 and will never support lesser versions. The Qt 5.11 libraries are bundled with the application and your system version is a non-issue.

The issue here is that a system library which is incompatible with your kernel has sneaked into the bundle. Which kernel and libc version are you using?

Whenever you remove a library from the libs folder, you should always execute ctxctl using the launcher script. Otherwise it will never work.

The application will never function if libcaer is removed from the libs folder.

Try removing these libraries (if present) one by one and checking using the launcher script:
libanl.so.1
libBrokenLocale.so.1
libcidn.so.1
libcrypt.so.1
libc.so.6
libdl.so.2
libm.so.6
libmvec.so.1
libnsl.so.1
libnss_compat.so.2
libnss_db.so.2
libnss_dns.so.2
libnss_files.so.2
libnss_hesiod.so.2
libnss_nisplus.so.2
libnss_nis.so.2
libpthread.so.0
libresolv.so.2
librt.so.1
libthread_db.so.1
libutil.so.1
libstdc++.so.6
libGL.so.1
libdrm.so.2
libglapi.so.0
libxcb.so.1
libgio-2.0.so.0
libfontconfig.so.1
libfreetype.so.6 libharfbuzz.so.0
libcom_err.so.2 libcrypt.so.1 libexpat.so.1 libgcc_s.so.1 libglib-2.0.so.0 libgpg-error.so.0
libz.so.1
libSM.so.6 libusb-1.0.so.0 libuuid.so.1

Juan Pablo Carbajal

unread,
Jul 11, 2018, 8:41:54 AM7/11/18
to dynapse-users
"The application will never function if libcaer is removed from the libs folder." Why? It is working now that I provided one that I compiled....

Anyways. If I keep the libcaer of the bundled I always get segmentation fault, as I mentioned in my previous mail.

Information requested follows:

$ uname -r
4.15.0-23-generic

$ apt-cache policy libc-bin:
  Installed: 2.27-3ubuntu1
  Candidate: 2.27-3ubuntu1


*** Removing of bundled libraries

1. I removed all libs except libQt* and restored all the ones my system did not find.
  Result: I get the gui working without plots when I restore all the libcu* libraries

$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib/:/opt/lib/ ./cortexcontrol
Failed to initialize libUSB

2. I restore the bundled libcaer
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib/ ./cortexcontrol
Segmentation fault (core dumped)

I modified the script to run gdb (exec gdb "$0".bin "$@") and I get
(gdb) run
Starting program: /home/juanpi/Documents/innoswiss_aiCTX/cortexcontrol/cortexcontrol.bin
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffee1c5700 (LWP 16019)]
[New Thread 0x7fffed188700 (LWP 16020)]
[New Thread 0x7fffe7bff700 (LWP 16021)]
[New Thread 0x7fffe73fe700 (LWP 16022)]
[Thread 0x7fffe73fe700 (LWP 16022) exited]
Thread 1 "cortexcontrol.b" received signal SIGSEGV, Segmentation fault.
0x00007ffff7bab2e3 in caerDeviceDiscover () from ./lib/libcaer.so.2


So the only way cortexcontrol gui works here is if I use my compiled version of libcaer.

carsten.nielsen

unread,
Jul 11, 2018, 8:49:54 AM7/11/18
to dynapse-users
Can you run gdb like this:
LD_LIBRARY_PATH=./lib QML2_IMPORT_PATH=./qml gdb ./cortexcontrol.bin

and get a backtrace after the segfault?

Juan Pablo Carbajal

unread,
Jul 11, 2018, 8:53:42 AM7/11/18
to dynapse-users
ok, this was mentioned in the manual.
The segmentation fault is casued by the lack of permissions for the user to open the usb device. Runnig with sudo makes cortexcontrol work!

$ sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib/ ./cortexcontrol
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
false
false
Exposing Dynapse

qrc:///qml/main.qml:61:2: QML SplitView: Cannot anchor to an item that isn't a parent or sibling.
SpikePresenter(0x21ee850)
SpikePresenter(0x21ee850)
qrc:///qml/main.qml:50:15: QML ListView: StackView has detected conflicting anchors. Transitions may not execute properly.
qml: Entering device view
""
""
""
""
""   0
""
""
""
""
""
""   0
""
QThread: Destroyed while thread is still running
Aborted

The Qt interface isn't really working, e.g. Quit doesn't work

*** Final stage of the bundle

$ ls ./lib
libcaer.so.2      libQt5DBus.so.5            libQt5Quick.so.5
libicudata.so.55  libQt5Gui.so.5             libQt5QuickTemplates2.so.5
libicui18n.so.55  libQt5Network.so.5         libQt5Widgets.so.5
libicuuc.so.55    libQt5Qml.so.5             libQt5XcbQpa.so.5
libQt5Core.so.5   libQt5QuickControls2.so.5


Martin Bertele

unread,
Aug 23, 2018, 3:27:12 PM8/23/18
to dynapse-users

Hi Juan,

The segmentation fault is casued by the lack of permissions for the user to open the usb device. Runnig with sudo makes cortexcontrol work!

I've had the same issue. As described here https://gitlab.com/aiCTX/ctxctl-issues/issues/4 I tried to change permissions, but it did not work. Did you find a way to solve it without running with sudo?
 
QThread: Destroyed while thread is still running
Aborted

The Qt interface isn't really working, e.g. Quit doesn't work

 
For me quit does not work either.
Do you know, in the cortexcontrol pythonconsole, what modules do I have access to for import? Is the proper way of extending it via imp.load_source(..) ?

Thanks,
Martin

Martin Bertele

unread,
Aug 27, 2018, 6:22:27 AM8/27/18
to dynapse-users

Do you know, in the cortexcontrol pythonconsole, what modules do I have access to for import? Is the proper way of extending it via imp.load_source(..) ?


I could fix the module imports, when installing packages with
python3.6 -m pip install <package_name>
it is possible to import them as usual, import <package_name>.

While from a conda virtual environment after running sudo ./cortexcontrol from the activated virtual environment, a package installed via conda install <pkg_name>
is not accessible. I tried sys.path.appen(<virtal_environment_directory>) and sys.prefix= <virtual_environment_directory>.
How is it supposed to work from a virtual environment?

Thanks

carsten.nielsen

unread,
Aug 27, 2018, 11:02:03 AM8/27/18
to dynapse-users
Cortexcontrol runs its own python interpreter and therefore tries to import packages from the PYTHONHOME and PYTHONPATH environment variables. Anaconda creates a PYTHONHOME for every environment you have in the users home directory and PYTHONHOME must be modified to point to this directory.

Cortexcontrol does not play well with anaconda at the moment because anaconda works by creating a million environments for every configuration and cortexcontrol relies on the system environment. We are looking into fixing this.
Reply all
Reply to author
Forward
0 new messages