Bug 423899 - Segmentation fault on fresh build of artikulate
Summary: Segmentation fault on fresh build of artikulate
Status: RESOLVED NOT A BUG
Alias: None
Product: Artikulate
Classification: Applications
Component: general (show other bugs)
Version: GIT (master)
Platform: Compiled Sources Linux
: NOR critical
Target Milestone: ---
Assignee: Andreas Cord-Landwehr
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-05 12:25 UTC by Avinash Sonawane
Modified: 2021-03-22 11:01 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Avinash Sonawane 2020-07-05 12:25:24 UTC
Hello!

I just git cloned and compiled Artikulate on Ubuntu 20.04 LTS

$ bin/artikulate
articulate.core: Repository created from with location QUrl("file:///home/rootkea/.local/share/artikulate/courses/")
articulate.core: Loading courses from "/home/rootkea/.local/share/artikulate/courses"
log_liblearner: Database path:  "/home/rootkea/.local/share/artikulate/learnerdata.db"
log_liblearner: No last active profile found, falling back to first found profile
QObject::connect(OutputBackendInterface, OutputDeviceController): invalid null parameter
Segmentation fault (core dumped)
$
Comment 1 Avinash Sonawane 2020-07-10 04:57:52 UTC
gdb log:
(gdb) run
Starting program: /home/rootkea/Downloads/todo/hacking/artikulate/build/bin/artikulate 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff1bac700 (LWP 2512303)]
[New Thread 0x7fffebfff700 (LWP 2512304)]
[New Thread 0x7fffeb7fe700 (LWP 2512305)]
articulate.core: Repository created from with location QUrl("file:///home/rootkea/.local/share/artikulate/courses/")
articulate.core: Loading courses from "/home/rootkea/.local/share/artikulate/courses"
articulate.core: Loading resource "/home/rootkea/.local/share/artikulate/courses/basic/gr/gr.xml"
articulate.core: Loading resource "/home/rootkea/.local/share/artikulate/courses/basic/gr/gr.xml"
articulate.core: Reloading of resources not yet supported, skippen course
articulate.core: Loading resource "/home/rootkea/.local/share/artikulate/courses/basic/ba/ba.xml"
articulate.core: Loading resource "/home/rootkea/.local/share/artikulate/courses/basic/ba/ba.xml"
articulate.core: Reloading of resources not yet supported, skippen course
articulate.core: Loading resource "/home/rootkea/.local/share/artikulate/courses/basic/fr/fr.xml"
articulate.core: Loading resource "/home/rootkea/.local/share/artikulate/courses/basic/fr/fr.xml"
articulate.core: Reloading of resources not yet supported, skippen course
[New Thread 0x7fffeaffd700 (LWP 2512306)]
log_liblearner: Database path:  "/home/rootkea/.local/share/artikulate/learnerdata.db"
log_liblearner: No last active profile found, falling back to first found profile
QObject::connect(OutputBackendInterface, OutputDeviceController): invalid null parameter

Thread 1 "artikulate" received signal SIGSEGV, Segmentation fault.
OutputDeviceControllerPrivate::lazyInit (this=0x5555559021d0)
    at /home/rootkea/Downloads/todo/hacking/artikulate/libsound/src/outputdevicecontroller.cpp:81
81	        m_volume = m_backend->volume();
(gdb) bt
#0  OutputDeviceControllerPrivate::lazyInit() (this=0x5555559021d0)
    at /home/rootkea/Downloads/todo/hacking/artikulate/libsound/src/outputdevicecontroller.cpp:81
#1  0x00007ffff7e50d29 in OutputDeviceController::self() ()
    at /home/rootkea/Downloads/todo/hacking/artikulate/libsound/src/outputdevicecontroller.cpp:110
#2  0x000055555555a012 in MainWindow::MainWindow() (this=0x5555556c1100)
    at /home/rootkea/Downloads/todo/hacking/artikulate/src/mainwindow.cpp:30
#3  0x0000555555559912 in main(int, char**) (argc=1, argv=0x7fffffffdfd8)
    at /home/rootkea/Downloads/todo/hacking/artikulate/src/main.cpp:52
(gdb)
Comment 2 Andreas Cord-Landwehr 2020-07-19 08:41:42 UTC
This crash comes from the problem that the respective OutputDevice plugin is not found. Please set the QT_PLUGIN_PATH environment variable in cases when the plugin is not installed into the Qt system location.
I will add a fatal error though that explains this problem.
Comment 3 Avinash Sonawane 2020-07-22 17:20:28 UTC
> the respective OutputDevice plugin is not found.

I'm sorry but I don't understand. cmake[0] doesn't show any plugin missing.

[0] https://pastebin.com/raw/svPRfC39
Comment 4 Andreas Cord-Landwehr 2020-07-22 19:17:46 UTC
You do not find anything in the CMake output, because your problem is not in the build system: When starting Artikulate, it looks in your system at the Qt default paths for plugins as well as the location that are defined with QT_PLUGIN_PATH (see https://doc.qt.io/qt-5/deployment-plugins.html). Because Artikulate does not find the (apparently correctly built plugins) it crashes on startup.

Thus, all you have to do to set the path correctly in your environment.
Comment 5 Avinash Sonawane 2020-07-22 22:28:43 UTC
> see https://doc.qt.io/qt-5/deployment-plugins.html
As per the linked page Qt searches for plugins in application's executable directory and indeed there are libartikulatesound.so and qtmultimediabackend.so along with other .so s in ./build/bin/. I'm not sure which plugin is "missing".

> all you have to do to set the path correctly in your environment.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04 LTS
Release:	20.04
Codename:	focal
$ git clone https://invent.kde.org/education/artikulate
$ mkdir artikulate/build; cd artikulate/build
$ cmake ..
$ make -j4
$ ./bin/artikulate
...
log_liblearner: No last active profile found, falling back to first found profile
QObject::connect(OutputBackendInterface, OutputDeviceController): invalid null parameter
Segmentation fault (core dumped)
$
Please let me know which environment variable needs to be set and could it be done by the build process itself?

Interesting observation is that if I `apt install artikulate` then the ./build/bin/artikulate runs successfully without any SegFault. It's as if it wants .so s to be in /usr/lib/x86_64-linux-gnu/artikulate and /usr/lib/x86_64-linux-gnu/qt5/plugins/artikulate/ completely ignoring the identical .so s in ./build/bin/
Comment 6 Avinash Sonawane 2020-07-23 05:39:29 UTC
PS - FWIW, I built gcompris and parley successfully using above exact workflow without any Qt plugin path issue.
Comment 7 Avinash Sonawane 2021-03-22 11:01:40 UTC
As suggested by Andreas, I solved this by setting QT_PLUGIN_PATH variable.

I installed Artikulate at $PREFIX (since I didn't want to overwrite the artikulate from distro repo) and then supplied the appropriate value to QT_PLUGIN_PATH.

Steps:
$ mkdir build; cd build
$ cmake -DCMAKE_INSTALL_PREFIX=$PREFIX ..
$ make -j4; make install
$ QT_PLUGIN_PATH=$PREFIX/lib/x86_64-linux-gnu/plugins $PREFIX/bin/artikulate

Thanks for the help!