Hi,

Wanted to try calcurse and at very first usage got crash with SIGBUS. I
got very easy repro case. I get crash every time by following below
steps:

- rm -rf ~/.calcurse    # that may not be even needed
- calcurse
- Press ENTER to continue
- Press ? for help
- While being in less (intro.txt) press q to exit the pager
- Bus error (core dumped)

I didn't contact upstream yet, just wanted to report this here first.
Does it look to you guys like problem on the calcurse side or
librthread? I will look to report this upstream too, when time permits.

$ sysctl -n kern.version
OpenBSD 6.4-current (GENERIC.MP) #651: Wed Jan 30 09:35:19 MST 2019
    [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP

$ egdb /usr/local/bin/calcurse calcurse.core
GNU gdb (GDB) 7.12.1
...
[New process 447060]
[New process 268640]
Core was generated by `calcurse'.
Program terminated with signal SIGBUS, Bus error.
#0  pthread_cancel (thread=0x1e80a567640) at 
/usr/src/lib/librthread/rthread.c:431
431             pid_t tid = tib->tib_tid;
[Current thread is 1 (process 447060)]
(gdb) bt
#0  pthread_cancel (thread=0x1e80a567640) at 
/usr/src/lib/librthread/rthread.c:431
#1  0x000001e57e0898ac in notify_stop_main_thread () at notify.c:194
#2  0x000001e57e08aaa7 in notify_start_main_thread () at notify.c:553
#3  0x000001e57e0a738a in wins_unprepare_external () at wins.c:611
#4  0x000001e57e0a7420 in wins_launch_external (arg=0x7f7ffffd9c50) at 
wins.c:627
#5  0x000001e57e076d72 in display_help (topic=0x1e57e0570b8 "intro") at 
help.c:203
#6  0x000001e57e06365b in key_generic_help () at calcurse.c:267
#7  0x000001e57e062c1a in main (argc=1, argv=0x7f7ffffd9e68) at calcurse.c:685
(gdb) list
426
427     int
428     pthread_cancel(pthread_t thread)
429     {
430             struct tib *tib = thread->tib;
431             pid_t tid = tib->tib_tid;
432
433             if (tib->tib_canceled == 0 && tid != 0 &&
434                 (tib->tib_cantcancel & CANCEL_DYING) == 0) {
435                     tib->tib_canceled = 1;
(gdb) list notify.c:194
189
190     /* Stop the notify-bar main thread. */
191     void notify_stop_main_thread(void)
192     {
193             if (notify_t_main) {
194                     pthread_cancel(notify_t_main);
195                     pthread_join(notify_t_main, NULL);
196             }
197     }
198
(gdb) list notify.c:553
548
549     /* Launch the notify-bar main thread. */
550     void notify_start_main_thread(void)
551     {
552             /* Avoid starting the notification bar thread twice. */
553             notify_stop_main_thread();
554
555             pthread_create(&notify_t_main, NULL, notify_main_thread, NULL);
556             notify_check_next_app(0);
557     }

Regards,
 Mikolaj

Reply via email to