Gtkmm-forge Digest, Vol 30, Issue 18



Send Gtkmm-forge mailing list submissions to
	gtkmm-forge lists sourceforge net

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.sourceforge.net/lists/listinfo/gtkmm-forge
or, via email, send a message with subject or body 'help' to
	gtkmm-forge-request lists sourceforge net

You can reach the person managing the list at
	gtkmm-forge-owner lists sourceforge net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Gtkmm-forge digest..."


gtkmm-forge is the mailing list that receives gtkmm bug reports from bugzilla.  A daily digest is sent to gtkmm-main, to encourage people to help fixing the bugs. Do not try to unsubscribe gtkmm-forge from gtkmm-list.


Today's Topics:

   1. [Bug 556570] Version 0.9.7 fails to build due to	call to
      ``GstBase::wrap_init()'' in gstreamer/gstreamermm/init.cc
      (gnomemm (bugzilla.gnome.org))
   2. [Bug 556570] Version 0.9.7 fails to build due to	call to
      ``GstBase::wrap_init()'' in gstreamer/gstreamermm/init.cc
      (gnomemm (bugzilla.gnome.org))
   3. [Bug 560074] example doesn't build with cairomm	1.7.0
      (gnomemm (bugzilla.gnome.org))
   4. [Bug 561885] New: Glib::Source - mistunderstanding	of the
      'destroy' from C GSource -> bad impl + memory problems?
      (glibmm (bugzilla.gnome.org))
   5. [Bug 561885] Glib::Source - mistunderstanding of	the
      'destroy' from C GSource -> bad impl + memory problems?
      (glibmm (bugzilla.gnome.org))
   6. [Bug 561884] New: Glibmm::Source - wrong impl. of
      [un]reference - dating Jan 2006? (glibmm (bugzilla.gnome.org))


----------------------------------------------------------------------

Message: 1
Date: Tue, 18 Nov 2008 22:57:57 +0000 (UTC)
From: "gnomemm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 556570] Version 0.9.7 fails to build
	due to	call to ``GstBase::wrap_init()'' in
	gstreamer/gstreamermm/init.cc
To: gtkmm-forge lists sourceforge net
Message-ID: <20081118225757 2BBEF23F510 label gnome org>
Content-Type: text/plain; charset=utf-8

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=556570

  gnomemm | gstreamermm | Ver: unspecified

Jos? Alburquerque changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|WONTFIX                     |




-- 
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=556570.



------------------------------

Message: 2
Date: Tue, 18 Nov 2008 23:01:47 +0000 (UTC)
From: "gnomemm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 556570] Version 0.9.7 fails to build
	due to	call to ``GstBase::wrap_init()'' in
	gstreamer/gstreamermm/init.cc
To: gtkmm-forge lists sourceforge net
Message-ID: <20081118230147 84B5B23F512 label gnome org>
Content-Type: text/plain; charset=utf-8

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=556570

  gnomemm | gstreamermm | Ver: unspecified

Jos? Alburquerque changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED




------- Comment #15 from Jos? Alburquerque  2008-11-18 23:01 UTC -------
A fix for this came up because of a recent bug[1] so I'm marking this as fixed.
 Deng, thanks for taking the time to report this and suggest a fix.  You can
now use the options that were not possible because of this bug.  Thanks again.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=560601


-- 
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=556570.



------------------------------

Message: 3
Date: Wed, 19 Nov 2008 03:18:18 +0000 (UTC)
From: "gnomemm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 560074] example doesn't build with
	cairomm	1.7.0
To: gtkmm-forge lists sourceforge net
Message-ID: <20081119031818 268B623F513 label gnome org>
Content-Type: text/plain; charset=utf-8

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=560074

  gnomemm | goocanvasmm | Ver: unspecified

Jonathon Jongsma (jonner) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #122972|none                        |committed
               Flag|                            |
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED




------- Comment #6 from Jonathon Jongsma (jonner)  2008-11-19 03:18 UTC -------
committed as-is for now.  r1804


