Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault after OS update #196

Closed
wokawoka opened this issue Oct 28, 2020 · 49 comments
Closed

Segmentation fault after OS update #196

wokawoka opened this issue Oct 28, 2020 · 49 comments
Labels
bug Something isn't working

Comments

@wokawoka
Copy link

Bug description
Yesterday I upgraded my Pop Os installation from 20.04 to 20.10 and, since then, crow refuses to start. Translating with crow from the command line correctly works.
I did try to remove the crow config file and also launch it in a clean environment ( $ env -i XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR DISPLAY=$DISPLAY crow ) as suggested in this old issue #154 but in all cases I still get the same segmentation fault.
Other QT apps regularly work.
Any hint about how to solve this problem? Thank you very much!

Steps to reproduce

$ crow
Segmentation fault (core dumped)

Expected behavior
Crow interface runs normally like it always did

Environment

  • OS: Pop Os 20.10
  • Desktop environment: KDE 5.19.5
  • Crow Translate version: 2.6.0
@wokawoka wokawoka added the bug Something isn't working label Oct 28, 2020
@Shatur
Copy link
Member

Shatur commented Oct 28, 2020

Are you using Wayland after updating to 20.10?

@wokawoka
Copy link
Author

No, I'm still on Xorg

@Shatur
Copy link
Member

Shatur commented Oct 28, 2020

Hm... Very strange. Could you try to build Crow manually from scratch and launch in debugger?

You need to install QtCreator (sudo apt install qtcreator), clone this repo (git clone https://github.com/crow-translate/crow-translate.git), open project in QtCreator and press F5.

@wokawoka
Copy link
Author

wokawoka commented Oct 28, 2020

Thank you very much for replying.
I'm not familiar with QT building... Which of the many files in the repo should I open in QtCreator in order to open the project?
Thank you for your patience and for the extremely useful work you are doing with crow translate!

@Shatur
Copy link
Member

Shatur commented Oct 28, 2020

I'm not familiar with QT building... Which of the many files in the repo should I open in QtCreator in order to open the project?

Feel free to ask me any questions about it.
Open QCreator, navigate to File->Open File or Project. Then select CMakeLists.txt file from the root of the repo. And then press F5.

Thank you for your patience and for the extremely work you are doing with crow translate!

No problem, always happy to help :)

@wokawoka
Copy link
Author

wokawoka commented Oct 28, 2020

This is the output that comes out in the General Messages section as soon as I load the CMakeLists.txt file (without the need to press F5):

