[MacPorts] #65743: cherrytree @0.99.48: crash on launch

MacPorts noreply at macports.org
Fri Sep 16 06:53:01 UTC 2022


#65743: cherrytree @0.99.48: crash on launch
-------------------------+----------------------
  Reporter:  afield1235  |      Owner:  mascguy
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.7.2
Resolution:              |   Keywords:
      Port:  cherrytree  |
-------------------------+----------------------

Comment (by kencu):

 I assume you have updated and are getting the version of cherrytree that
 is patched. You can search for the patch being applied to be 100% sure you
 have it.

 By the way, I believe that the crash at the very end of running the
 program is caused by the {{{[gtk] [critical]
 Class::register_derived_type(): base_query.type_name is NULL.}}} issue,
 where during initialization, it appears that one (or more) of the gtk3
 type registrations is failing.

 I traced it like this, using lldb:

 {{{
 (lldb) breakpoint set --file class.cc --line 71
 Breakpoint 6: where =
 libglibmm-2.4.1.dylib`Glib::Class::register_derived_type(unsigned long,
 _GTypeModule*) + 166 at class.cc:71:5, address = 0x0000000108048b76
 (lldb) c
 Process 67660 resuming
 Process 67660 stopped
 * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 6.1
     frame #0: 0x0000000108048b76
 libglibmm-2.4.1.dylib`Glib::Class::register_derived_type(this=0x0000000106f4d160,
 base_type=105553156123712, module=0x0000000000000000) at class.cc:71:5
    68
    69     if (!(base_query.type_name))
    70     {
 -> 71       g_critical("Class::register_derived_type():
 base_query.type_name is NULL.");
    72       return;
    73     }
    74
 Target 0: (cherrytree) stopped.
 (lldb) bt
 * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 6.1
   * frame #0: 0x0000000108048b76
 libglibmm-2.4.1.dylib`Glib::Class::register_derived_type(this=0x0000000106f4d160,
 base_type=105553156123712, module=0x0000000000000000) at class.cc:71:5
     frame #1: 0x0000000108048ac1
 libglibmm-2.4.1.dylib`Glib::Class::register_derived_type(this=0x0000000106f4d160,
 base_type=105553156123712) at class.cc:30:10
     frame #2: 0x0000000106f34902
 libgtksourceviewmm-3.0.0.dylib`Gsv::StyleSchemeChooser_Class::init(this=0x0000000106f4d160)
 at styleschemechooser.cc:63:5
     frame #3: 0x0000000106f34f00
 libgtksourceviewmm-3.0.0.dylib`Gsv::StyleSchemeChooser::get_type() at
 styleschemechooser.cc:128:36
     frame #4: 0x0000000106f3b6bb
 libgtksourceviewmm-3.0.0.dylib`Gsv::wrap_init() at wrap_init.cc:159:3
     frame #5: 0x0000000106f3b6fb
 libgtksourceviewmm-3.0.0.dylib`Gsv::init() at init.cc:36:5
     frame #6: 0x00000001002f501a
 cherrytree`CtApp::CtApp(this=0x00000001097066b0,
 application_id_postfix=(string_ = "")) at ct_app.cc:35:5
     frame #7: 0x00000001002f53e3
 cherrytree`CtApp::create(application_id_postfix=(string_ = "")) at
 ct_app.cc:54:36
     frame #8: 0x000000010000fcaf cherrytree`main(argc=1,
 argv=0x00007ff7bfeff8d8) at ct_main.cc:128:33
     frame #9: 0x00000001057a952e dyld`start + 462
 (lldb) frame var
 (Glib::Class *) this = 0x0000000106f4d160
 (GType) base_type = 105553156123712
 (GTypeModule *) module = nullptr
 (GTypeQuery) base_query = (type = 0, type_name = 0x0000000000000000,
 class_size = 0, instance_size = 0)
 (const guint16) class_size = 0
 (const guint16) instance_size = 0
 (const GTypeInfo) derived_info = {
   class_size = 0
   base_init = 0x0000000000000000
   base_finalize = 0x0000000000000000
   class_init = 0x0000000106f34910
 (libgtksourceviewmm-3.0.0.dylib`Gsv::StyleSchemeChooser_Class::class_init_function(void*,
 void*) at styleschemechooser.cc:74)
   class_finalize = 0x0000000000000000
   class_data = 0x0000000000000000
   instance_size = 0
   n_preallocs = 0
   instance_init = 0x0000000000000000
   value_table = nullptr
 }
 (gchar *) derived_name = 0x0000600000218260 "`\x82\x8cޭ\xbe"
 (lldb) frame sel 1
 frame #1: 0x0000000108048ac1
 libglibmm-2.4.1.dylib`Glib::Class::register_derived_type(this=0x0000000106f4d160,
 base_type=105553156123712) at class.cc:30:10
    27   void
    28   Class::register_derived_type(GType base_type)
    29   {
 -> 30     return register_derived_type(base_type, nullptr);
    31   }
    32
    33   void
 (lldb) frame var
 (Glib::Class *) this = 0x0000000106f4d160
 (GType) base_type = 105553156123712
 (lldb) frame sel 2
 frame #2: 0x0000000106f34902
 libgtksourceviewmm-3.0.0.dylib`Gsv::StyleSchemeChooser_Class::init(this=0x0000000106f4d160)
 at styleschemechooser.cc:63:5
    60       //CppClassParent::CppObjectType::get_type();
    61
    62       // Create the wrapper type, with the same class/instance size
 as the base type.
 -> 63
 register_derived_type(gtk_source_style_scheme_chooser_get_type());
    64
    65       // Add derived versions of interfaces, if the C type
 implements any interfaces:
    66
 (lldb) frame var
 (Gsv::StyleSchemeChooser_Class *) this = 0x0000000106f4d160
 (lldb) frame sel 3
 frame #3: 0x0000000106f34f00
 libgtksourceviewmm-3.0.0.dylib`Gsv::StyleSchemeChooser::get_type() at
 styleschemechooser.cc:128:36
    125
    126  GType StyleSchemeChooser::get_type()
    127  {
 -> 128    return styleschemechooser_class_.init().get_type();
    129  }
    130
    131
 (lldb) frame var
 (lldb) frame sel 4
 frame #4: 0x0000000106f3b6bb
 libgtksourceviewmm-3.0.0.dylib`Gsv::wrap_init() at wrap_init.cc:159:3
    156    SearchSettings::get_type();
    157    Style::get_type();
    158    StyleScheme::get_type();
 -> 159    StyleSchemeChooser::get_type();
    160    StyleSchemeChooserButton::get_type();
    161    StyleSchemeChooserWidget::get_type();
    162    StyleSchemeManager::get_type();
 (lldb) frame var
 (lldb) frame sel 5
 frame #5: 0x0000000106f3b6fb libgtksourceviewmm-3.0.0.dylib`Gsv::init() at
 init.cc:36:5
    33     if (!s_init)
    34     {
    35       Gtk::Main::init_gtkmm_internals () ;
 -> 36       Gsv::wrap_init () ;
    37       s_init = true ;
    38     }
    39   }
 }}}


 Now I know that all looks probably quite confusing, but basically this
 call:

 {{{
 register_derived_type(gtk_source_style_scheme_chooser_get_type());
 }}}
 is not supposed to return NULL, it is supposed to find a type that matches
 this selector {{{gtk_source_style_scheme_chooser_get_type}}} and register
 it.

 I am not a gtk3 expert, but the class documentation is here <https://gjs-
 docs.gjsify.org/classes/GtkSource_3_0.GtkSource.StyleSchemeChooser.html>
 and it should answer to that call, so at the moment I'm somewhat uncertain
 about why it is not.

 Perhaps all our gtk infrastructure need to be updated to current versions
 -- most of it is unfortunately very out of date. I rebuilt them all from
 source, so it's not just a matter of them needing to be rebuilt against
 new headers.

-- 
Ticket URL: <https://trac.macports.org/ticket/65743#comment:26>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list