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

new gjs version causes crashes #1073

Closed
gituser23234235234887 opened this issue Sep 8, 2023 · 17 comments
Closed

new gjs version causes crashes #1073

gituser23234235234887 opened this issue Sep 8, 2023 · 17 comments
Labels
bug Something isn't working

Comments

@gituser23234235234887
Copy link

Describe the bug
in less than a minute, foliate crashes after updating gjs and libgjs0g

To Reproduce
update gjs and libgjs0g to jammy-updates repo version instead of jammy repo
jammy-updates repo version is 1.72.4
jammy repo version is 1.72.0-1

Version:

  • Foliate version: 2.6.4-1
  • OS/Distribution and version: kubuntu jammy
  • Desktop environment: kde 5
  • Installation method: apt

Additional context
if you all see gjs and libgjs0g have been kept back for weeks, just leave them be.

@gituser23234235234887 gituser23234235234887 added the bug Something isn't working label Sep 8, 2023
@gituser23234235234887
Copy link
Author

gituser23234235234887 commented Sep 8, 2023

I ran foliate through konsole, this is the error code I got
***MEMORY-ERROR***: com.github.johnfactotum.Foliate[58603]: GSlice: assertion failed: sinfo->n_allocated > 0
the gui crash notifier says that gjs console ran out of memory

@johnfactotum
Copy link
Owner

Closing as obsolete with the release of the GTK 4 version. Feel free to open new issues if you have problems with the new version.

@johnfactotum johnfactotum closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2023
@a-pav
Copy link

a-pav commented Nov 15, 2023

Closing as obsolete with the release of the GTK 4 version. Feel free to open new issues if you have problems with the new version.

Should we wait for an installable .deb file or that's not coming anymore?

@johnfactotum
Copy link
Owner

You can download them from this PPA: https://launchpad.net/~apandada1/+archive/ubuntu/foliate. Note that any .deb package of Foliate would require Ubuntu 23.10 or newer.

@a-pav
Copy link

a-pav commented Nov 15, 2023

That... is unfortunate! I have to stick with Foliate 2.6.4 for the time being then.

In the meantime, I'm getting the same Memory Error with Foliate 2.6.4 on Ubuntu 22.04 (Linux Mint).

Though using G_SLICE=always-malloc com.github.johnfactotum.Foliate seems to be a working solution for now. It' been running for a few minutes and I skimmed through some chapters and images without Foliate crashing.

But can you tell what G_SLICE=always-malloc exactly does? Is it safe to use?

@johnfactotum
Copy link
Owner

Maybe. I have no idea.

@mars4science
Copy link

@a-pav,

But can you tell what G_SLICE=always-malloc exactly does? Is it safe to use?

I've recently got same issue and found https://bugs.launchpad.net/ubuntu/+source/evolution/+bug/1169694 where it is suggested to run gdb to find the cause, but I could not make gdb run Foliate.

https://developer-old.gnome.org/glib/stable/glib-Memory-Slices.html
https://developer-old.gnome.org/glib/stable/glib-running.html#G_SLICE

This will cause all slices allocated through g_slice_alloc() and released by g_slice_free1() to be actually allocated via direct calls to g_malloc() and g_free().

@a-pav
Copy link

a-pav commented Nov 28, 2023

I also found and read those docs after my last reply. I wasn't satisfied with the results, overall.
The memory foliate consumed seemed to be too high to be acceptable, although I don't remember the exact number.

@iconoclasthero
Copy link

iconoclasthero commented Dec 5, 2023

I just tried to build 3.0.1 on 22.04 as I'm waiting for 24.04 to upgrade this machine (not doing non-LTS releases ever again!).

As you can see it doesn't seem to think that I have a cromulent version of gjs installed despite the appearance of 1.72.4 > 1.0.

$ gjs --version; which gjs; meson setup build --prefix=/usr; apt show gjs
gjs 1.72.4
/usr/bin/gjs
/bin/gjs
The Meson build system
Version: 0.61.2
Source dir: /home/bvargo/bin/gits/foliate
Build dir: /home/bvargo/bin/gits/foliate/build
Build type: native build
Project name: com.github.johnfactotum.Foliate
Project version: 3.0.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Found CMake: /usr/bin/cmake (3.22.1)
Run-time dependency gjs-1.0 found: NO (tried pkgconfig and cmake)

meson.build:9:0: ERROR: Dependency "gjs-1.0" not found, tried pkgconfig and cmake

A full log can be found at ~/bin/gits/foliate/build/meson-logs/meson-log.txt
Package: gjs
Version: 1.72.4-0ubuntu0.22.04.1
.
.
.

Here's that log:

Build started at 2023-12-05T12:28:21.693939
Main binary: /usr/bin/python3
Build Options: -Dprefix=/usr
Python system: Linux
The Meson build system
Version: 0.61.2
Source dir: ~/bin/gits/foliate
Build dir: ~/bin/gits/foliate/build
Build type: native build
Project name: com.github.johnfactotum.Foliate
Project version: 3.0.1
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Pkg-config binary for 1 is not cached.
Pkg-config binary missing from cross or native file, or env var undefined.
Trying a default Pkg-config fallback at pkg-config
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Determining dependency 'gjs-1.0' with pkg-config executable '/usr/bin/pkg-config'
env[PKG_CONFIG_PATH]:
Called `/usr/bin/pkg-config --modversion gjs-1.0` -> 1

