[Gtk2-perl-bugs] [Bug 574306] New: gperl_callback_invoke() reference leak

View: New views
8 Messages — Rating Filter:   Alert me  

[Gtk2-perl-bugs] [Bug 574306] New: gperl_callback_invoke() reference leak

by Bugzilla from bugzilla-daemon@bugzilla.gnome.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=574306

  gnome-perl | Glib | Ver: unspecified
           Summary: gperl_callback_invoke() reference leak
           Product: gnome-perl
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: Glib
        AssignedTo: gtk2-perl-bugs@...
        ReportedBy: user42@...
         QAContact: gtk2-perl-bugs@...
     GNOME version: Unspecified
   GNOME milestone: Unspecified


With the current cvs and debian i386 perl 5.10.0, in the additions to GtkHBox.t
below the last test case fails.

The two new tests ask that a label widget is destroyed when weakened, after
it's been added to and removed from the box.  The first test succeeds, but the
second test, where the label has also been subject to a $box->foreach, fails.

Some digging suggests gperl_callback_invoke() is incrementing the C-side
ref_count, ie. g_object_ref(), and never unreffing.  I believe it may be due to
not having g_value_unset(), per change below.

I don't think anywhere in Glib-Perl itself puts objects through GPerlCallback,
to exercise the problem, hence a test case only for gtk.  I noticed it with
GtkTreeModelFilter when calling out to a "modify" function, but
gtk_container_foreach() is a much simpler failing example.


--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=574306.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Gtk2-perl-bugs mailing list
Gtk2-perl-bugs@...
https://lists.sourceforge.net/lists/listinfo/gtk2-perl-bugs

[Gtk2-perl-bugs] [Bug 574306] gperl_callback_invoke() reference leak

by Bugzilla from bugzilla-daemon@bugzilla.gnome.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=574306

  gnome-perl | Glib | Ver: unspecified




------- Comment #1 from Kevin Ryde  2009-03-05 21:12 UTC -------
Created an attachment (id=130154)
 --> (http://bugzilla.gnome.org/attachment.cgi?id=130154&action=view)
failing .t case


--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=574306.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Gtk2-perl-bugs mailing list
Gtk2-perl-bugs@...
https://lists.sourceforge.net/lists/listinfo/gtk2-perl-bugs

[Gtk2-perl-bugs] [Bug 574306] gperl_callback_invoke() reference leak

by Bugzilla from bugzilla-daemon@bugzilla.gnome.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=574306

  gnome-perl | Glib | Ver: unspecified




------- Comment #2 from Kevin Ryde  2009-03-05 21:14 UTC -------
Created an attachment (id=130155)
 --> (http://bugzilla.gnome.org/attachment.cgi?id=130155&action=view)
patch for gperl_callback_invoke()


--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=574306.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Gtk2-perl-bugs mailing list
Gtk2-perl-bugs@...
https://lists.sourceforge.net/lists/listinfo/gtk2-perl-bugs

[Gtk2-perl-bugs] [Bug 574306] gperl_callback_invoke() reference leak

by Bugzilla from bugzilla-daemon@bugzilla.gnome.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=574306

  gnome-perl | Glib | Ver: unspecified

Torsten Schoenfeld changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kaffeetisch@...
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED




------- Comment #3 from Torsten Schoenfeld  2009-03-08 18:45 UTC -------
Wow, that's a gigantic leak.  Patch committed, thanks!


--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=574306.

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Gtk2-perl-bugs mailing list
Gtk2-perl-bugs@...
https://lists.sourceforge.net/lists/listinfo/gtk2-perl-bugs

[Gtk2-perl-bugs] [Bug 574306] gperl_callback_invoke() reference leak

by Bugzilla from bugzilla-daemon@bugzilla.gnome.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=574306

  gnome-perl | Glib | Ver: unspecified




------- Comment #4 from Kevin Ryde  2009-03-10 00:26 UTC -------
I had moved the GValue variable out of the loop since g_value_unset() clears it
to zeros, no need for a fresh initializer to do that ... which may save 2
nanoseconds.


--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=574306.

------------------------------------------------------------------------------
_______________________________________________
Gtk2-perl-bugs mailing list
Gtk2-perl-bugs@...
https://lists.sourceforge.net/lists/listinfo/gtk2-perl-bugs

[Gtk2-perl-bugs] [Bug 574306] gperl_callback_invoke() reference leak

by Bugzilla from bugzilla-daemon@bugzilla.gnome.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=574306

  gnome-perl | Glib | Ver: unspecified




------- Comment #5 from Torsten Schoenfeld  2009-03-28 10:46 UTC -------
I didn't apply that part of the patch because it didn't seem related to the
leak.

Do you think it's worth applying the change now, given the decrease in
readability it entails?   (The variable is declared farther from where it's
used, and it's not obvious that g_value_unset zero-fills the value, even though
it's documented.)


--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=574306.

------------------------------------------------------------------------------
_______________________________________________
Gtk2-perl-bugs mailing list
Gtk2-perl-bugs@...
https://lists.sourceforge.net/lists/listinfo/gtk2-perl-bugs

[Gtk2-perl-bugs] [Bug 574306] gperl_callback_invoke() reference leak

by Bugzilla from bugzilla-daemon@bugzilla.gnome.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=574306

  gnome-perl | Glib | Ver: unspecified




------- Comment #6 from Kevin Ryde  2009-03-29 23:55 UTC -------
So much of glib/gtk is poorly documented it makes you want to use the things
that are documented! :-)  I get the impression set/unset/set/unset is the
intended pattern for a given GValue location.


--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=574306.

------------------------------------------------------------------------------
_______________________________________________
Gtk2-perl-bugs mailing list
Gtk2-perl-bugs@...
https://lists.sourceforge.net/lists/listinfo/gtk2-perl-bugs

[Gtk2-perl-bugs] [Bug 574306] gperl_callback_invoke() reference leak

by Bugzilla from bugzilla-daemon@bugzilla.gnome.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If you have any questions why you received this email, please see the text at
the end of this email. Replies to this email are NOT read, please see the text
at the end of this email. You can add comments to this bug at:
  http://bugzilla.gnome.org/show_bug.cgi?id=574306

  gnome-perl | Glib | Ver: unspecified

Torsten Schoenfeld changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #130154|none                        |committed
               Flag|                            |
 Attachment #130155|none                        |committed
               Flag|                            |




------- Comment #7 from Torsten Schoenfeld  2009-06-06 17:44 UTC -------
OK, I just committed the optimization part of your original patch.


--
See http://bugzilla.gnome.org/page.cgi?id=email.html for more info about why you received
this email, why you can't respond via email, how to stop receiving
emails (or reduce the number you receive), and how to contact someone
if you are having problems with the system.

You can add comments to this bug at http://bugzilla.gnome.org/show_bug.cgi?id=574306.

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Gtk2-perl-bugs mailing list
Gtk2-perl-bugs@...
https://lists.sourceforge.net/lists/listinfo/gtk2-perl-bugs