Running /usr/bin/cmake -S /home/looka/Downloads/crow/crow-translate -B /tmp/QtCreator-mpyCtu/qtc-cmake-wjYNJdPU '-GUnix Makefiles' -DCMAKE_BUILD_TYPE:String=Debug -DQT_QMAKE_EXECUTABLE:STRING=/usr/lib/qt5/bin/qmake -DCMAKE_PREFIX_PATH:STRING=/usr -DCMAKE_C_COMPILER:STRING=/usr/bin/gcc -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++ in /tmp/QtCreator-mpyCtu/qtc-cmake-wjYNJdPU.
-- The CXX compiler identification is GNU 10.2.0
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find Tesseract (missing: Tesseract_LIBRARY Tesseract_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindTesseract.cmake:25 (find_package_handle_standard_args)
  CMakeLists.txt:48 (find_package)


-- Configuring incomplete, errors occurred!
See also "/tmp/QtCreator-mpyCtu/qtc-cmake-wjYNJdPU/CMakeFiles/CMakeOutput.log".
CMake process exited with exit code 1.
Elapsed time: 00:01.

@Shatur
Copy link
Member

Shatur commented Oct 28, 2020

CMake cannot find Tesseract library. Let's install the dependencies: sudo apt-get install extra-cmake-modules libqt5x11extras5-dev qttools5-dev qtmultimedia5-dev libtesseract-dev

@wokawoka
Copy link
Author

wokawoka commented Oct 28, 2020

Thank you.
Unfortunately I'm getting the same segmentation fault also in Qt Creator

The inferior stopped because it received a signal from the operating system.
Signal name : | SIGSEGV
Signal meaning : | Segmentation fault

@Shatur
Copy link
Member

Shatur commented Oct 28, 2020

It's okay, could you show me QtCreator screenshot with the segfault?

@wokawoka
Copy link
Author

Sure

image

@Shatur
Copy link
Member

Shatur commented Oct 28, 2020

Could you scroll to the beginning?
изображение

@wokawoka
Copy link
Author

Thanks

image

@Shatur
Copy link
Member

Shatur commented Oct 28, 2020

QMediaPlayer? Hm...

Could you click on <More>?

@wokawoka
Copy link
Author

yeah, I did't notice it

image

@Shatur
Copy link
Member

Shatur commented Oct 28, 2020

Thanks. it looks like this is not the application issue.
You cannot create a new instance of QMediaPlayer. I'm pretty sure that if you run a program that uses it, you'll have the same problem. Could you try to install packages that can be related to the Qt Multimedia module? I think you are missing the runtime dependency.

@wokawoka
Copy link
Author

wokawoka commented Oct 28, 2020

I did try to look for qt multimedia packages but they seem to be already installed. Strange, crow translate was perfectly working before the OS update yesterday .
Is QMediaPlayer used by crow for text to speech functions?

libqt5multimedia5-plugins is already the newest version (5.14.2-3).
qml-module-qtmultimedia is already the newest version (5.14.2-3).

@Shatur
Copy link
Member

Shatur commented Oct 28, 2020

Is QMediaPlayer used by crow for text to speech functions?

Yes.

Maybe you missing gstreamer plugins (QMediaPlayer use them internally)?

@wokawoka
Copy link
Author

I did try to install every single gstreamer plugin package I could find in the repo but they all were already installed.
I'll wait and see if someone will come out with a solution after having experienced the same problem or I'll evaluate the idea of a clean reinstallation.
In the meanwhile I will miss crow translate a lot.
Thank you very much for the very useful job you are doing

@Shatur
Copy link
Member

Shatur commented Oct 28, 2020

I did try to install every single gstreamer plugin package I could find in the repo but they all were already installed.

Strange... I am using ArchLinux so I have latest versions of all packages. Therefore the problem can't be in library update. I think the problem is either in the system configuration or in the installed packages.

Thank you very much for the very useful job you are doing

You are welcome :)

@wokawoka
Copy link
Author

I've noticed an error in Qt5 Configuration Tool.
It's showing this error "The QT_QPA_PLATFORMTHEME environment variable is not set (required value: qt5ct)." which I'm not sure was there before the OS upgrade.
I don't know if this last error could be related to my problem with crow translate. If so, then the QMediaPlayer problem should be a minor issue and not the root cause, or am I wrong?

image

@Shatur
Copy link
Member

Shatur commented Oct 28, 2020

Worth a try. Set QT_QPA_PLATFORMTHEME to qt5ct.

@wokawoka
Copy link
Author

Unfortunately setting QT_QPA_PLATFORMTHEME=qt5ct strangely introduced a lot of visual artifacts but didn't solve the segmentation fault.

I just hope that the package updates in the following period will fix the qmediaplayer problem

@hiddenman
Copy link

Hi,

Just upgraded Ubuntu 20.04 to 20.10 and got mostly the same problem in the KDE DE. Crow doesn't even start.

I'm attaching the strace.log, not sure if it helpful.

Thank you.
strace.log

@Shatur
Copy link
Member

Shatur commented Nov 10, 2020

@wokawoka even built the project from source and got the same thing. So, the problem not in the compiled binary.
Maybe the problem in missing dependency?

@Shatur
Copy link
Member

Shatur commented Nov 10, 2020

@hiddenman, could you install qtgstreamer-plugins-qt5 gstreamer1.0-plugins-good gstreamer1.0-alsa gstreamer1.0-pulseaudio libqt5multimedia5-plugins?

@yura04
Copy link

yura04 commented Nov 10, 2020

Similar behavior at Debian 10 xfce
Updated from 2.5.1 to 2.6.0

image

#196 (comment) installed new packages but didn't help

Feel free to ask for additional information

@hiddenman
Copy link

@hiddenman, could you install qtgstreamer-plugins-qt5 gstreamer1.0-plugins-good gstreamer1.0-alsa gstreamer1.0-pulseaudio libqt5multimedia5-plugins?

Hi,

They are already installed:

gstreamer1.0-alsa is already the newest version (1.18.0-2).
gstreamer1.0-plugins-good is already the newest version (1.18.0-1ubuntu1).
gstreamer1.0-pulseaudio is already the newest version (1.18.0-1ubuntu1).
libqt5multimedia5-plugins is already the newest version (5.14.2-3).
qtgstreamer-plugins-qt5 is already the newest version (1.2.0-5ubuntu1).

@Shatur
Copy link
Member

Shatur commented Nov 10, 2020

@yura04, I think that this is another issue. Try to run in clean environment:

env -i XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR DISPLAY=$DISPLAY crow

@hiddenman, strange, at the moment I do not know what this may be connected with :(
I will try to reproduce on Live image later.

@hiddenman
Copy link

@yura04, I think that this is another issue. Try to run in clean environment:

@hiddenman, strange, at the moment I do not know what this may be connected with :(
I will try to reproduce on Live image later.

Neither do i :( I even tried to remove the config - didn't help.

@Shatur
Copy link
Member

Shatur commented Nov 10, 2020

I tried Ubuntu 20.10 and Kubuntu 20.10 live images and Crow works from PPA and from the releases page.

@Shatur Shatur pinned this issue Nov 10, 2020
@yura04
Copy link

yura04 commented Nov 10, 2020

it works with this output in the terminal

image

There're also missing icons
image

@Shatur
Copy link
Member

Shatur commented Nov 10, 2020

@yura04, It starts in clean environment, so this means that the issue in your system configuration and not related to the app. To enable icons you need to set either QT_QPA_PLATFORMTHEME=gtk2 or QT_QPA_PLATFORMTHEME=qt5ct (if you have qt5ct configured and installed) environment variables.

@hiddenman
Copy link

I tried Ubuntu 20.10 and Kubuntu 20.10 live images and Crow works from PPA and from the releases page.

If i run it as:
sudo -u another_user crow
then it works (however, without icons as in the message above). So i suppose it's related to the theme or KDE/gstreamer settings somehow.

@hiddenman
Copy link

@hiddenman, could you install qtgstreamer-plugins-qt5 gstreamer1.0-plugins-good gstreamer1.0-alsa gstreamer1.0-pulseaudio libqt5multimedia5-plugins?

Btw, this in the dmesg:

crow[3376]: segfault at 0 ip 00007f9c5fa8abc5 sp 00007ffc666aa800 error 4 in iHD_drv_video.so[7f9c5f971000+348000]

@hiddenman
Copy link

@Shatur95 It's definitely related to the gstreamer. For example, when i delete ~/.cache/gstreamer-1.0 and then launch the "crow", it takes some time to regenerate the cache and then it again fails.
Btw, it fails in this call:

_ZN12QMediaPlayerC1EP7QObject6QFlagsINS_4FlagEE(0x55f8dcfd5e20, 0, 0, 0x55f8dcfe4b40 <no return ...>

Not sure how to debug/configure the gstreamer nowadays. Tried to remove bad/ugly plugins - didn't help.

@Shatur
Copy link
Member

Shatur commented Nov 22, 2020

@hiddenman, yeah, it's related to the gstreamer that used by QMediaPlayer. But I can't do anything about it :(
The problem is in gstreamer / Qt bug that caused by the system configuration. Try to debug which setting causes the issue.

@hiddenman
Copy link

@hiddenman, yeah, it's related to the gstreamer that used by QMediaPlayer. But I can't do anything about it :(
The problem is in gstreamer / Qt bug that caused by the system configuration. Try to debug which setting causes the issue.

I even tried to remove all dconf settings - didn't help. Not sure where it stored its settings, so many places nowadays.

@Shatur
Copy link
Member

Shatur commented Nov 22, 2020

I would create a new user and start copying the settings from the home folder to it.

@batikanor
Copy link

batikanor commented Dec 4, 2020

Same problem for me. Purged and re-installed it multiple times but no good.


$ crow -> 
Segmentation fault (core dumped)

$ sudo crow ->
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
error: XDG_RUNTIME_DIR not set in the environment.
Segmentation fault

$env -i XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR DISPLAY=$DISPLAY crow
Segmentation fault (core dumped)

$sudo env -i XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR DISPLAY=$DISPLAY crow
No protocol specified
qt.qpa.xcb: could not connect to display :1
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted



segfault at 0 ip 00007fe38c9b4bc5 sp 00007ffe240f3fd0 error 4 in iHD_drv_video.so[7fe38c89b000+348000]

@Shatur
Copy link
Member

Shatur commented Dec 4, 2020

@batikanor, the issue with your system configuration. Try to run as a new user.

@hiddenman
Copy link

@Shatur95 Hi, Still trying to find the root cause. Playing with config files didn't help at all. I tried to copy everything.
Looks like it's related to the DRI somehow.

Found this post:
https://askubuntu.com/questions/1287450/viber-executable-crashes-on-ubuntu-20-10

Viber crashes with exactly the same error for this guy:

Oct 27 19:04:42 xxx kernel: [ 3782.065767] Viber[25573]: segfault at 0 ip 00007ff5e4804bc5 sp 00007fff2e7dc3b0 error 4 in iHD_drv_video.so[7ff5e46eb000+348000]

I always have this:

crow[3518687]: segfault at 0 ip 00007fa2585bbbc5 sp 00007fffe39a8d90 error 4 in iHD_drv_video.so[7fa2584a2000+348000]

Not sure how to debug it further.

@hiddenman
Copy link

@Shatur95 Just found a workaround:

LIBVA_DRIVER_NAME=vdpau crow

That helps and crow works.

These are possible values (from ArchLinux wiki):

Intel graphics:

  • For libva-intel-driver use i965.
  • For intel-media-driver use iHD.

NVIDIA:

  • For Nouveau use nouveau.
  • For NVIDIA use vdpau.

ATI/AMD:

  • For AMDGPU driver use radeonsi.
  • For AMD Catalyst use fglrx.

@Shatur
Copy link
Member

Shatur commented Dec 7, 2020

Nice to hear! But it's really strange that it requires manual intervention after the OS update.

@wokawoka
Copy link
Author

wokawoka commented Dec 7, 2020

I confirm that this solution works!
The strange thing is here crow starts with any of the above values:
LIBVA_DRIVER_NAME=vdpau crow
LIBVA_DRIVER_NAME=i965 crow
LIBVA_DRIVER_NAME=ihd crow
LIBVA_DRIVER_NAME=noveau crow
they all launch crow correclty without any difference.

with just "crow" via command line I just continue to get:
Segmentation fault (core dumped)

@Shatur95 Just found a workaround:

LIBVA_DRIVER_NAME=vdpau crow

That helps and crow works.

These are possible values (from ArchLinux wiki):

Intel graphics:

* For libva-intel-driver use i965.

* For intel-media-driver use iHD.

NVIDIA:

* For Nouveau use nouveau.

* For NVIDIA use vdpau.

ATI/AMD:

* For AMDGPU driver use radeonsi.

* For AMD Catalyst use fglrx.

@ghost

This comment has been minimized.

@Shatur

This comment has been minimized.

@ghost

This comment has been minimized.

@Shatur

This comment has been minimized.

@Shatur
Copy link
Member

Shatur commented Apr 20, 2021

I believe that the issue can be closed, since nothing can be done from the Crow side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

5 participants