I created a quick and dirty application that sets up the stage, creates
and then destroys the actor (in this case again a texture). Same problem
as before -- it crashes after destroying it. I did not use g_new0 this
time and instead of a show all before clutter_main I call show for the
actor and the stage separately. This was really irrelevant -- it makes
no difference.
The code is below and is fairly close to one of the examples in the 0.4
docs, less the callback and including the destroy (ref:
http://www.clutter-project.org/docs/clutter-animations.html).
There is a tarball of the code, header, image and makefile here:
http://clutter.enveria.com/wp-content/uploads/2008/02/texture_test.tar.gz
I pasted the output from gdb below the code itself after I ran the
program and then 'where'.
/* main.c */
#include "main.h"
int main (int argc, char *argv[])
{
ClutterActor *stage;
GdkPixbuf *pixb;
ClutterActor *actor;
clutter_init (&argc, &argv);
/* Stage Setup */
stage = clutter_stage_get_default ();
ClutterColor stage_color = { 0x00, 0x00, 0x00, 0x00 };
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
clutter_actor_set_size (stage, 800, 600);
/* Actor Setup */
if((pixb = gdk_pixbuf_new_from_file ("image.png", NULL))== NULL)
{
printf("Oh, no! The image would not load!\n");
}
else
{
printf("Image loaded ... let's continue.\n");
actor = clutter_texture_new_from_pixbuf (pixb);
clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor);
clutter_actor_set_position (actor, 200,300);
clutter_actor_show (actor);
clutter_actor_destroy (actor);
}
clutter_actor_show (stage);
clutter_main();
return 0;
}
From gdb:
Starting program: /home/ichien/clutter/clutter/texture_test/texture_test
[Thread debugging using libthread_db enabled]
[New Thread -1215457616 (LWP 19360)]
Image loaded ... let's continue.
*** glibc detected ***
/home/ichien/clutter/clutter/texture_test/texture_test: free(): invalid
pointer: 0x0807cb38 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7bc2d65]
/lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb7bc6800]
/usr/lib/libGL.so.1(__indirect_glGetTexImage+0x174)[0xb7a4dd94]
/usr/lib/libclutter-glx-0.5.so.0(clutter_texture_get_pixbuf+0x36f)[0xb7ec849f]
/usr/lib/libclutter-glx-0.5.so.0[0xb7ec8de5]
/usr/lib/libclutter-glx-0.5.so.0(clutter_actor_unrealize+0x24)[0xb7e9a694]
/usr/lib/libclutter-glx-0.5.so.0(clutter_actor_unparent+0xcb)[0xb7e9cb9b]
/usr/lib/libclutter-glx-0.5.so.0[0xb7eb3427]
/usr/lib/libclutter-glx-0.5.so.0(clutter_container_remove_actor+0x114)[0xb7eac8d4]
/usr/lib/libclutter-glx-0.5.so.0(clutter_actor_destroy+0xf3)[0xb7e9d2f3]
/home/ichien/clutter/clutter/texture_test/texture_test[0x8048a47]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0)[0xb7b6f050]
/home/ichien/clutter/clutter/texture_test/texture_test[0x80488d1]
======= Memory map: ========
08048000-08049000 r-xp 00000000 08:02 542149
/home/ichien/clutter/clutter/texture_test/texture_test
08049000-0804a000 rw-p 00000000 08:02 542149
/home/ichien/clutter/clutter/texture_test/texture_test
0804a000-0808c000 rw-p 0804a000 00:00 0 [heap]
b7700000-b7721000 rw-p b7700000 00:00 0
b7721000-b7800000 ---p b7721000 00:00 0
b785a000-b7864000 r-xp 00000000 08:02 916473 /lib/libgcc_s.so.1
b7864000-b7865000 rw-p 0000a000 08:02 916473 /lib/libgcc_s.so.1
b7865000-b7887000 r-xp 00000000 08:02 705383 /usr/lib/libpng12.so.0.15.0
b7887000-b7888000 rw-p 00021000 08:02 705383 /usr/lib/libpng12.so.0.15.0
b7898000-b78db000 rw-p b7898000 00:00 0
b78db000-b78f9000 r-xp 00000000 08:02 705287 /usr/lib/libexpat.so.1.0.0
b78f9000-b78fb000 rw-p 0001e000 08:02 705287 /usr/lib/libexpat.so.1.0.0
b78fb000-b78fc000 rw-p b78fb000 00:00 0
b78fc000-b7909000 r-xp 00000000 08:02 705414 /usr/lib/libXext.so.6.4.0
b7909000-b790a000 rw-p 0000d000 08:02 705414 /usr/lib/libXext.so.6.4.0
b790a000-b790e000 r-xp 00000000 08:02 705361 /usr/lib/libXdmcp.so.6.0.0
b790e000-b790f000 rw-p 00003000 08:02 705361 /usr/lib/libXdmcp.so.6.0.0
b790f000-b7911000 r-xp 00000000 08:02 705330 /usr/lib/libXau.so.6.0.0
b7911000-b7912000 rw-p 00001000 08:02 705330 /usr/lib/libXau.so.6.0.0
b7912000-b7926000 r-xp 00000000 08:02 705294 /usr/lib/libz.so.1.2.3.3
b7926000-b7927000 rw-p 00013000 08:02 705294 /usr/lib/libz.so.1.2.3.3
b7927000-b7993000 r-xp 00000000 08:02 705300
/usr/lib/libfreetype.so.6.3.16
b7993000-b7997000 rw-p 0006b000 08:02 705300
/usr/lib/libfreetype.so.6.3.16
b7997000-b7998000 rw-p b7997000 00:00 0
b7998000-b79bb000 r-xp 00000000 08:02 705307
/usr/lib/libfontconfig.so.1.2.0
b79bb000-b79c3000 rw-p 00023000 08:02 705307
/usr/lib/libfontconfig.so.1.2.0
b79c3000-b7a5b000 r-xp 00000000 08:02 704577 /usr/lib/libGL.so.1.2
b7a5b000-b7a60000 rw-p 00098000 08:02 704577 /usr/lib/libGL.so.1.2
b7a60000-b7a63000 rw-p b7a60000 00:00 0
b7a63000-b7a67000 r-xp 00000000 08:02 705409 /usr/lib/libXfixes.so.3.1.0
b7a67000-b7a68000 rw-p 00003000 08:02 705409 /usr/lib/libXfixes.so.3.1.0
b7a68000-b7b55000 r-xp 00000000 08:02 705376 /usr/lib/libX11.so.6.2.0
b7b55000-b7b59000 rw-p 000ed000 08:02 705376 /usr/lib/libX11.so.6.2.0
b7b59000-b7c9d000 r-xp 00000000 08:02 952184
/lib/tls/i686/cmov/libc-2.6.1.so
b7c9d000-b7c9e000 r--p 00143000 08:02 952184
/lib/tls/i686/cmov/libc-2.6.1.so
b7c9e000-b7ca0000 rw-p 00144000 08:02 952184
/lib/tls/i686/cmov/libc-2.6.1.so
b7ca0000-b7ca4000 rw-p b7ca0000 00:00 0
b7ca4000-b7cb8000 r-xp 00000000 08:02 952198
/lib/tls/i686/cmov/libpthread-2.6.1.so
b7cb8000-b7cba000 rw-p 00013000 08:02 952198
/lib/tls/i686/cmov/libpthread-2.6.1.so
b7cba000-b7cbc000 rw-p b7cba000 00:00 0
b7cbc000-b7d78000 r-xp 00000000 08:02 705318
/usr/lib/libglib-2.0.so.0.1400.1
b7d78000-b7d79000 rw-p 000bc000 08:02 705318
/usr/lib/libglib-2.0.so.0.1400.1
b7d79000-b7d7b000 r-xp 00000000 08:02 952187
/lib/tls/i686/cmov/libdl-2.6.1.so
b7d7b000-b7d7d000 rw-p 00001000 08:02 952187
/lib/tls/i686/cmov/libdl-2.6.1.so
Program received signal SIGABRT, Aborted.
[Switching to Thread -1215457616 (LWP 19360)]
0xffffe410 in __kernel_vsyscall ()
(gdb) where
#0 0xffffe410 in __kernel_vsyscall ()
#1 0xb7b83875 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb7b85201 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb7bbae5c in ?? () from /lib/tls/i686/cmov/libc.so.6
#4 0x00000007 in ?? ()
#5 0xbfc8c384 in ?? ()
#6 0x00000400 in ?? ()
#7 0xb7c850c8 in ?? () from /lib/tls/i686/cmov/libc.so.6
#8 0x00000017 in ?? ()
#9 0xbfc8d8ce in ?? ()
#10 0x00000036 in ?? ()
#11 0xb7c850e1 in ?? () from /lib/tls/i686/cmov/libc.so.6
#12 0x00000002 in ?? ()
#13 0xb7c820c4 in ?? () from /lib/tls/i686/cmov/libc.so.6
#14 0x00000017 in ?? ()
#15 0xb7c850e5 in ?? () from /lib/tls/i686/cmov/libc.so.6
#16 0x00000004 in ?? ()
#17 0xbfc8c8fb in ?? ()
#18 0x00000008 in ?? ()
#19 0xb7c850eb in ?? () from /lib/tls/i686/cmov/libc.so.6
#20 0x00000005 in ?? ()
#21 0x00000007 in ?? ()
#22 0xb7eefe2a in ?? ()
---Type <return> to continue, or q <return> to quit---
from /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
#23 0xb7ef14ac in ?? ()
from /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
#24 0x08063d38 in ?? ()
#25 0xbfc8c2b8 in ?? ()
#26 0xb7eee03c in _init ()
from /usr/lib/gtk-2.0/2.10.0/loaders/libpixbufloader-png.so
#27 0xb7bc2d65 in ?? () from /lib/tls/i686/cmov/libc.so.6
#28 0x00000002 in ?? ()
#29 0xb7c850c8 in ?? () from /lib/tls/i686/cmov/libc.so.6
#30 0xbfc8d8ce in ?? ()
#31 0xb7c820c4 in ?? () from /lib/tls/i686/cmov/libc.so.6
#32 0xbfc8c8fb in ?? ()
#33 0xb7b55b2c in ?? () from /usr/lib/libX11.so.6
#34 0xbfc8c8fb in ?? ()
#35 0x0807cb30 in ?? ()
#36 0x08055d58 in ?? ()
#37 0xb7ca0170 in ?? () from /lib/tls/i686/cmov/libc.so.6
#38 0xb7c820c4 in ?? () from /lib/tls/i686/cmov/libc.so.6
#39 0xb7a4744c in __glEmptyImage () from /usr/lib/libGL.so.1
#40 0xb7bc6800 in free () from /lib/tls/i686/cmov/libc.so.6
#41 0xb7a4dd94 in __indirect_glGetTexImage () from /usr/lib/libGL.so.1
#42 0xb7ec849f in clutter_texture_get_pixbuf ()
---Type <return> to continue, or q <return> to quit---
from /usr/lib/libclutter-glx-0.5.so.0
#43 0xb7ec8de5 in ?? () from /usr/lib/libclutter-glx-0.5.so.0
#44 0x08068060 in ?? ()
#45 0x08063a60 in ?? ()
#46 0xb7e83000 in ?? ()
#47 0x000651a4 in ?? ()
#48 0xb7e8a628 in ?? () from /usr/lib/libclutter-glx-0.5.so.0
#49 0xb7ee7518 in ?? () from /usr/lib/libclutter-glx-0.5.so.0
#50 0x08068060 in ?? ()
#51 0xb7ee7518 in ?? () from /usr/lib/libclutter-glx-0.5.so.0
#52 0x08068060 in ?? ()
#53 0x0804dc58 in ?? ()
#54 0xbfc8ca88 in ?? ()
#55 0xb7e9a694 in clutter_actor_unrealize ()
from /usr/lib/libclutter-glx-0.5.so.0
Backtrace stopped: frame did not save the PC
--
To unsubscribe send a mail to [EMAIL PROTECTED]