rnote icon indicating copy to clipboard operation
rnote copied to clipboard

Regression: rnote 13.x crashes when opening the attached file as opposed to rnote 12.x which opens the file fine

Open Markus-included opened this issue 3 months ago • 30 comments

Describe the bug
As described in title

To Reproduce

gunzip the attachment and open the gunzipped file in rnote Hue.rnote.gz

Expected behavior
Document opens briefly, rnote crashes

Console Output
N/A

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Windows 10 and 11, Debian 13
  • App Version: Rnote v0.13.x
  • Installation Source: Windows Installer or Flatpak
  • Desktop Environment: GNOME
  • Display Server: X11
  • Input Source: N/A

Additional context
I'm reporting this on behalf of a friend who is trying to switch to linux and tried rnote for his math homework, suddenly rnote crashes, it seems to be something with the file

Markus-included avatar Sep 22 '25 19:09 Markus-included

I've tried opening this file on my Linux machine now and it seems to be that the file is corrupted, still weird that 12.x manages to open it

$ flatpak --env=RUST_LOG=rnote=debug --env=RUST_BACKTRACE=1 run com.github.flxzt.rnote
   0.000092487s DEBUG rnote: .. tracing subscriber initialized.
pci id for fd 10: 10de:134d, driver (null)
kmsro: driver missing
  61.893755592s ERROR rnote::appwindow: Opening file with dialogs failed, Err: loading RnoteFile from bytes failed.

Caused by:
    0: decompressing bytes failed.
    1: invalid gzip header

Stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: clone
  61.899858594s ERROR rnote::overlays: Datei öffnen gescheitert

Markus-included avatar Sep 23 '25 07:09 Markus-included

I can't open the file no matter the version/os. So can't really reproduce the "works on one version but not the other" Are you sure the file you provided is correct here ? The rnote format is gzipped so not sure doing gz on top of this works ? Because the end file provided here is not zipped when opening the gz file.

The current saving process is done in two steps : creating a json then gzipping it. Related issues : https://github.com/flxzt/rnote/issues/1128

Can you recover the file here ? Because if you can open it on 0.12 on a machine, saving it again then opening it again with 0.13 it should be back to normal and readable whatever the machine

Doublonmousse avatar Sep 25 '25 19:09 Doublonmousse

I had to gzip it, otherwise github would not let me attach it, you must gunzip it first, that's what I meant with "Unpack and open"

Markus-included avatar Sep 25 '25 21:09 Markus-included

The rnote file format is a gzipped json format. Your file misses the last part (being gzipped).

