-
Notifications
You must be signed in to change notification settings - Fork 252
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
IOT instruction (core dumped). Assertion '__n < this->size()' failed. #1151
Comments
Can't reproduce the issue on linux. Some more information might help, e.g. what is your exact build process? (e.g. do you use the system's mupdf or the mupdf included in this repo?) |
I installed the sioyek-git package from aur, which I think uses the system mupdf. P.S. I'm using Manjaro Linux, which has |
Hello.
I hope this helps. P.S. I'm on Archlinux with self-compiled sioyek from git (https://git.sr.ht/~vp1981/pkgbuild/tree/master/item/sioyek/PKGBUILD). |
This is very weird. The crash seems to be caused in this line: sioyek/pdf_viewer/document.cpp Line 660 in 4015156
Document::count_chapter_pages_accum and see exactly what happens in that function?
|
It's something really weird. I built sioyek locally from git (with and without The package build host is almost the same as the one I tested the sioyek local build on, but it is only accessible via ssh. Another oddity is that the sioyek from the package is smaller than the local build, even after running
Also, when I compared
even though all necessary packages are present on the build host. So in my case there seems to be something wrong with the build host, I'll make a clean build host to try again. P.S. The |
I found a workaround to build a working package, but I don't know the real reason for the The Archlinux adds the When I build locally with
sioyek crashes. Remove this option and sioyek works fine. |
Unfortunately I can't reproduce the bug event with |
I encountered this same error with a pdf copy of CFR title 10 by the US NRC. The file is available as a zip archive from the official library at https://www.nrc.gov/reading-rm/doc-collections/cfr/index.html I am also using the latest sioyek-git from the AUR and I am running the latest Archlinux. I tried to build from source using build_linux.sh. Unfortunately, I am missing the "lcms2mt.h" header file for the mupdf build. At this point I'm out of my depth and cannot spare much time to learn more, but I wonder if this might have something to do with the size difference vp1981 reported. |
Does the issue happen with the preview release here: https://github.com/ahrm/sioyek/releases/tag/sioyek3-alpha0 (the current preview is incompatible with the previous sioyek |
https://aur.archlinux.org/packages/sioyek downloading from this aur package results in the same error on my system. going to try sioyek-git now before building from source. |
tried with sioyek-git and had the same issue. |
Did you try with the alpha release AppImage that I posted above? |
@tokisuno, P.S. I don't have time to figure out the cause right now, but I suspect the issue might be related to the mupdf library (Archlinux provides version 1.24.9), because |
@vp1981 The appimage seems to be working fine on my Desktop, but I have to try it on my laptop which has the issue. Is the MuPDF package in Arch ahead or behind what's packaged with sioyek? |
It was ahead, I have recently updated the mupdf in development branch to the same version though. |
thanks! build() {
cd sioyek
export CXXFLAGS="${CXXFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS/}"
qmake6 "CONFIG+=linux_app_image" pdf_viewer_build_config.pro
make
} I couldn't get it to work by passing it through and of course also a big thanks for sioyek @ahrm; best pdf viewer on linux without a doubt! edit: I use arch btw |
Someone referenced this issue in the sioyek/pdf_viewer/document.cpp Line 828 in 7637caa
loc.chapter is -1 . With -O2 there is some obvious stack smashing, e.g. the capacity of raw_page_count becomes unreasonably large.
|
diff --git a/pdf_viewer/document.cpp b/pdf_viewer/document.cpp
index a2c8239..2b804a8 100644
--- a/pdf_viewer/document.cpp
+++ b/pdf_viewer/document.cpp
@@ -825,7 +825,7 @@ void Document::convert_toc_tree(fz_outline* root, std::vector<TocNode*>& output)
if (root->page.page == -1) {
float xp, yp;
fz_location loc = fz_resolve_link(context, doc, root->uri, &xp, &yp);
- int chapter_page = accum_chapter_pages[loc.chapter];
+ int chapter_page = (loc.chapter >= 0 && loc.chapter < accum_chapter_pages.size()) ? accum_chapter_pages[loc.chapter] : 0;
current_node->page = chapter_page + loc.page;
}
else { seems to work fine. |
@hrdl-github Thanks for fixing! BTW, if you are the maintainer of the aur package, I think you forgot to delete line 31. |
With the latest development version, I cannot open the attached file, which can be opened normally with mupdf.
I get the following core dumped error under linux.
The text was updated successfully, but these errors were encountered: