Clicking '+' button results in a segfault, killing the application. After restart note is added nonetheless.
Fix the segfault.
Thread 1 "notes-up" received signal SIGSEGV, Segmentation fault.
0x00007ffff32941fd in populate (getc=getc@entry=0x7ffff3291100 <__mkd_io_strget>,
ctx=ctx@entry=0x7fffffffc520, flags=flags@entry=0x43604000)
at /usr/src/debug/discount/discount-3.0.0a/mkdio.c:105
Downloading source file /usr/src/debug/discount/discount-3.0.0a/mkdio.c
105 if ( flags && (is_flag_set(flags, MKD_NOHEADER) || is_flag_set(flags, MKD_STRICT)) )
(gdb) bt
#0 0x00007ffff32941fd in populate
(getc=getc@entry=0x7ffff3291100 <__mkd_io_strget>, ctx=ctx@entry=0x7fffffffc520, flags=flags@entry=0x43604000) at /usr/src/debug/discount/discount-3.0.0a/mkdio.c:105
#1 0x00007ffff32944b0 in mkd3_string
(buf=buf@entry=0x555555a08c20 "", len=<optimized out>, flags=flags@entry=0x43604000)
at /usr/src/debug/discount/discount-3.0.0a/mkdio.c:188
#2 0x0000555555589fe4 in enotes_viewer_process
(self=self@entry=0x555555a823f0, raw_mk=raw_mk@entry=0x5555559373a0 "")
at ../Notes-up-2.0.6/src/Widgets/Viewer.vala:230
#3 0x000055555558a5db in enotes_viewer_load_page
(self=0x555555a823f0, page=0x55555572e8b0, force_load=<optimized out>)
at ../Notes-up-2.0.6/src/Widgets/Viewer.vala:70
#4 0x000055555558a733 in __lambda36_ (self=0x555555a00d10)
at ../Notes-up-2.0.6/src/Widgets/ViewEditStack.vala:99
#5 ___lambda36__g_object_notify (_sender=<optimized out>, pspec=<optimized out>, self=0x555555a00d10)
at ../Notes-up-2.0.6/src/Widgets/ViewEditStack.vala:97
#6 0x00007ffff71546c0 in g_closure_invoke
(closure=0x5555558b2640, return_value=0x0, n_param_values=2, param_values=0x7fffffffc840, invocation_hint=0x7fffffffc790) at ../glib/gobject/gclosure.c:832
#7 0x00007ffff7182a36 in signal_emit_unlocked_R.isra.0
(node=node@entry=0x7fffffffc930, detail=detail@entry=113, instance=instance@entry=0x5555556031f0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffc840)
at ../glib/gobject/gsignal.c:3980
#8 0x00007ffff7173a42 in signal_emit_valist_unlocked
(instance=instance@entry=0x5555556031f0, signal_id=signal_id@entry=1, detail=detail@entry=113, var_args=var_args@entry=0x7fffffffca90) at ../glib/gobject/gsignal.c:3612
#9 0x00007ffff7173c77 in g_signal_emit_valist
(instance=0x5555556031f0, signal_id=1, detail=113, var_args=var_args@entry=0x7fffffffca90)
--Type <RET> for more, q to quit, c to continue without paging--c
at ../glib/gobject/gsignal.c:3355
#10 0x00007ffff7173d34 in g_signal_emit
(instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>)
at ../glib/gobject/gsignal.c:3675
#11 0x00007ffff715f636 in g_object_dispatch_properties_changed
(object=0x5555556031f0, n_pspecs=<optimized out>, pspecs=<optimized out>)
at ../glib/gobject/gobject.c:1427
#12 0x00007ffff7162ab3 in g_object_notify_by_spec_internal
(pspec=<optimized out>, object=0x5555556031f0) at ../glib/gobject/gobject.c:1551
#13 g_object_notify_by_pspec (object=object@entry=0x5555556031f0, pspec=<optimized out>)
at ../glib/gobject/gobject.c:1657
#14 0x000055555556beb8 in enotes_application_state_set_opened_page
(value=0x55555572e8b0, self=0x5555556031f0) at ../Notes-up-2.0.6/src/Application.vala:150
#15 0x0000555555576f32 in enotes_application_state_open_page
(self=0x5555556031f0, page_id=<optimized out>) at ../Notes-up-2.0.6/src/Application.vala:253
(gdb) i ar
getc = 0x7ffff3291100 <__mkd_io_strget>
ctx = 0x7fffffffc520
flags = 0x43604000
(gdb) i loc
line = {text = 0x0, size = 1432000400, alloc = 21845}
a = 0x55555572ec00
c = <optimized out>
pandoc = 0
(gdb) disas
Dump of assembler code for function populate:
0x00007ffff32941c0 <+0>: endbr64
0x00007ffff32941c4 <+4>: push r15
0x00007ffff32941c6 <+6>: push r14
0x00007ffff32941c8 <+8>: push r13
0x00007ffff32941ca <+10>: push r12
0x00007ffff32941cc <+12>: mov r12,rsi
0x00007ffff32941cf <+15>: push rbp
0x00007ffff32941d0 <+16>: mov rbp,rdi
0x00007ffff32941d3 <+19>: push rbx
0x00007ffff32941d4 <+20>: mov rbx,rdx
0x00007ffff32941d7 <+23>: sub rsp,0x38
0x00007ffff32941db <+27>: mov rax,QWORD PTR fs:0x28
0x00007ffff32941e4 <+36>: mov QWORD PTR [rsp+0x28],rax
0x00007ffff32941e9 <+41>: xor eax,eax
0x00007ffff32941eb <+43>: call QWORD PTR [rip+0xcc3f] # 0x7ffff32a0e30
0x00007ffff32941f1 <+49>: mov r13,rax
0x00007ffff32941f4 <+52>: test rbx,rbx
0x00007ffff32941f7 <+55>: je 0x7ffff32943a0 <populate+480>
=> 0x00007ffff32941fd <+61>: cmp BYTE PTR [rbx+0x10],0x0
(gdb) i reg rbx
rbx 0x43604000 1130381312
(gdb) p flags
$1 = (mkd_flag_t *) 0x43604000
(gdb) ptype flags
type = struct {
char bit[31];
} *
(gdb) x/s flags
0x43604000: <error: Cannot access memory at address 0x43604000>
Expected Behavior
Clicking a '+' button successfully adds a new note
Current Behavior
Clicking '+' button results in a segfault, killing the application. After restart note is added nonetheless.
Possible Solution
Fix the segfault.
Steps to Reproduce (for bugs)
Context
Looks like
flagsparameter is passed with incorrect value.Screenshots of the Problem
N/A
Your Environment (for bugs)
Linux arc 5.10.194-1-MANJARO #1 SMP PREEMPT Sat Sep 2 20:55:57 UTC 2023 x86_64 GNU/Linux
Name : notes-up
Version : 2.0.6-2