Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#58124 - [atril] Atril chrashes on PDF.

Attached to Project: Community Packages
Opened by Eivind (mokkurkalve) - Thursday, 05 April 2018, 11:24 GMT
Last edited by Antonio Rojas (arojas) - Sunday, 14 July 2019, 14:30 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Brad Fanella (cesura)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Atril now crashes whenever I try to open a PDF file. I don't know when this started, but not so long ago. It crashes thus:

atril example.pdf
Inconsistency detected by ld.so: ../sysdeps/x86_64/dl-machine.h: 540: elf_machine_rela_relative: Assertion `ELFW(R_TYPE) (reloc->r_info) == R_X86_64_RELATIVE' failed!

Additional info:
* package version(s)
atril 1.20.0-1

* config and/or log files etc.

Steps to reproduce:

Try open a PDF file with atril from command line.
This task depends upon

Closed by  Antonio Rojas (arojas)
Sunday, 14 July 2019, 14:30 GMT
Reason for closing:  Fixed
Comment by Eivind (mokkurkalve) - Friday, 06 April 2018, 12:41 GMT
This is another error message:
FATAL: Could not allocate gigacage memory with maxAlignment = 34359738368, totalSize = 120259084288.

All PDF's behave like this with atril now. They open OK in mupdf and others.

Comment by Brad Fanella (cesura) - Wednesday, 11 April 2018, 01:00 GMT
I've just pushed the newest version of atril (1.20.1) to the repos a few minutes ago, and I can't reproduce it there. Does this update seem to solve your issue?
Comment by Eivind (mokkurkalve) - Wednesday, 11 April 2018, 10:33 GMT
OK. No, the update itself changed nothing, but I found a cause.

Trying to start atril with or without file argument:

FATAL: Could not allocate gigacage memory with maxAlignment = 34359738368, totalSize = 103079215104.
(Make sure you have not set a virtual memory limit.)
Memory segment error (kernel stored in file)

This shows up in logs:

kernel: atril[1127]: segfault at bbadbeef ip 00007f0a810cdede sp 00007ffefa4ca5f0 error 6 in libjavascriptcoregtk-4.0.so.18.7.9[7f0a80233000+10a6000]

However I investigated the thing about virtual memory and found I had these sysctl's set (among others):

vm.overcommit_ratio = 99
vm.overcommit_memory = 2

I commented these two out (reverted to default) and atril started working again. So as such the issue is solved.
I have 16 GB RAM installed. I am not sure atril should behave like this. It didn't until quite recently and nothing else does. (I've had these sysctl's set forever with no negative impact until this.)
However I guess that's maybe out of scope of this bug report and that it as such can be closed.
But if somebody wise can shed some light on this I'll be grateful....

BTW:
/usr/lib/libjavascriptcoregtk-4.0.so.18.7.9 is owned by webkit2gtk 2.20.1-1



Comment by Eivind (mokkurkalve) - Monday, 16 April 2018, 14:09 GMT
Actually I have 16 GB installed RAM and a 18 GB swap partition (only to be safe there's enough swap for hibernation).
To me it seems that atril tries to pre-allocate too much RAM and segfaults when it is not permitted to do that.
I would call that a bug. Especially as no other program currently on my system behaves like this.
But that's maybe a different bug than what I opened. I'll leave it up to you to decide.
Comment by Frederic Hamel (frederic) - Thursday, 19 April 2018, 20:53 GMT
Most likely a bug on my machine atril 1.20.1-1 with webkit2gtk 2.20.1-1 does crash with a SEGFAULT.
I used strace on it and found out that there was a mmap of 128GB of RAM. My machine only has 6GB.

> strace atril
...
mmap(NULL, 137438953472, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = -1 ENOMEM (Cannot allocate memory)
write(2, "FATAL: Could not allocate gigaca"..., 101FATAL: Could not allocate gigacage memory with maxAlignment = 34359738368, totalSize = 103079215104.
) = 101
write(2, "(Make sure you have not set a vi"..., 53(Make sure you have not set a virtual memory limit.)
) = 53
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xbbadbeef} ---
+++ killed by SIGSEGV (core dumped) +++

zenity has the same problem. It seems to be libjavascriptcore related.
Comment by Frederic Hamel (frederic) - Monday, 23 April 2018, 13:24 GMT Comment by Eivind (mokkurkalve) - Tuesday, 12 June 2018, 13:13 GMT
This issue is solved with webkit2gtk 2.20.3-1
https://webkitgtk.org/2018/06/11/webkitgtk2.20.3-released.html
- Disable Gigacage if mmap fails to allocate in Linux.

Loading...