[Bug 1926298] Re: Segfault added in the recent changes

Brian Murray 1926298 at bugs.launchpad.net
Wed Apr 28 22:37:47 UTC 2021


I manually retraced the crash file Dan provided and the results follow:

Stacktrace:
 #0  0x00007f3250972202 in g_strfreev (str_array=<optimized out>) at ../../../glib/gstrfuncs.c:2552
         i = 0
 #1  g_strfreev (str_array=0x69726f6972500a67) at ../../../glib/gstrfuncs.c:2546
         i = <optimized out>
 #2  0x0000562c680f57ff in hook_command_exists (cmd=<optimized out>) at hooks.c:137
         cargv = 0x562c6a3edc70
         result = 1
         unquoted = 0x562c6a3cfb50 "/bin/true"
         error = 0x0
         cargc = 1
         pathdirs = 0x69726f6972500a67
         result = <optimized out>
         unquoted = <optimized out>
         cargv = <optimized out>
         error = <optimized out>
         out = <optimized out>
         cargc = <optimized out>
         pathdirs = <optimized out>
         i = <optimized out>
         pathdir = <optimized out>
         fname = <optimized out>
 #3  is_hook_relevant (hook_file=hook_file at entry=0x562c6a4c0073 "bug") at hooks.c:717
         res = <optimized out>
         filename = 0x562c6a2277e0 "/var/lib/update-notifier/user.d/bug"
         f = <optimized out>
         rfc822 = 0x562c6a19d540
         b = <optimized out>
 #4  0x0000562c680f6b65 in check_update_hooks (ta=0x562c6a40e1b0) at hooks.c:781
         new_mtime = <optimized out>
         elm = <optimized out>
         hf = <optimized out>
         dir = 0x562c6a185660
         hook_file = 0x562c6a4c0073 "bug"
         priv = 0x562c6a238bc0
         unseen_count = 0
         __PRETTY_FUNCTION__ = "check_update_hooks"
 #5  0x0000562c680f7268 in hook_tray_icon_init (ta=<optimized out>) at hooks.c:969
         priv = <optimized out>
 #6  0x0000562c680f4933 in tray_icons_init (un=0x562c6a1ddd30, un at entry=<error reading variable: value has been optimized out>) at update-notifier.c:447
 No locals.
 #7  0x00007f3250956e38 in g_timeout_dispatch (source=0x562c6a195330, callback=<optimized out>, user_data=<optimized out>) at ../../../glib/gmain.c:4889
         timeout_source = 0x562c6a195330
         again = <optimized out>
 #8  0x00007f325095674f in g_main_dispatch (context=0x562c6a0d7060) at ../../../glib/gmain.c:3337
         dispatch = 0x7f3250956e20 <g_timeout_dispatch>
         prev_source = 0x0
         begin_time_nsec = 0
         was_in_call = 0
         user_data = 0x562c6a1ddd30
         callback = 0x562c680f4870 <tray_icons_init>
         cb_funcs = <optimized out>
         cb_data = 0x562c6a1bedc0
         need_destroy = <optimized out>
         source = 0x562c6a195330
         current = 0x562c6a1317c0
         i = 0
         current = <optimized out>
         i = <optimized out>
         __func__ = {<optimized out> <repeats 16 times>}
         source = <optimized out>
         _g_boolean_var_ = <optimized out>
         was_in_call = <optimized out>
         user_data = <optimized out>
         callback = <optimized out>
         cb_funcs = <optimized out>
         cb_data = <optimized out>
         need_destroy = <optimized out>
         dispatch = <optimized out>
         prev_source = <optimized out>
         begin_time_nsec = <optimized out>
         _g_boolean_var_ = <optimized out>
 #9  g_main_context_dispatch (context=0x562c6a0d7060) at ../../../glib/gmain.c:4055
 No locals.
 #10 0x00007f32509a9c68 in g_main_context_iterate.constprop.0 (context=0x562c6a0d7060, block=block at entry=1, dispatch=dispatch at entry=1, self=<optimized out>) at ../../../glib/gmain.c:4131
         max_priority = 2147483647
         timeout = 845
         some_ready = 1
         nfds = <optimized out>
         allocated_nfds = <optimized out>
         fds = 0x562c6a1dc450
         begin_time_nsec = 0
 #11 0x00007f3250955db3 in g_main_loop_run (loop=0x562c6a1dc430) at ../../../glib/gmain.c:4329
         self = <optimized out>
         __func__ = "g_main_loop_run"
 #12 0x00007f325104a17d in gtk_main () at ../../../../gtk/gtkmain.c:1329
         loop = 0x562c6a1dc430
 #13 0x0000562c680f40f5 in main (argc=<optimized out>, argv=<optimized out>) at update-notifier.c:649
         un = 0x562c6a1ddd30
         error = 0x0
         pid_file = <optimized out>
         rc = 0
         lockfn = <optimized out>
         dirname = 0x7ffef986bf20 ""
