Skip Menu |

This queue is for tickets about the Gnome2-Canvas CPAN distribution.

Report information

Subject: Gnome2-Canvas - large rectangles are broken?
Date: Sat, 20 Jan 2007 03:06:28 +0300 (MSK)
To: bug-Gnome2-Canvas [...] rt.cpan.org
From: Dmitry Samborsky <samborsky_d [...] yahoo.com>
Hello, I've found rather strange malfunction of the Gnome canvas. If I modify canvas.pl demo enlarging "mediumseagreen" rectangle to ~33000 width it just becomes broken. See the attached patch to the canvas-primitives.pl file. I've tried to reproduce the same bug in C, but I didn't succeed in that (the rectangle was drawn properly). Apparently, this is a problem of Perl XS interface? Many thanks in advance! Best Regards, Dmitry Samborskiy P.S. Below there is some info about my test environment. I took the most recent CPAN modules in order to check that the problem is not solved yet. This is output from 'perl canvas.pl' (see below the version output): GLib-GObject-CRITICAL **: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed at canvas-primitives.pl line 470. GLib-GObject-CRITICAL **: g_param_spec_boxed: assertion `G_TYPE_IS_BOXED (boxed_type)' failed at canvas-primitives.pl line 470. GLib-GObject-CRITICAL **: g_object_class_install_property: assertion `G_IS_PARAM_SPEC (pspec)' failed at canvas-primitives.pl line 470. GLib-GObject-WARNING **: IA__g_object_set_valist: object class `GnomeCanvasBpath' has no property named `bpath' at canvas-primitives.pl line 475. GLib-GObject-WARNING **: IA__g_object_set_valist: object class `GnomeCanvasBpath' has no property named `bpath' at canvas-primitives.pl line 475. Gtk2::VERSION = 1.141, Glib::VERSION = 1.142 Gnome2::VERSION = 1.041, Gnome2::Canvas::VERSION = 1.002 Gtk2::VERSION = 1.141, Glib::VERSION = 1.142 Gnome2::VERSION = 1.041, Gnome2::Canvas::VERSION = 1.002 I use Fedora Core 4. My Gtk/Gnome libs versions are (libgnomecanvas RPM was built from SRPM by myself): $ rpm -q gtk2 glib2 libgnome libgnomecanvas gtk2-2.6.10-2.fc4.4 glib2-2.6.6-1 libgnome-2.10.0-3 libgnomecanvas-2.14.0-4.1 Show quoted text
________________________________________________________ Вы уже с Yahoo!? Испытайте обновленную и улучшенную. Yahoo! Почту! http://ru.mail.yahoo.com
--- canvas-primitives.pl.orig 2004-03-21 07:16:47.000000000 +0300 +++ canvas-primitives.pl 2007-01-20 02:37:23.000000000 +0300 @@ -167,7 +167,7 @@ 'Gnome2::Canvas::Rect', x1 => 90.0, y1 => 40.0, - x2 => 180.0, + x2 => 33000.0, # that triggers a bug, rectangle is broken! y2 => 100.0, fill_color => "mediumseagreen", fill_stipple => $stipple, @@ -557,9 +557,14 @@ return TRUE; } +use Gnome2; + sub create { my $aa = shift; + printf "Gtk2::VERSION = %s, Glib::VERSION = %s\nGnome2::VERSION = %s, Gnome2::Canvas::VERSION = %s\n", + $Gtk2::VERSION, $Glib::VERSION, $Gnome2::VERSION, $Gnome2::Canvas::VERSION; + my $vbox = Gtk2::VBox->new (FALSE, 4); $vbox->set_border_width (4); $vbox->show; @@ -647,7 +652,7 @@ $frame->show; $canvas->set_size_request (600, 450); - $canvas->set_scroll_region (0, 0, 600, 450); + $canvas->set_scroll_region (0, 0, 600000, 6000); $frame->add ($canvas); $canvas->show;
RT-Send-CC: scott [...] asofyet.org
Show quoted text
> I've found rather strange malfunction of the Gnome canvas. > If I modify canvas.pl demo enlarging "mediumseagreen" rectangle > to ~33000 width it just becomes broken. See the attached patch to > the canvas-primitives.pl file.
I see the "broken" rectangle too. Show quoted text
> I've tried to reproduce the same bug in C, but I didn't succeed > in that (the rectangle was drawn properly). > Apparently, this is a problem of Perl XS interface?
I'm unable to see any reason for the bindings to cause this. Could you provide a minimal but complete example in both C and Perl that reproduces the problem?
Subject: Re: [rt.cpan.org #24463] Gnome2-Canvas - large rectangles are broken?
Date: Sun, 21 Jan 2007 20:15:33 +0300 (MSK)
To: bug-Gnome2-Canvas [...] rt.cpan.org
From: Dmitry Samborsky <samborsky_d [...] yahoo.com>
--- Torsten Schц╤nfeld via RT <bug-Gnome2-Canvas@rt.cpan.org> wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=24463 > > > I'm unable to see any reason for the bindings to cause this.
Neither me. Show quoted text
> Could you > provide a minimal but complete example in both C and Perl that > reproduces the problem?
OK. See the *.pl and *.c files. In C I do exactly the same, but rectangle is not broken !? Sorry, I used gnome app. template for C variant (though, it shouldn't make a difference?). Many thanks in advance! Dmitry Show quoted text
________________________________________________________ Вы уже с Yahoo!? Испытайте обновленную и улучшенную. Yahoo! Почту! http://ru.mail.yahoo.com

Message body is not shown because sender requested not to inline it.

#include <gnome.h> /* our main function */ int main(int argc, char *argv[]) { GnomeApp *app; /* the main window pointer */ GnomeCanvas *canvas; /* the canvas */ GtkWidget *w; gnome_init("test", "1", argc, argv); app = GNOME_APP(gnome_app_new("test", "Test")); /* create a new canvas */ w = gnome_canvas_new(); canvas = GNOME_CANVAS(w); gnome_canvas_item_new(gnome_canvas_root(canvas), gnome_canvas_rect_get_type(), "x1", 90.0, "y1", 40.0, "x2", 33000.0, "y2", 100.0, "fill_color", "mediumseagreen", "outline_color", "black", "width_units", 4.0, NULL); /* set where can the canvas scroll (our usable area) */ gnome_canvas_set_scroll_region(canvas, 0.0, 0.0, 60000.0, 6000.0); /* set the contents of the app window to the canvas */ gnome_app_set_contents(GNOME_APP(app), w); gtk_widget_show_all(GTK_WIDGET(app)); gtk_main(); return 0; }
Download Makefile
application/octet-stream 148b

Message body not shown because it is not plain text.

Show quoted text
> > Could you > > provide a minimal but complete example in both C and Perl that > > reproduces the problem?
> > OK. See the *.pl and *.c files.
Thanks! Show quoted text
> In C I do exactly the same, but rectangle is not broken !?
Hmm, both program seem to produce exactly the same rectangle here. Screenshots attached. Are you sure that Gnome2::Canvas is linked against the same libraries you linked the C program against? You can find out which libraries Gnome2::Canvas is linked against by running ldd on Gnome2/Canvas.so. It should be in <prefix>/lib/perl/<perl-version>/auto/Gnome2/Canvas/Canvas.so
Download rect-perl.png
image/png 10.4k
rect-perl.png
Download rect-c.png
image/png 9.7k
rect-c.png
Subject: Re: [rt.cpan.org #24463] Gnome2-Canvas - large rectangles are broken?
Date: Mon, 22 Jan 2007 17:31:51 +0300 (MSK)
To: bug-Gnome2-Canvas [...] rt.cpan.org
From: Dmitry Samborsky <samborsky_d [...] yahoo.com>
<URL: http://rt.cpan.org/Ticket/Display.html?id=24463 > Show quoted text
> > In C I do exactly the same, but rectangle is not broken !?
> > Hmm, both program seem to produce exactly the same rectangle here. > Screenshots attached.
Oops. In your environment C test shows the problem also!? See my screenshot of huge_rect.c. Show quoted text
> Are you sure that Gnome2::Canvas is linked against the same libraries > you linked the C program against? You can find out which libraries > Gnome2::Canvas is linked against by running ldd on Gnome2/Canvas.so.
Gnome2/Canvas.so is linked against libgnomecanvas library: $ ldd Canvas.so linux-gate.so.1 => (0x00ae3000) libgnomecanvas-2.so.0 => /usr/lib/libgnomecanvas-2.so.0 (0x00747000) . . . $ rpm -qf /usr/lib/libgnomecanvas-2.so.0 libgnomecanvas-2.10.0-1 (I've restored the original RPM libgnomecanvas-2.10.0-1 from RH, but it didn't solve the problem.) But C program appears to be not linked to the libgnomecanvas at all!? May be dynamic loading is used at runtime (I'm not familiar with Gnome internals...). See the ldd output: $ ldd huge_rect linux-gate.so.1 => (0x008b1000) libgnomeui.so.32 => /usr/lib/libgnomeui.so.32 (0x00c77000) libart_lgpl.so.2 => /usr/lib/libart_lgpl.so.2 (0x00895000) libgdk_imlib.so.1 => /usr/lib/libgdk_imlib.so.1 (0x00137000) libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x00bd7000) libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x00bbb000) libgtk-1.2.so.0 => /usr/lib/libgtk-1.2.so.0 (0x02fd8000) libgdk-1.2.so.0 => /usr/lib/libgdk-1.2.so.0 (0x02f83000) libgmodule-1.2.so.0 => /usr/lib/libgmodule-1.2.so.0 (0x00db9000) libdl.so.2 => /lib/libdl.so.2 (0x00a7e000) libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x00101000) libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x00baa000) libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x00ad4000) libgnome.so.32 => /usr/lib/libgnome.so.32 (0x00824000) libgnomesupport.so.0 => /usr/lib/libgnomesupport.so.0 (0x0081c000) libesd.so.0 => /usr/lib/libesd.so.0 (0x03906000) libasound.so.2 => /lib/libasound.so.2 (0x02a59000) libaudiofile.so.0 => /usr/lib/libaudiofile.so.0 (0x02e22000) libm.so.6 => /lib/libm.so.6 (0x00a84000) libglib-1.2.so.0 => /usr/lib/libglib-1.2.so.0 (0x03132000) libc.so.6 => /lib/libc.so.6 (0x00953000) libdb.so.2 => /usr/lib/libdb.so.2 (0x0080b000) libz.so.1 => /usr/lib/libz.so.1 (0x00aab000) /lib/ld-linux.so.2 (0x00119000) libpthread.so.0 => /lib/libpthread.so.0 (0x00ac0000) I send you my binary huge_rect, may be it's runnable on your system (though, you may not run it if you're afraid of consequences)? Howevere, the problem is obviously on C level, but I still can't reproduce it in *.c test... What could you advice me for submitting the bug to developer.gnome.org ? Should I try to build a fresh TAR Gtk/Glib/Gnome/GnomeCanvas installation and make a test for the latest libs from gnome.org? I develope a sci. application for RedHat RHEL4 platform, therefore I have to use the most compatible Fedora Core version (which is FC4). And I already had some problems with RedHat libgnomecanvas-2.10.0-1 (it crashed on destroy stage). That's why I switched to libgnomecanvas-2.14 (which I have to install on customers' system manually which upsets their administrator). So, I would be happy to have a fixing patch for the libgnomecanvas-2.14 SRPM. Thank you very much. Regards, Dmitry Show quoted text
________________________________________________________ Вы уже с Yahoo!? Испытайте обновленную и улучшенную. Yahoo! Почту! http://ru.mail.yahoo.com
Download huge_rect_c.png
image/png 18.3k
huge_rect_c.png
Download huge_rect
application/octet-stream 26.6k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #24463] Gnome2-Canvas - large rectangles are broken?
Date: Mon, 22 Jan 2007 19:46:00 +0300 (MSK)
To: bug-Gnome2-Canvas [...] rt.cpan.org
From: Dmitry Samborsky <samborsky_d [...] yahoo.com>
--- Torsten Schц╤nfeld via RT <bug-Gnome2-Canvas@rt.cpan.org> wrote: Show quoted text
> Are you sure that Gnome2::Canvas is linked against the same libraries > you linked the C program against?
Sorry, now I know why it worked in my case: my Makefile links the C program against Gtk1/Gnome1 ! Do you know which tool I should use in Gnome2 environment instead of simple Gnome1 commands `gnome-config --cflags gnome gnomeui` `gnome-config --libs gnome gnomeui` for populating CFLAGS/LDFLAGS ? Or could you send me your Makefile/command line ? Thanks! Best wishes, Dmitry Show quoted text
________________________________________________________ Вы уже с Yahoo!? Испытайте обновленную и улучшенную. Yahoo! Почту! http://ru.mail.yahoo.com
Show quoted text
> Sorry, now I know why it worked in my case: my Makefile links > the C program against Gtk1/Gnome1 !
Oh, that might explain it. :-) Show quoted text
> Do you know which tool I should use in Gnome2 environment instead of > simple Gnome1 commands > > `gnome-config --cflags gnome gnomeui` > `gnome-config --libs gnome gnomeui` > > for populating CFLAGS/LDFLAGS ?
The tool pkg-config replaced all those -config scripts. To compile huge_rect.c, I used: gcc `pkg-config --cflags --libs libgnomeui-2.0` huge_rect.c -o huge_rect
Subject: Re: [rt.cpan.org #24463] Gnome2-Canvas - large rectangles are broken?
Date: Tue, 23 Jan 2007 01:00:54 +0300 (MSK)
To: bug-Gnome2-Canvas [...] rt.cpan.org
From: Dmitry Samborsky <samborsky_d [...] yahoo.com>
--- Torsten Schц╤nfeld via RT <bug-Gnome2-Canvas@rt.cpan.org> wrote: Show quoted text
> > Sorry, now I know why it worked in my case: my Makefile links > > the C program against Gtk1/Gnome1 !
> > Oh, that might explain it. :-) > . . .
Thank you for your prompt and helpful answers. I appreciate it very much. I've just submitted a bug report to libgnomecanvas: http://bugzilla.gnome.org/show_bug.cgi?id=399564 Therefore, you can close the [rt.cpan.org #24463] ticket. Best wishes, Dmitry Show quoted text
________________________________________________________ Вы уже с Yahoo!? Испытайте обновленную и улучшенную. Yahoo! Почту! http://ru.mail.yahoo.com
RT-Send-CC: muppet [...] asofyet.org
Show quoted text
> > > Sorry, now I know why it worked in my case: my Makefile links > > > the C program against Gtk1/Gnome1 !
> > > > Oh, that might explain it. :-) > > . . .
> > Thank you for your prompt and helpful answers. > I appreciate it very much.
You're welcome. Show quoted text
> I've just submitted a bug report to libgnomecanvas: > > http://bugzilla.gnome.org/show_bug.cgi?id=399564 > > Therefore, you can close the [rt.cpan.org #24463] ticket.
OK, will do.