I can change the code so that if the decompress step fails, I retry assuming the file was not compressed (for some unknown reason. With this, rnote will happily read the file.

Much quicker though. Run

gunzip Hue.rnote

On your Hue.rnote.gz file (without the gz part). Then you get a correct rnote file (because the end file will be the gzipped version)

Doublonmousse avatar Sep 28 '25 22:09 Doublonmousse

Can reproduce on my Windows 10 22H2 with my own file: Rnote 12.x makes it not crash

YoshiTabletopGamer avatar Oct 02 '25 22:10 YoshiTabletopGamer

Can't repro I'm afraid

Doublonmousse avatar Oct 04 '25 09:10 Doublonmousse

Hmm. I'm running Git Bisect right now to find the possible regression, should have results soon.

YoshiTabletopGamer avatar Oct 04 '25 14:10 YoshiTabletopGamer

Hmm, git bisect didn't behave properly, and https://github.com/flxzt/rnote/commit/303660cfd5961c2f1dabb06c8871880fcdaf82cd I built with instructions at https://github.com/flxzt/rnote/blob/main/misc/building/rnote-windows-build.md crashes with my file, while the release version does not.

YoshiTabletopGamer avatar Oct 04 '25 16:10 YoshiTabletopGamer

The Hue.rnote. file crashes on the latest release 13.1, while it also crashes, but only a few seconds after showing the content, on my Windows built https://github.com/flxzt/rnote/commit/303660cfd5961c2f1dabb06c8871880fcdaf82cd. And as expected, the file works fine on release 12.0. I haven't tested on Linux yet (Is it normal for Windows builds to take 20 minutes with the build instructions? It says it compiles release by default; Maybe I need a PC with more cores or faster RAM?)

YoshiTabletopGamer avatar Oct 04 '25 16:10 YoshiTabletopGamer

Here's THE crash on my local build

> k
 # Child-SP          RetAddr               Call Site
00 000000dd`f8bfa868 00007ffa`47e8d008     ntdll!RtlpBreakPointHeap+0x16
01 000000dd`f8bfa870 00007ffa`47ec9980     ntdll!RtlpValidateHeapEntry+0x5d7e8
02 000000dd`f8bfa8b0 00007ffa`47df1d2f     ntdll!RtlDebugReAllocateHeap+0x120
03 000000dd`f8bfa930 00007ffa`47df38e3     ntdll!RtlpReAllocateHeap+0x34b
04 000000dd`f8bfaab0 00007ffa`47df36bd     ntdll!RtlpReAllocateHeapInternal+0x1c3
05 000000dd`f8bfac10 00007ffa`472b9e07     ntdll!RtlReAllocateHeap+0x7d
06 000000dd`f8bfac50 00007ffa`3f602ce7     msvcrt_7ffa472a0000!realloc+0x57
07 000000dd`f8bfac80 00007ffa`3f603b11     d2d1!CArray<CachedGlyphOutline,CPodTraits<CachedGlyphOutline>,CDefaultAllocator>::EnsureLargerCapacity+0x57
08 000000dd`f8bfacb0 00007ffa`3f603a17     d2d1!TextOutlineCache::AddCachedGlyphInternal+0x91
09 000000dd`f8bface0 00007ffa`3f6040fa     d2d1!TextOutlineCacheSubEntry::AddCachedGlyph+0x6f
0a 000000dd`f8bfad20 00007ffa`3f604f68     d2d1!<lambda_655c9741aced175d50f7ec4a5b30606b>::operator()+0xda
0b 000000dd`f8bfada0 00007ffa`3f60477e     d2d1!GlyphOutlineRenderer::RenderSingleGlyphs+0x1a4
0c 000000dd`f8bfaec0 00007ffa`3f5c1dab     d2d1!GlyphOutlineRenderer::RenderGlyphRun+0x1de
0d 000000dd`f8bfaf50 00007ffa`3f6fd51e     d2d1!CHwSurfaceRenderTarget::DrawGlyphRun+0x69b
0e 000000dd`f8bfb1d0 00007ffa`3f5c560e     d2d1!WarpRenderTarget::DrawGlyphRun+0x5ae
0f 000000dd`f8bfb420 00007ffa`3f5b3db5     d2d1!BrushRedirectionCompatibleCommand<CCommand_DrawGlyphRun,0>::Execute+0xee
10 000000dd`f8bfb530 00007ffa`3f5f3adf     d2d1!CHwSurfaceRenderTarget::ProcessBatch+0x65
11 000000dd`f8bfb580 00007ffa`3f5b4b58     d2d1!CBatchSerializer::FlushInternal+0xcf
12 000000dd`f8bfb610 00007ffa`3f6dec80     d2d1!DrawingContext::Flush+0x88
13 000000dd`f8bfb670 00007ffa`3f6ca16d     d2d1!DrawingContext::EndDraw+0x4c
14 000000dd`f8bfb6c0 00007ff9`f5de8bbe     d2d1!D2DDeviceContextBase<ID2D1BitmapRenderTarget,ID2D1BitmapRenderTarget,ID2D1DeviceContext6>::EndDraw+0xad
15 000000dd`f8bfb710 00007ff9`f5dea81b     libcairo_2!cairo_win32_scaled_font_get_device_to_logical+0xbee
16 000000dd`f8bfb900 00007ff9`f5d8cb78     libcairo_2!cairo_win32_scaled_font_get_device_to_logical+0x284b
17 000000dd`f8bfba30 00007ff9`f5d51849     libcairo_2!cairo_scaled_font_extents+0xcc8
18 000000dd`f8bfbad0 00007ff9`f5da5539     libcairo_2!cairo_font_options_get_custom_palette_color+0x6cd9
19 000000dd`f8bfc440 00007ff9`f5da59a5     libcairo_2!cairo_toy_font_face_get_weight+0x20c9
1a 000000dd`f8bfc530 00007ff9`f5d44ae7     libcairo_2!cairo_toy_font_face_get_weight+0x2535
1b 000000dd`f8bfc5d0 00007ff9`f5d591e2     libcairo_2!cairo_rectangle_list_destroy+0x1d77
1c 000000dd`f8bfc950 00007ff9`f5d9ea89     libcairo_2!cairo_font_options_get_custom_palette_color+0xe672
1d 000000dd`f8bfc9a0 00007ff9`f5d4f5a5     libcairo_2!cairo_surface_has_show_text_glyphs+0x469
1e 000000dd`f8bfca40 00007ff9`f5dace69     libcairo_2!cairo_font_options_get_custom_palette_color+0x4a35
1f 000000dd`f8bfde60 00007ffa`13005b74     libcairo_2!cairo_show_glyphs+0x29
20 000000dd`f8bfdea0 00007ffa`13005dad     libpangocairo_1_0_0!pango_cairo_font_map_get_font_type+0x1e54
21 000000dd`f8bfe780 00007ffa`11ff2c0c     libpangocairo_1_0_0!pango_cairo_font_map_get_font_type+0x208d
22 000000dd`f8bff090 00007ffa`11ff330c     libpango_1_0_0!pango_renderer_draw_glyph_item+0x3c
23 000000dd`f8bff0f0 00007ffa`11ff3abf     libpango_1_0_0!pango_renderer_draw_layout_line+0x65c
24 000000dd`f8bff260 00007ffa`13006594     libpango_1_0_0!pango_renderer_draw_layout+0xef
25 000000dd`f8bff340 00007ff6`307bd955     libpangocairo_1_0_0!pango_cairo_show_layout+0xa4
26 (Inline Function) --------`--------     rnote!pangocairo::auto::functions::show_layout+0x8 [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/pangocairo-0.20.7/src/auto/functions.rs @ 142] 
27 (Inline Function) --------`--------     rnote!piet_cairo::{impl#0}::draw_text<kurbo::point::Point>+0x1f [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/piet-cairo-0.7.0/src/lib.rs @ 178] 
28 000000dd`f8bff380 00007ff6`30842bc7     rnote!rnote_engine::strokes::textstroke::{impl#13}::draw<piet_cairo::CairoRenderContext>+0x1e5 [C:/testernotebisect/rnote/crates/rnote-engine/src/strokes/textstroke.rs @ 534] 
29 (Inline Function) --------`--------     rnote!rnote_engine::strokes::content::Content::gen_images::{closure#1}<rnote_engine::strokes::textstroke::TextStroke>+0x8 [C:/testernotebisect/rnote/crates/rnote-engine/src/strokes/content.rs @ 58] 
2a (Inline Function) --------`--------     rnote!rnote_engine::render::{impl#9}::gen_with_piet::{closure#0}<rnote_engine::strokes::content::Content::gen_images::{closure_env#1}<rnote_engine::strokes::textstroke::TextStroke>>+0x00000001`4000001b [C:/testernotebisect/rnote/crates/rnote-engine/src/render.rs @ 391] 
2b (Inline Function) --------`--------     rnote!rnote_engine::render::Image::gen_with_cairo<rnote_engine::render::{impl#9}::gen_with_piet::{closure_env#0}<rnote_engine::strokes::content::Content::gen_images::{closure_env#1}<rnote_engine::strokes::textstroke::TextStroke>>>+0x00000001`400005f9 [C:/testernotebisect/rnote/crates/rnote-engine/src/render.rs @ 361] 
2c (Inline Function) --------`--------     rnote!rnote_engine::render::Image::gen_with_piet<rnote_engine::strokes::content::Content::gen_images::{closure_env#1}<rnote_engine::strokes::textstroke::TextStroke>>+0x00000001`400005f9 [C:/testernotebisect/rnote/crates/rnote-engine/src/render.rs @ 398] 
2d (Inline Function) --------`--------     rnote!rnote_engine::strokes::content::Content::gen_images<rnote_engine::strokes::textstroke::TextStroke>+0x00000001`40000a25 [C:/testernotebisect/rnote/crates/rnote-engine/src/strokes/content.rs @ 57] 
2e 000000dd`f8bff4c0 00007ff6`30841c2b     rnote!rnote_engine::strokes::stroke::{impl#0}::gen_images+0xb27 [C:/testernotebisect/rnote/crates/rnote-engine/src/strokes/stroke.rs @ 57] 
2f (Inline Function) --------`--------     rnote!rnote_engine::store::render_comp::{impl#2}::regenerate_rendering_in_viewport_threaded::{closure#0}+0x00000001`40000025 [C:/testernotebisect/rnote/crates/rnote-engine/src/store/render_comp.rs @ 300] 
30 (Inline Function) --------`--------     rnote!core::panic::unwind_safe::{impl#25}::call_once<(), rnote_engine::store::render_comp::{impl#2}::regenerate_rendering_in_viewport_threaded::{closure_env#0}>+0x00000001`40000035 [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/panic/unwind_safe.rs @ 272] 
31 (Inline Function) --------`--------     rnote!std::panicking::catch_unwind::do_call<core::panic::unwind_safe::AssertUnwindSafe<rnote_engine::store::render_comp::{impl#2}::regenerate_rendering_in_viewport_threaded::{closure_env#0}>, ()>+0x00000001`40000035 [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs @ 589] 
32 (Inline Function) --------`--------     rnote!std::panicking::catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rnote_engine::store::render_comp::{impl#2}::regenerate_rendering_in_viewport_threaded::{closure_env#0}>>+0x00000001`40000035 [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs @ 552] 
33 (Inline Function) --------`--------     rnote!std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rnote_engine::store::render_comp::{impl#2}::regenerate_rendering_in_viewport_threaded::{closure_env#0}>, ()>+0x00000001`40000035 [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panic.rs @ 359] 
34 (Inline Function) --------`--------     rnote!rayon_core::unwind::halt_unwinding<rnote_engine::store::render_comp::{impl#2}::regenerate_rendering_in_viewport_threaded::{closure_env#0}, ()>+0x00000001`40000047 [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/unwind.rs @ 17] 
35 (Inline Function) --------`--------     rnote!rayon_core::registry::Registry::catch_unwind<rnote_engine::store::render_comp::{impl#2}::regenerate_rendering_in_viewport_threaded::{closure_env#0}>+0x00000001`40000047 [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs @ 367] 
36 (Inline Function) --------`--------     rnote!rayon_core::spawn::spawn_job::{closure#0}<rnote_engine::store::render_comp::{impl#2}::regenerate_rendering_in_viewport_threaded::{closure_env#0}>+0x00000001`40000083 [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/spawn/mod.rs @ 97] 
37 000000dd`f8bff6b0 00007ff6`3062a6db     rnote!rayon_core::job::{impl#6}::execute<rayon_core::spawn::spawn_job::{closure_env#0}<rnote_engine::store::render_comp::{impl#2}::regenerate_rendering_in_viewport_threaded::{closure_env#0}>>+0xab [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/job.rs @ 169] 
38 (Inline Function) --------`--------     rnote!rayon_core::job::JobRef::execute+0x5 [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/job.rs @ 64] 
39 (Inline Function) --------`--------     rnote!rayon_core::registry::WorkerThread::execute+0x5 [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs @ 860] 
3a 000000dd`f8bff8d0 00007ff6`30629989     rnote!rayon_core::registry::WorkerThread::wait_until_cold+0x53b [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs @ 782] 
3b (Inline Function) --------`--------     rnote!rayon_core::registry::WorkerThread::wait_until<rayon_core::latch::OnceLatch>+0x00000001`40000098 [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs @ 769] 
3c (Inline Function) --------`--------     rnote!rayon_core::registry::WorkerThread::wait_until_out_of_work+0x00000001`400000c3 [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs @ 818] 
3d (Inline Function) --------`--------     rnote!rayon_core::registry::main_loop+0x00000001`40000133 [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs @ 923] 
3e (Inline Function) --------`--------     rnote!rayon_core::registry::ThreadBuilder::run+0x00000001`40000133 [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs @ 53] 
3f (Inline Function) --------`--------     rnote!rayon_core::registry::{impl#2}::spawn::{closure#0}+0x00000001`40000133 [C:/testernotebisect/rnote/_mesonbuild/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.12.1/src/registry.rs @ 98] 
40 000000dd`f8bff980 00007ff6`3062c5b5     rnote!std::sys::backtrace::__rust_begin_short_backtrace<rayon_core::registry::{impl#2}::spawn::{closure_env#0}, ()>+0x159 [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/sys/backtrace.rs @ 158] 
41 (Inline Function) --------`--------     rnote!std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure#0}<rayon_core::registry::{impl#2}::spawn::{closure_env#0}, ()>+0x00000001`40000017 [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/thread/mod.rs @ 559] 
42 (Inline Function) --------`--------     rnote!core::panic::unwind_safe::{impl#25}::call_once<(), std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<rayon_core::registry::{impl#2}::spawn::{closure_env#0}, ()>>+0x00000001`40000017 [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/panic/unwind_safe.rs @ 272] 
43 (Inline Function) --------`--------     rnote!std::panicking::catch_unwind::do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<rayon_core::registry::{impl#2}::spawn::{closure_env#0}, ()>>, ()>+0x00000001`4000001c [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs @ 589] 
44 (Inline Function) --------`--------     rnote!std::panicking::catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<rayon_core::registry::{impl#2}::spawn::{closure_env#0}, ()>>>+0x00000001`4000001c [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panicking.rs @ 552] 
45 (Inline Function) --------`--------     rnote!std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<rayon_core::registry::{impl#2}::spawn::{closure_env#0}, ()>>, ()>+0x00000001`4000001c [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/panic.rs @ 359] 
46 (Inline Function) --------`--------     rnote!std::thread::{impl#0}::spawn_unchecked_::{closure#1}<rayon_core::registry::{impl#2}::spawn::{closure_env#0}, ()>+0x00000001`40000117 [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/thread/mod.rs @ 557] 
47 000000dd`f8bffc20 00007ff6`30b9ce0d     rnote!core::ops::function::FnOnce::call_once<std::thread::{impl#0}::spawn_unchecked_::{closure_env#1}<rayon_core::registry::{impl#2}::spawn::{closure_env#0}, ()>, ()>+0x135 [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/core/src/ops/function.rs @ 253] 
48 (Inline Function) --------`--------     rnote!alloc::boxed::{impl#28}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>+0x00000001`40000006 [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/alloc/src/boxed.rs @ 1971] 
49 (Inline Function) --------`--------     rnote!alloc::boxed::{impl#28}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global>+0x00000001`4000000d [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/alloc/src/boxed.rs @ 1971] 
4a 000000dd`f8bffdb0 00007ffa`47507374     rnote!std::sys::pal::windows::thread::{impl#0}::new::thread_start+0x2d [/rustc/1159e78c4747b02ef996e55082b704c09b970588/library/std/src/sys/pal/windows/thread.rs @ 60] 
4b 000000dd`f8bffe00 00007ffa`47e1cc91     KERNEL32!BaseThreadInitThunk+0x14
4c 000000dd`f8bffe30 00000000`00000000     ntdll!RtlUserThreadStart+0x21

YoshiTabletopGamer avatar Oct 04 '25 21:10 YoshiTabletopGamer

https://github.com/flxzt/rnote/blob/0fcb985a253ccd2e37c0fd198622cc132ffd8c9c/crates/rnote-engine/src/strokes/textstroke.rs#L534

YoshiTabletopGamer avatar Oct 04 '25 21:10 YoshiTabletopGamer

Release, working build

Dump of file C:\Program Files\Rnote\bin\rnote.exe
File Type: EXECUTABLE IMAGE
  Image has the following dependencies:
    libadwaita-1-0.dll
    libcairo-2.dll
    libgio-2.0-0.dll
    libglib-2.0-0.dll
    libgobject-2.0-0.dll
    libgraphene-1.0-0.dll
    libgtk-4-1.dll
    libintl-8.dll
    KERNEL32.dll
    msvcrt.dll
    libpango-1.0-0.dll
    libpangocairo-1.0-0.dll
    libpoppler-glib-8.dll
    libxml2-2.dll <------------------------------------------------------------------
    kernel32.dll
    bcryptprimitives.dll
    api-ms-win-core-synch-l1-2-0.dll
    advapi32.dll
    bcrypt.dll
    kernel32.dll
    ntdll.dll
    ole32.dll
    oleaut32.dll

Broken, local build


Dump of file C:\msys64\mingw64\bin\rnote.exe
File Type: EXECUTABLE IMAGE
  Image has the following dependencies:
    libadwaita-1-0.dll
    libcairo-2.dll
    libgio-2.0-0.dll
    libglib-2.0-0.dll
    libgobject-2.0-0.dll
    libgraphene-1.0-0.dll
    libgtk-4-1.dll
    libintl-8.dll
    KERNEL32.dll
    msvcrt.dll
    ntdll.dll
    libpango-1.0-0.dll
    libpangocairo-1.0-0.dll
    libpoppler-glib-8.dll
    libxml2-16.dll <------------------------------------------------------------------
    kernel32.dll
    bcryptprimitives.dll
    api-ms-win-core-synch-l1-2-0.dll
    advapi32.dll
    bcrypt.dll
    kernel32.dll
    ntdll.dll
    ole32.dll
    oleaut32.dll

YoshiTabletopGamer avatar Oct 04 '25 21:10 YoshiTabletopGamer

(Is it normal for Windows builds to take 20 minutes with the build instructions? It says it compiles release by default;

Yes by default this is the fully optimized release build. Do

meson configure -Dcli=false -Dprofile=devel _mesonbuild

(see https://github.com/flxzt/rnote/blob/main/BUILDING.md#configure) so that your builds are done in debug mode. It'll be slow as well the first time (although faster than a cold release build), but incremental builds will be much quicker.

The Hue.rnote. file crashes on the latest release 13.1, while it also crashes, but only a few seconds after showing the content, on my Windows built https://github.com/flxzt/rnote/commit/303660cfd5961c2f1dabb06c8871880fcdaf82cd. And as expected, the file works fine on release 12.0

So opening the file works no matter the version, but there is a crash after loading that's similar between the versions on windows ?

the file works fine on release 12.0 it also crashes, but only a few seconds after showing the content, on my Windows built

Yes, seems like dependency version play a role here. The biggest one would be the gtk4 version (for sure there's a difference here even if the dll file name is the same). I see a lot of libcairo in the stack trace

Doublonmousse avatar Oct 04 '25 21:10 Doublonmousse

brokentext.gz Rename to .rnote, very small example

YoshiTabletopGamer avatar Oct 04 '25 21:10 YoshiTabletopGamer

Can repro on my side. In the backtrace there's a couple of interesting lines

#42 rayon_core::job::{impl#6}::execute<rayon_core::spawn::spawn_job::{closure_env#0}<rnote_engine::store::render_comp::{impl#2}::regenerate_rendering_in_viewport_threaded::{closure_env#0}>> (
    this=0x28961b20)

....

#50 0x00007ff6610720c2 in rayon_core::registry::{impl#2}::spawn::{closure#0} ()
    at src/registry.rs:95
#51 std::sys::backtrace::__rust_begin_short_backtrace<rayon_core::registry::{impl#2}::spawn::{closure_env#0}, ()> (f=...)
    at C:\Users\USER\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib/rustlib/src/rust\library\std\src\sys/backtrace.rs:152

So it seems like that the threaded rendering part (using rayon) fails somehow. The line mentioned in the gdb trace is this one https://github.com/rayon-rs/rayon/blame/main/rayon-core/src/registry.rs#L95 and the calling function is probably regenerate_rendering_in_viewport_threaded

Maybe you can try to do a version of regenerate_rendering_in_viewport_threaded that does not call rayon so we can verify if this a thread-related issue (maybe related to thread safety changes of called libraries?) or if without threads we'd still crash (chances are the backtrace will be a little more full)

Doublonmousse avatar Oct 04 '25 21:10 Doublonmousse

Hmm, I compiled the debug build and only got

0.000376300s DEBUG rnote: .. tracing subscriber initialized.
IWICBitmapSource::CopyPixels() failed: There is already a read or write lock pending.

YoshiTabletopGamer avatar Oct 04 '25 23:10 YoshiTabletopGamer

I removed the corresponding Rayon call, and... that's it?

				match stroke.gen_images(viewport_extended, image_scale) {
					Ok(images) => {
						tasks_tx.send(EngineTask::UpdateStrokeWithImages {
							key,
							images,
							image_scale,
						});
					}
					Err(e) => {
						error!(
							"Generating stroke images failed stroke while regenerating rendering in viewport `{viewport:?}`, stroke key: {key:?}, Err: {e:?}"
						);
					}
				}
            }
        }
    }
Image

YoshiTabletopGamer avatar Oct 05 '25 01:10 YoshiTabletopGamer

It's also odd that I can't build 0.12.0 as is without this error; will investigate further

YoshiTabletopGamer avatar Oct 05 '25 01:10 YoshiTabletopGamer

What happens if you build, with the repo's Windows instructions exactly, 0.12.0? Does it crash on the files? It shouldn't, because the release version does not.

YoshiTabletopGamer avatar Oct 05 '25 02:10 YoshiTabletopGamer

I wonder given the timings if the issue is from a msys cairo package update, in particular this commit https://github.com/msys2/MINGW-packages/commit/305ebda98c3041d9986d6fae498b45d2b2b9f4e8

As you can't really specify versions with pacman on msys (unless I'm mistaken, and hopefully I am here ...), I'm rebuilding from source from the commit before, that is downloading this folder https://github.com/msys2/MINGW-packages/tree/1a9ecad4f2a9e92fca6b72ad70403056bbe29590/mingw-w64-cairo and running makepkg -i on it.

Equivalent to doing the following downgrade

warning: downgrading package mingw-w64-x86_64-cairo (1.18.4-3 => 1.18.4-1)

(notice the 3 -> 1)

Seems to work/fix the issue (on a 0.13.1 debug build). Can you do the same to confirm this fixes it on your side too ?

Doublonmousse avatar Oct 05 '25 15:10 Doublonmousse

I've made a window release with 1.18.4-1 (found out that you can force a version from https://www.msys2.org/docs/package-management/#installing-a-specific-version-of-a-package-or-a-stand-alone-packages although I find it suboptimal) to test.

See https://github.com/Doublonmousse/rnote/actions/runs/18626906789

Doublonmousse avatar Oct 19 '25 08:10 Doublonmousse

I've made a window release with 1.18.4-1 (found out that you can force a version from https://www.msys2.org/docs/package-management/#installing-a-specific-version-of-a-package-or-a-stand-alone-packages although I find it suboptimal) to test.

See https://github.com/Doublonmousse/rnote/actions/runs/18626906789

I have no idea why that build simply crashes when trying to open. Do I need a Visual C++ distributable installed (I already have it...)?

YoshiTabletopGamer avatar Oct 20 '25 00:10 YoshiTabletopGamer

The procedure entry point DllMain could not be located in the dynamic link library C:\Program Files\Rnote\bin\libcairo-gobject-2.dll.
Code execution cannot continue because liblz2-2.dll was not found. Reinstalling the program may fix the problem.
Code execution cannot continue because nssutil3.dll was not found. Reinstalling the program may fix the problem.
Code execution cannot continue because libplds4.dll was not found. Reinstalling the program may fix the problem.

YoshiTabletopGamer avatar Oct 20 '25 00:10 YoshiTabletopGamer

Hmm, libintl-8.dll has missing imports (Dllmain)?

YoshiTabletopGamer avatar Oct 20 '25 01:10 YoshiTabletopGamer

Ah sorry, this is either a windows CI issue or me forcing the version not working. Will try to take another look in the week

Doublonmousse avatar Oct 20 '25 06:10 Doublonmousse

Maybe this is related ? https://github.com/msys2/MINGW-packages/commit/83eed715521d7d7c292d34fb80c29a720b534769#diff-96706f5b78840ff34d543e38ac535f2f1cd79cccdae76fa49b8f206cfb459d99 I think I'll try another approach: take the cairo pkg build file and comment the patch

Doublonmousse avatar Oct 21 '25 20:10 Doublonmousse

Finally succeeded in doing a new window release version here : https://github.com/Doublonmousse/rnote/actions/runs/18852170512

No dllmain issue on my side, nor text making rnote crash from a quick test. Built from #1561

Doublonmousse avatar Oct 27 '25 20:10 Doublonmousse

https://github.com/Doublonmousse/rnote/actions/runs/18852170512 works perfectly with all previously problematic files I tested, including @Markus-included's Hue.rnote

Image

YoshiTabletopGamer avatar Oct 28 '25 16:10 YoshiTabletopGamer

It's working!!! Thank you so much for your hard work! You saved me from a crash out along with the app :3 💕

ChepakiChepaki avatar Nov 02 '25 21:11 ChepakiChepaki

From upstream: It seems that running in a powershell terminal

$env:PANGOCAIRO_BACKEND="fc"
& 'C:\Program Files\Rnote\bin\rnote.exe'

on the released 0.13.1 exe without the fix won't crash. See https://github.com/msys2/MINGW-packages/issues/26222#issuecomment-3506563048

Doublonmousse avatar Nov 08 '25 13:11 Doublonmousse