pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/57050: profanity 12.1 from pkgsrc binaries on NetBSD 9.3/amd64 crashes at login



The following reply was made to PR pkg/57050; it has been noted by GNATS.

From: Harold Gutch <logix%foobar.franken.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/57050: profanity 12.1 from pkgsrc binaries on NetBSD 9.3/amd64 crashes at login
Date: Tue, 11 Oct 2022 18:58:29 +0200

 --ZfOjI3PrQbgiZnxM
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Hi,
 
 based on the stacktrace this seems to be crashing in curses'
 wattron(), namely in
 
         const TERMINAL *t = win->screen->term;
 
 I believe this is coming from profanity's src/ui/rosterwin.c which in
 l. 1072 calls
 
     wattron(layout->subwin, theme_attrs(THEME_ROSTER_HEADER));
 
 and it seems that the first parameter here is NULL.  The code in
 question here handles messages by people not in the user's contact
 list, and what is probably happening is that the xmpp server is
 sending such a message before profanity has set up its window layout.
 Setting roster.unsubscribed=false indeed makes profanity start
 without crashing, and the attached patch bails out early in the
 problematic code path if layout->subwin is NULL (Adrian verified for
 me that either of the two makes profanity work for him again).  But I
 am not familiar enough with the profanity code to say if this has any
 issus...
 
 FreeBSD doesn't crash here in ncurses because FreeBSD's wattron() has
 a check if the first parameter is NULL, in which case it just returns
 an error, and we could do the same.  On the other hand, ultimately
 this is a bug in profanity and we just noticed *because* we don't mask
 it in curses.
 
 
   Harold
 
 --ZfOjI3PrQbgiZnxM
 Content-Type: text/x-csrc; charset=us-ascii
 Content-Disposition: attachment; filename="patch-src_ui_rosterwin.c"
 
 --- src/ui/rosterwin.c.orig	2022-05-29 16:45:24.000000000 +0200
 +++ src/ui/rosterwin.c	2022-10-11 13:45:23.394512000 +0200
 @@ -98,10 +98,12 @@
      ProfLayoutSplit* layout = (ProfLayoutSplit*)console->layout;
      assert(layout->memcheck == LAYOUT_SPLIT_MEMCHECK);
  
 -    if (layout->subwin != NULL) {
 -        werase(layout->subwin);
 +    if (layout->subwin == NULL) {
 +        return;
      }
  
 +    werase(layout->subwin);
 +
      char* roomspos = prefs_get_string(PREF_ROSTER_ROOMS_POS);
      if (prefs_get_boolean(PREF_ROSTER_ROOMS) && (g_strcmp0(roomspos, "first") == 0)) {
          _rosterwin_print_rooms(layout);
 
 --ZfOjI3PrQbgiZnxM--
 


Home | Main Index | Thread Index | Old Index