-- 
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=560074.



------------------------------

Message: 4
Date: Sat, 22 Nov 2008 01:46:46 +0000 (UTC)
From: "glibmm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 561885] New: Glib::Source -
	mistunderstanding	of the 'destroy' from C GSource -> bad impl + memory
	problems?
To: gtkmm-forge lists sourceforge net
Message-ID: <bug-561885-5595 http bugzilla gnome org/>
Content-Type: text/plain; charset=utf-8

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=561885

  glibmm | general | Ver: 2.18.x
           Summary: Glib::Source - mistunderstanding of the 'destroy' from C
                    GSource -> bad impl + memory problems?
           Product: glibmm
           Version: 2.18.x
          Platform: Other
        OS/Version: All
            Status: UNCONFIRMED
          Severity: major
          Priority: Normal
         Component: general
        AssignedTo: gtkmm-forge lists sourceforge net
        ReportedBy: cristi posoiu gmail com
         QAContact: gtkmm-forge lists sourceforge net
     GNOME version: 2.23/2.24
   GNOME milestone: Unspecified


Please describe the problem:
I posted first bug 561884, but digging more I got into what seems to me, bigger
other problems.
Looking at the code of Glib::RefPtr and Glib::Source::~Source I think I saw
something problematic so I ran the same simple C++ program under 'valgrind'. As
expected, memory access problems (accessing the same C++ object which was
already freed)
Checking into the code of both Glib::Source and C GSource I think there is a
misunderstanding over the 'destroy' notification from C GSource.
It seems that the 'destroy' notification has nothing to do w/ reference
counting of the GSource itself but with the fact that the 'attachment' to a
context is actually destroyed. So, in Glib::Source there shouldn't be a
correlation when the notify/destroy callback is called and the destroying of
the C++ Glib::Source object itself. I think that Glib::Source object destroying
should be done completely different (seems that it might not be a derivation of
g_object (why!?) but you still have a 'finalize' callback to use when ref
counting goes to 0.


Steps to reproduce:
run under valgrind, the following c++ program (see in it how to compile it),
once as is, and once after changing the "#if 0":

#include <glibmm.h>

// g++ -g `pkg-config --cflags glibmm-2.4` `pkg-config --libs glibmm-2.4` 
t.cpp
// bug 1: 561884 

static bool on_t1(Glib::RefPtr<Glib::MainLoop> l)
{
        printf("timer 1\n");
        l->quit();
        return FALSE;
}


int main(int argc, char *argv[])
{
        Glib::init();

        Glib::RefPtr<Glib::MainLoop> loop(Glib::MainLoop::create());

        Glib::RefPtr<Glib::TimeoutSource> t1;

        t1 = Glib::TimeoutSource::create(1000);
        t1->connect(sigc::bind(sigc::ptr_fun(on_t1), loop));
        t1->attach();
#if 0
        t1->reference();t1->reference();t1->reference();
#endif
        loop->run();
        printf("ending loop (timer 1=%p)\n", t1->gobj());
        t1.clear();
        return 0;
}


Actual results:
valgrind: memory access to already freed data

Expected results:
no memory access problems. no immediate destroy of the Glib::TimeoutSource in
case it has enough of a big ref count.


Does this happen every time?
yes

Other information:
no patch this time :-/


-- 
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=561885.



------------------------------

Message: 5
Date: Sat, 22 Nov 2008 01:48:58 +0000 (UTC)
From: "glibmm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 561885] Glib::Source -
	mistunderstanding of	the 'destroy' from C GSource -> bad impl + memory
	problems?
To: gtkmm-forge lists sourceforge net
Message-ID: <20081122014858 0BC4B23F513 label gnome org>
Content-Type: text/plain; charset=utf-8

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=561885

  glibmm | general | Ver: 2.18.x




------- Comment #1 from Cristi Posoiu  2008-11-22 01:48 UTC -------
Oops, correction to indroduction part: I came to see these problems after
reading source of Glib::RefPtr and Glib::Source::destroy_notify_callback -
instead of destructor of Source.


-- 
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=561885.



------------------------------

Message: 6
Date: Sat, 22 Nov 2008 01:31:27 +0000 (UTC)
From: "glibmm (bugzilla.gnome.org)"
	<bugzilla-daemon bugzilla gnome org>
Subject: [gtkmm bugzilla] [Bug 561884] New: Glibmm::Source - wrong
	impl. of	[un]reference - dating Jan 2006?
To: gtkmm-forge lists sourceforge net
Message-ID: <bug-561884-5595 http bugzilla gnome org/>
Content-Type: text/plain; charset=utf-8

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=561884

  glibmm | io | Ver: 2.18.x
           Summary: Glibmm::Source - wrong impl. of [un]reference - dating
                    Jan 2006?
           Product: glibmm
           Version: 2.18.x
          Platform: Other
        OS/Version: All
            Status: UNCONFIRMED
          Severity: critical
          Priority: Normal
         Component: io
        AssignedTo: gtkmm-forge lists sourceforge net
        ReportedBy: cristi posoiu gmail com
         QAContact: gtkmm-forge lists sourceforge net
     GNOME version: 2.23/2.24
   GNOME milestone: Unspecified


Please describe the problem:
I need to start a timer (Glib::TimeoutSource) but be able to stop it before it
necessarily signals. So I have to call destroy() (just unrefering my timer
pointer won't stop the timer).
On the other hand, I'm reusing the same Glib::RefPtr variable. And I'll get 
GLib-CRITICAL **: g_source_unref: assertion `source != NULL' failed

Seems to be the same thing discussed even here (Jan 2006) ? :
http://markmail.org/message/7shyxixmeevv7ojw#query:glibmm timeoutsource
still+page:1+mid:smh2eorgiblrpqrz+state:results

Looking at code, it seems the problem might be the bogus implementation of
GLib::Source::[un]reference(): they blindly say to unreference gobject_ while,
since a destroy might have been called, the  variable gets to be 0 (from
Source's destructor). And the unreference function is called by destructor/swap
inside Glib::RefPtr.


Steps to reproduce:
Code, not showing my exact problem... but, still: (see comment on how to
compile):

#include <glibmm.h>

// g++ -g `pkg-config --cflags glibmm-2.4` `pkg-config --libs glibmm-2.4` 
t.cpp


static bool on_t1(Glib::RefPtr<Glib::MainLoop> l)
{
        printf("timer 1\n");
        l->quit();
        return FALSE;
}


int main(int argc, char *argv[])
{
        Glib::init();

        Glib::RefPtr<Glib::MainLoop> loop(Glib::MainLoop::create());

        Glib::RefPtr<Glib::TimeoutSource> t1;

        t1 = Glib::TimeoutSource::create(1000);
        t1->connect(sigc::bind(sigc::ptr_fun(on_t1), loop));
        t1->attach();

        loop->run();
        printf("ending loop (timer 1=%p)\n", t1->gobj());
        t1.clear();
        return 0;
}


Actual results:
Get an assertion failure:
GLib-CRITICAL **: g_source_unref: assertion `source != NULL' failed

Expected results:
to not have the assertion failure :)

Does this happen every time?
yes

Other information:
Patch is simple: modify Glib::[un]reference to do ref/unref only if gobject_ is
not 0/NULL. Well, I guess gobj_copy() as well. But most critical is
unreference()

Last minute update: ay.. there seem to be bigger problems in there, w/ C
GSource mistunderstanding and destroy, and memory access. Will post another bug
:-( (which will probably make "obsolete" this bug.


-- 
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=561884.



------------------------------

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

------------------------------

_______________________________________________
Gtkmm-forge mailing list
Gtkmm-forge lists sourceforge net
https://lists.sourceforge.net/lists/listinfo/gtkmm-forge


End of Gtkmm-forge Digest, Vol 30, Issue 18
*******************************************


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]