CMake binary for 1 is not cached
CMake binary missing from cross or native file, or env var undefined.
Trying a default CMake fallback at cmake
Found CMake: /usr/bin/cmake (3.22.1)
Extracting basic cmake information
Try CMake generator: auto
Calling CMake (['/usr/bin/cmake']) in ~/bin/gits/foliate/build/meson-private/cmake_gjs-1.0 with:
  - "--trace-expand"
  - "--trace-format=json-v1"
  - "--no-warn-unused-cli"
  - "--trace-redirect=cmake_trace.txt"
  - "-DCMAKE_TOOLCHAIN_FILE=~/bin/gits/foliate/build/meson-private/cmake_gjs-1.0/CMakeMesonToolchainFile.cmake"
  - "."
  -- Module search paths:    ['/', '/opt', '/usr', '/usr/local']
  -- CMake root:             /usr/share/cmake-3.22
  -- CMake architectures:    ['x86_64-linux-gnu']
  -- CMake lib search paths: ['lib', 'lib32', 'lib64', 'libx32', 'share', 'lib/x86_64-linux-gnu']
Preliminary CMake check failed. Aborting.
Run-time dependency gjs-1.0 found: NO (tried pkgconfig and cmake)

meson.build:9:0: ERROR: Dependency "gjs-1.0" not found, tried pkgconfig and cmake

@johnfactotum
Copy link
Owner

The minimum GJS version is 1.76. I think the 1.0 in gjs-1.0 refers to the API version.

@iconoclasthero
Copy link

Did I miss that in the README.md? If not, perhaps you might include that?

@iconoclasthero
Copy link

iconoclasthero commented Dec 5, 2023

The minimum GJS version is 1.76. I think the 1.0 in gjs-1.0 refers to the API version.

As I'm sure you've already surmised, that's not going to work until ubuntu is upgraded. I just borked my system over the weekend and so if whatever I did to try to get that version of GJS installed on my system breaks it, oh well... i still have the flash drive handy.

@johnfactotum
Copy link
Owner

Yes, the minimum version is documented in the readme.

It does not mention the API version in the readme as it's implied by the package version. The API version is usually identical to the major version, i.e. the first number in the version string. (The exception is WebKitGTK, which can have multiple API versions for the same version.)

I think (though I'm not entirely sure) the - before the version number is a convention that is meant to tell you that the version is not considered part of the real name of the package. When there's no - before the number, it means that you can install them in parallel (e.g. gtk3, gtk4, not gtk-3, gtk-4). (Again the exception is WebKitGTK: Debian and Arch Linux both package it with -6.0 in the package name. But note that in Fedora it's not webkitgtk-6.0 but webkitgtk6.0, which makes more sense.)

Maybe it would be better to just remove the version checks in Meson. Those were added purely to stop people from assuming that they have met the minimum requirements. But apparently it didn't really accomplish that. And although Meson reports them as run time dependencies, you have to install them at build time, which makes no sense.

I don't know why it says "not found", though. If you have older versions of GJS with the same API version, I would expect it to say that it is found but does not meet the version requirement.

@iconoclasthero
Copy link

So here's why I'm here: In my opinion, the most complete and capable Linux ebook reader is Calibre but it leaves a lot to be desired in terms of UX. I would prefer not to look at it–ever. (I didn't even bother to seriously consider using it for a backend server and went with Kativa instead). Since I really don't read ebooks, I just want something light-weight that I can search for what I'm listening to on audio, look at end- and footnotes, references, etc., Part of my definition of light-weight is not an appimage/flatpack/snap.

I didn't think to really look for it, but gnome-books might be a solution if it would actually work on my laptop (new 22.04 install as of 3 days ago); would use directories other than ~/Documents; would follow symlinks in ~/Documents; and was still actively being developed (no activity for at least a year).

So after all that, I'm back to where I was a week ago: foliate fits my requirements (if I can get a .deb/build) and I'd nominate it to replace gnome-books if that's been abandoned.

@iconoclasthero
Copy link

iconoclasthero commented Dec 6, 2023

Let me ask another question: Do you have an older source version that I can compile on 22.04 and basically just lets me $ foliate ebook\ name.epub to look and search the book? Other features might be useful, but that's all I need...
Otherwise, the space for the snap isn't going to kill me and I'll just wait a few months for 24.04 beta to install the .deb.

I just installed the .deb from https://github.com/johnfactotum/foliate/releases/tag/2.6.3 and unless there's some reaon that that is a problem (e.g., insecure), that solves my issue 'till 24.04.

Hmmm... just crashed with the gjs error. So I take it that means I'd need to downgrade gjs. :(

@johnfactotum
Copy link
Owner

I just want something light-weight that I can search for what I'm listening to on audio, look at end- and footnotes, references, etc.

You could consider using an online viewer such as https://github.com/pgaskin/ePubViewer.

foliate-js has an online demo viewer also: https://johnfactotum.github.io/foliate-js/reader.html. Compared to the EPUB viewer above it can open more formats, but it doesn't support searching in the book (well, you can run reader.view.search in the console but that's obviously not great for normal use).

Hmmm... just crashed with the gjs error. So I take it that means I'd need to downgrade gjs. :(

You could try the workaround mentioned above.

Just an idea, but you can also try the 1.x versions.

@iconoclasthero
Copy link

Thanks for all your help. Foliate really fills a need as described or I wouldn't be spending the time on it. I'm just going to install the snap and satisfice on that until April.

Thanks again for the support and for Foliate.

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

No branches or pull requests

5 participants