StacktraceAddressSignature: /usr/bin/update-notifier:11:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.0+54202:/usr/bin/update-notifier+37ff:/usr/bin/update-notifier+4b65:/usr/bin/update-notifier+5268:/usr/bin/update-notifier+2933:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.0+38e38:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.0+3874f:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.0+8bc68:/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.6800.0+37db3:/usr/lib/x86_64-linux-gnu/libgtk-3.so.0.2404.21+1c517d:/usr/bin/update-notifier+20f5
StacktraceSource:
 #0  0x00007f3250972202 in g_strfreev (str_array=<optimized out>) at ../../../glib/gstrfuncs.c:2552
   [Error: gstrfuncs.c was not found in source tree]
 #1  g_strfreev (str_array=0x69726f6972500a67) at ../../../glib/gstrfuncs.c:2546
   [Error: gstrfuncs.c was not found in source tree]
 #2  0x0000562c680f57ff in hook_command_exists (cmd=<optimized out>) at hooks.c:137
   132:    g_debug_hooks("failed to find command in PATH");
   133: 
   134: out:
   135:    if(error) g_error_free(error);
   136:    if(cargv) g_strfreev(cargv);
   137:    if(pathdirs) g_strfreev(pathdirs);
   138:    if(unquoted) g_free(unquoted);
   139:    return result;
   140: }
   141: 
   142: static gboolean
 #3  is_hook_relevant (hook_file=hook_file at entry=0x562c6a4c0073 "bug") at hooks.c:717
   712:    // check that the Command we are offering exists
   713:    if(res) {
   714:       b = rfc822_header_lookup(rfc822, "Command");
   715:       if(b != NULL) {
   716: 	 g_debug_hooks("found Command: '%s'", b);
   717: 	 res = hook_command_exists(b);
   718:       }
   719:    }
   720: 
   721:    g_free(filename);
   722:    rfc822_header_free_all(rfc822);
 #4  0x0000562c680f6b65 in check_update_hooks (ta=0x562c6a40e1b0) at hooks.c:781
   776:    int unseen_count = 0;
   777:    while((hook_file=g_dir_read_name(dir)) != NULL) {
   778:       g_debug_hooks("investigating file '%s'", hook_file); 
   779: 
   780:       // check if the hook still applies (for e.g. DontShowAfterReboot)
   781:       if(!is_hook_relevant(hook_file)) {
   782: 	 g_debug_hooks("not relevant: '%s'",hook_file);
   783: 	 continue;
   784:       }
   785:       // see if we already know about this hook filename
   786:       elm = g_list_find_custom(priv->hook_files,hook_file,
 #5  0x0000562c680f7268 in hook_tray_icon_init (ta=<optimized out>) at hooks.c:969
   964: 
   965:    /* read already seen hooks */
   966:    init_already_seen_hooks(ta);
   967:    
   968:    /* Check for hooks */
   969:    check_update_hooks(ta);
   970: }
 #6  0x0000562c680f4933 in tray_icons_init (un=0x562c6a1ddd30, un at entry=<error reading variable: value has been optimized out>) at update-notifier.c:447
   442:       un->update = NULL;
   443: 
   444:    /* update hook icon*/
   445:    un->hook = g_new0 (TrayApplet, 1);
   446:    trayapplet_create(un->hook, un, "hook-notifier");
   447:    hook_tray_icon_init(un->hook);
   448: 
   449:    /* crashreport detected icon */
   450:    un->crashreport = g_new0 (TrayApplet, 1);
   451:    trayapplet_create(un->crashreport, un, "apport");
   452:    crashreport_tray_icon_init(un->crashreport);
 #7  0x00007f3250956e38 in g_timeout_dispatch (source=0x562c6a195330, callback=<optimized out>, user_data=<optimized out>) at ../../../glib/gmain.c:4889
   [Error: gmain.c was not found in source tree]
 #8  0x00007f325095674f in g_main_dispatch (context=0x562c6a0d7060) at ../../../glib/gmain.c:3337
   [Error: gmain.c was not found in source tree]
 #9  g_main_context_dispatch (context=0x562c6a0d7060) at ../../../glib/gmain.c:4055
   [Error: gmain.c was not found in source tree]
 #10 0x00007f32509a9c68 in g_main_context_iterate.constprop.0 (context=0x562c6a0d7060, block=block at entry=1, dispatch=dispatch at entry=1, self=<optimized out>) at ../../../glib/gmain.c:4131
   [Error: gmain.c was not found in source tree]
 #11 0x00007f3250955db3 in g_main_loop_run (loop=0x562c6a1dc430) at ../../../glib/gmain.c:4329
   [Error: gmain.c was not found in source tree]
 #12 0x00007f325104a17d in gtk_main () at ../../../../gtk/gtkmain.c:1329
   [Error: gtkmain.c was not found in source tree]
 #13 0x0000562c680f40f5 in main (argc=<optimized out>, argv=<optimized out>) at update-notifier.c:649
   644: 	monitor_init (un);
   645: 
   646: 	/* Start the main gtk loop */
   647: 	g_unix_signal_add_full (G_PRIORITY_DEFAULT, SIGINT, sigint_cb,
   648: 				NULL, NULL);
   649: 	gtk_main ();
   650: 
   651: 	return 0;
   652: }

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1926298

