After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 567653 - signal_chain_from_overridden vs do_mysig
signal_chain_from_overridden vs do_mysig
Status: RESOLVED FIXED
Product: gnome-perl
Classification: Bindings
Component: Glib
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2009-01-13 20:46 UTC by Kevin Ryde
Modified: 2009-03-01 23:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kevin Ryde 2009-01-13 20:46:25 UTC
In perl-Glib 1.200 The program below gets two errors

GLib-CRITICAL **: g_hash_table_lookup: assertion `hash_table != NULL' failed at foo.pl line 36.
*** unhandled exception in callback:
***   [gperl_value_from_sv] FIXME: unhandled type - 0 ((null) fundamental for (null))
***  ignoring at foo.pl line 44.

I expect it's the "do_" default handler of gperl_signal_class_closure_marshal, but g_signal_chain_from_overridden in GSignal.xs might like to consider passing return_value==NULL (instead of a GValue of G_TYPE_NONE) when the signal return type is none (query.return_type == G_TYPE_NONE).


package MyClass;
use strict;
use warnings;
use Glib;

use Glib::Object::Subclass
  'Glib::Object',
  signals => { mysig => { param_types => [],
                          return_type => undef },
             };

sub INIT_INSTANCE {
  my ($self) = @_;
}

sub do_mysig {
  print "MyClass mysig runs\n";
  return 123;
}


package MySubClass;
use strict;
use warnings;

use Glib::Object::Subclass
  'MyClass',
  signals => { mysig => \&_do_mysubclass_mysig };

sub INIT_INSTANCE {
  my ($self) = @_;
}

sub _do_mysubclass_mysig {
  my ($self) = @_;
  $self->signal_chain_from_overridden;
}

package main;
use strict;
use warnings;

my $obj = MySubClass->new;
$obj->signal_emit ('mysig');
exit 0;
Comment 1 Torsten Schoenfeld 2009-02-05 16:39:47 UTC
This is now fixed in trunk (r1078:1080) and in the stable branch (r1081).
Comment 2 Kevin Ryde 2009-02-06 23:26:17 UTC
Actually the point of this ticket was the latter part, ie. that the signal_chain_from_overridden() method might pass return_value==NULL to g_signal_chain_from_overridden() when the signal return type is G_TYPE_NONE.  Doing so would be like a normal emission, per g_signal_emit_valist() lines

  if (signal_return_type == G_TYPE_NONE)
    signal_emit_unlocked_R (node, detail, instance, NULL, instance_and_params);
Comment 3 Torsten Schoenfeld 2009-02-10 13:36:32 UTC
Sorry, I missed that part.  I'm not sure what implications this change would have.  Do you have an example where the change has an effect?
Comment 4 Kevin Ryde 2009-03-01 23:40:05 UTC
Umm, no.  I was hoping the gsignal docs might say if G_TYPE_NONE is meant to be ok.  I suppose if GtkBindings does that then it can't be too terrible.  

"When the president does it it's not illegal."