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

Crash when scrolling through PDF with sidebar open on Layer/Layerstack Preview #2887

Closed
nicolae-stroncea opened this issue Feb 28, 2021 · 4 comments · Fixed by #2955
Closed
Labels
bug confirmed Bug has been reproduced by at least one other person Crash priority::high regression This issue is about a regression from the previous release; or this PR fixes a regression.

Comments

@nicolae-stroncea
Copy link
Contributor

Affects versions :

  • OS: Linux
  • Desktop environment: Ubuntu 20.04, Gnome X11
  • libtk: libgtk: 3.24.20
  • Xournal version: Xournal++ 1.1.0+dev
  • Installation method: From source

To Reproduce

  1. Open PDF with X++.
  2. Open sidebar on Layer preview.
  3. Scroll through PDF. Note: It typically crashes within 1-10 seconds of continuous scrolling.
  4. X++ crashes.

Random PDF I found online to test on, but I think this problem occurs on any pdf.
Report_Writing_Process_principles_and_styles.pdf

Additional Details

  • I've gotten this crash many times in the past but this is the first time I was able to find a reproducible patern for it.
  • Don't think it occurs for 1.0.20
@rolandlo rolandlo added confirmed Bug has been reproduced by at least one other person priority::high labels Feb 28, 2021
@nicolae-stroncea
Copy link
Contributor Author

nicolae-stroncea commented Feb 28, 2021

Stack trace:

Date: Sat Feb 27 13:21:44 2021
Error: signal 11
[bt]: (0) xournalpp(+0x4311c2) [0x55d6e6d4e1c2]
[bt]: (1) /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7f60d4191210]
[bt]: (2) /lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_widget_queue_draw+0x32) [0x7f60d5288812]
[bt]: (3) xournalpp(+0x2addf3) [0x55d6e6bcadf3]
[bt]: (4) xournalpp(+0x2ae71e) [0x55d6e6bcb71e]
[bt]: (5) xournalpp(_ZNKSt8functionIFvvEEclEv+0x36) [0x55d6e6d58772]
[bt]: (6) xournalpp(+0x43af9d) [0x55d6e6d57f9d]
[bt]: (7) /lib/x86_64-linux-gnu/libgdk-3.so.0(+0x30f4d) [0x7f60d4e19f4d]
[bt]: (8) /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x14e) [0x7f60d56f0e6e]
[bt]: (9) /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x52220) [0x7f60d56f1220]
[bt]: (10) /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x33) [0x7f60d56f12c3]
[bt]: (11) /lib/x86_64-linux-gnu/libgio-2.0.so.0(g_application_run+0x205) [0x7f60d4b3cfd5]
[bt]: (12) xournalpp(_ZN11XournalMain3runEiPPc+0x5ef) [0x55d6e6bbdb12]
[bt]: (13) xournalpp(main+0x29) [0x55d6e6b7b2d2]
[bt]: (14) /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f60d41720b3]
[bt]: (15) xournalpp(_start+0x2e) [0x55d6e6b7b1ee]

Try to get a better stracktrace...
[bt] #1 xournalpp(+0x431734) [0x55d6e6d4e734]
??:0
[bt] #2 /lib/x86_64-linux-gnu/libc.so.6(+0x46210) [0x7f60d4191210]
??:0
[bt] #3 /lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_widget_queue_draw+0x32) [0x7f60d5288812]
??:0
[bt] #4 xournalpp(+0x2addf3) [0x55d6e6bcadf3]
??:0
[bt] #5 xournalpp(+0x2ae71e) [0x55d6e6bcb71e]
??:0
[bt] #6 xournalpp(_ZNKSt8functionIFvvEEclEv+0x36) [0x55d6e6d58772]
??:0
[bt] #7 xournalpp(+0x43af9d) [0x55d6e6d57f9d]
??:0
[bt] #8 /lib/x86_64-linux-gnu/libgdk-3.so.0(+0x30f4d) [0x7f60d4e19f4d]
??:0
[bt] #9 /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_dispatch+0x14e) [0x7f60d56f0e6e]
??:0
[bt] #10 /lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x52220) [0x7f60d56f1220]
??:0
[bt] #11 /lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_iteration+0x33) [0x7f60d56f12c3]
??:0
[bt] #12 /lib/x86_64-linux-gnu/libgio-2.0.so.0(g_application_run+0x205) [0x7f60d4b3cfd5]
??:0
[bt] #13 xournalpp(_ZN11XournalMain3runEiPPc+0x5ef) [0x55d6e6bbdb12]
??:0
[bt] #14 xournalpp(main+0x29) [0x55d6e6b7b2d2]
??:0
[bt] #15 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f60d41720b3]
??:0
[bt] #16 xournalpp(_start+0x2e) [0x55d6e6b7b1ee]
??:0

@nicolae-stroncea
Copy link
Contributor Author

Update: Layerstack preview in the sidebar has the same issue, though Page Preview does not.

@nicolae-stroncea nicolae-stroncea changed the title Crash when scrolling through PDF with sidebar open on Layer Preview Crash when scrolling through PDF with sidebar open on Layer/Layerstack Preview Feb 28, 2021
@Technius Technius added regression This issue is about a regression from the previous release; or this PR fixes a regression. Crash labels Mar 1, 2021
@Technius Technius added this to the v1.1.0 release milestone Mar 1, 2021
@personalizedrefrigerator
Copy link
Contributor

personalizedrefrigerator commented Mar 4, 2021

Additional information & backtrace

This is the backtrace I'm getting from GDB:
Backtrace from GDB

GDB says that the segfault is happening on the line highlighted below:
SEGFAULT in gtk_widget_queue_draw

This is where we're calling it:

ref();
Util::execInUiThread([=]() {
gtk_widget_queue_draw(this->sidebarPreview->widget);
// After the UI job is also done, it can be unreferenced

Adding an if (GTK_IS_WIDGET(this->sidebarPreview->widget)) { block that surrounds gtk_widget_queue_draw moves the segfault to the GTK_IS_WIDGET in the if test.

@personalizedrefrigerator
Copy link
Contributor

I'm working on a fix for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed Bug has been reproduced by at least one other person Crash priority::high regression This issue is about a regression from the previous release; or this PR fixes a regression.
Projects
None yet
4 participants