flathub / com.calibre_ebook.calibre

https://flathub.org/apps/details/com.calibre_ebook.calibre
13 stars 13 forks source link

*** stack smashing detected *** terminated #195

Closed MikeNavy closed 10 months ago

MikeNavy commented 1 year ago

Hi,

Using Calibre flatpak, version 6.27, I get a systematic error at launch: " stack smashing detected terminated". Calibre flatpak cannot be used any longer.

The command "flatpak repair" or uninstalling Calibre flatpak and reinstalling it does not change the result.

Operating system: Linux Mint 20.3 Mate based on Ubuntu 20.04 Flatpak version: 1.14.4

Note that I don't get this error with Calibre 6.27 for Linux, downloaded from Calibre website with: sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin

Regards,

MN

strch commented 11 months ago

Same for me on Linux Mint 21.2 based on Ubuntu 22.04, Flatpak version: 1.12.7.

My current workaround is downgrading Calibre and prevent updates until this issue is resolved:

sudo flatpak update --commit=a3aabcd6e779969d4243dab282c064c3aa4397ca96f93561fda7c25c1ff046fb com.calibre_ebook.calibre
sudo flatpak mask com.calibre_ebook.calibre

I haven't yet bisected the Calibre flatpak revisions in order to identify the change that causes this issue. Though, my best guess would be the recent update of the org.freedesktop.Platform (commit ceaccd507d09824fad099c4cb22b03a5d7e2bc53 in this repo).

Would love to see this issue being fixed soon.

Erick555 commented 11 months ago

You can try flatpak run --runtime=org.freedesktop.Platform//22.08 --command=sh com.calibre_ebook.calibre to test if switching runtimes has difference.

Does it still crash when you temporarily rename ~/.var/app/com.calibre_ebook.calibre to ~/.var/app/com.calibre_ebook.calibre-old and run again with fresh profile?

MikeNavy commented 11 months ago

Hi,

First test, com.calibre_ebook.calibre 6.28.1, org.freedesktop.Platform 23.08, fresh install (no "~/.var/app/com.calibre_ebook.calibre"):

$ flatpak run com.calibre_ebook.calibre
*** stack smashing detected ***: terminated

Second test:

flatpak run --runtime=org.freedesktop.Platform//22.08 --command=sh com.calibre_ebook.calibre
[📦 com.calibre_ebook.calibre ~]$ 

Third test:

$ flatpak run --runtime=org.freedesktop.Platform//22.08 com.calibre_ebook.calibre

Calibre is launched: image

So, it seems that Calibre failure to launch is related to org.freedesktop.Platform 23.08.

Regards,

MN

PS: launching Calibre with org.freedesktop.Platform 23.08 is not really a workaround, since all the links launched from running Calibre don't work (e-book reader, e-book editor, LRF viewer...)

Erick555 commented 11 months ago

You may report this to calibre upstream.

MikeNavy commented 11 months ago

You may report this to calibre upstream.

Hi, Calibre is not involved in the flatpak version, and the bug does not exist with the standard Linux version, the one you download and install with: sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin. (I use now the 6.28.1 version, downloaded and installed that way, and it works). So, reporting the bug to upstream calibre is not a solution: they are not concerned.

The bug concerns the flatpak version, when used with "org.freedesktop.Platform 23.08"; it is not there with "org.freedesktop.Platform 22.08". Googling for "*** stack smashing detected *** terminated" flatpak shows a recent similar result, see https://github.com/flyinghead/flycast/issues/1199 --> same issue with Flycast flatpak, and a mention of Xemu flatpak. The error " stack smashing detected terminated" is generally considered as a buffer overflow, for programs compiled with GCC. Since several programs are involved, the bug is probably in "org.freedesktop.Platform 23.08" runtime, not in the programs themselves. It should so be reported to "org.freedesktop.Platform 23.08" developers, though I don't know who they are and how to reach them. @Erick555 can you report this bug or tell how to do?

Waiting for the bug to be corrected, workarounds for Calibre flatpak could be:

Regards,

MN

ghisvail commented 11 months ago

Works fine on my machines (Debian 12 / Ubuntu 23) with the current runtime.

I wonder whether runtime version 23.08 introduced incompatibilities with old releases of Ubuntu?

MikeNavy commented 11 months ago

Hi,

I use the latest stable flatpak framework version, 1.14.4, available for Linux Mint / Ubuntu from flatpak stable PPA. User strch has the problem with Linux Mint 21.2, based on Ubuntu 22.04 LTS and with flatpak version 1.12.7. So, two different Ubuntu versions, 20.04 and 22.04, two different flatpak versions, 1.14.4 and 1.12.7. Also, I have confirmed the bug with two different Calibre versions, 6.27.0 and 6.28.1. And the bug is not there with freedesktop 22.08 and with Calibre installed using Linux installer ("official" way). Freedesktop 23.08 is the origin of the bug, and the bug is not a systematic one, since Ghislain does not see it... Just more complicated to identify and solve.

MN

Le 17 oct. 2023 à 13:47, Ghislain Vaillant @.***> a écrit :  Works fine on my machine with the current runtime.

I wonder whether runtime version 23.08 introduced incompatibilities with old releases of Ubuntu? Ubuntu 20.04 / Linux Mint 20.3 may be considered quite old by Flatpak standards?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

Erick555 commented 11 months ago

I don't see this bug either. Calibre flatpak has hundreds installs daily and this bug seems to occur only on specific systems (Linux Mint so far).

The error " stack smashing detected terminated" is generally considered as a buffer overflow, for programs compiled with GCC.

Calibre flatpak is just repacking upstream binaries build with upstream gcc. It isn't build with gcc from freedresktop 23.08.

The reported error is cryptic. Here's some guide how to debug it but calibre upstream strips debug symbols from binaries so nobody here is in the position to offer any help which is why I proposed asking upstream.

Erick555 commented 10 months ago

This is related to old nvidia drivers, not an app issue - it could be closed here.

MikeNavy commented 10 months ago

Hi, Closed. Issue is related to Nvidia driver and runtime. See https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/issues/1676.

Regards,

MN