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 567685 - TreeModel iter stamp sign extension on int==32bit long==64bit
TreeModel iter stamp sign extension on int==32bit long==64bit
Status: RESOLVED OBSOLETE
Product: gnome-perl
Classification: Bindings
Component: Gtk2
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk2-perl-bugs
gtk2-perl-bugs
Depends on:
Blocks:
 
 
Reported: 2009-01-13 23:16 UTC by Kevin Ryde
Modified: 2021-07-05 12:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kevin Ryde 2009-01-13 23:16:03 UTC
On an int==32bits long==64bits system I believe the TreeModel bindings in a couple of places sign extend the GtkTreeIter stamp value but in others zero extend it when making an IV.

I noticed this in cpantesters reports about one of my models where I had foolishly made a stamp potentially >= 0x8000_0000.  The following might exhibit the problem,

use strict;
use warnings;
use Gtk2;

my $stamp = 0x8000_0000;
print "intended stamp $stamp\n";

my $iter = Gtk2::TreeIter->new_from_arrayref ([$stamp,0,undef,undef]);
my $aref = $iter->to_arrayref ($stamp);

print "aref got stamp ", $aref->[0], "\n";


If the stamp is meant to be treated as unsigned (which does seem easiest to me, though it's actually a signed gint) then a cast in sv_from_iter() might be needed [untested],

    av_push (av, newSVuv ((guint) iter->stamp));

and along the same lines probably in the compare done by to_arrayref, to truncate

    if (iter->stamp != (gint) stamp)
Comment 1 GNOME Infrastructure Team 2021-07-05 12:22:17 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME?utf8=%E2%9C%93&filter=perl-

Thank you for your understanding and your help.