Title:
  Segfault added in the recent changes

Status in update-notifier package in Ubuntu:
  Confirmed
Status in update-notifier source package in Hirsute:
  New

Bug description:
  The issue is new using https://code.launchpad.net/~dbungert/update-
  notifier/+git/update-notifier/+merge/397367 , the previous revision
  didn't have the issue

  * Create a file 'bug'

  'Name: bug
  Priority: Low
  Command: "/bin/true"
  DisplayIf: /bin/true
  Description: update notifier bug'

  and copy it to /var/lib/update-notifier/user.d

  ->  update-notifier segfaults

  (gdb) bt
  #0  0x00007ffff718c769 in __GI___libc_free (mem=0x5550000aa7f9) at malloc.c:3288
  #1  0x00007ffff7365215 in g_strfreev (str_array=<optimized out>) at ../../../glib/gstrfuncs.c:2553
  #2  g_strfreev (str_array=0x5555555d9e00) at ../../../glib/gstrfuncs.c:2546
  #3  0x000055555555dd2d in hook_command_exists (cmd=0x555555702600 "\"/usr/bin/eog\"") at hooks.c:137
  #4  0x000055555555fd6e in is_hook_relevant (hook_file=0x555555829e7b "apt-file.update-notifier")
      at hooks.c:717
  #5  0x000055555555ffb1 in check_update_hooks (ta=0x5555556c9a20) at hooks.c:781
  #6  0x0000555555560715 in hook_tray_icon_init (ta=0x5555556c9a20) at hooks.c:969
  #7  0x000055555555cd77 in tray_icons_init (un=0x55555562c3e0, 

  
  It seems likely to be the error on top of the weekly report for hirsute but that's missing a stacktrace

  
  One comment in addition on the change there, was the env split + iterate over pathdirs basically a re-implementation of https://developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-find-program-in-path ? If there is particular reason to do that I would recommend just using the glib function instead (which might also fix the issue as a side effect, I didn't check)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/1926298/+subscriptions



More information about the Ubuntu-sponsors mailing list