Hi,
I am using the latest trunk version of clutter (I did a fresh Linux
install on new laptop). Somehow clutter_label causes any clutter
program to crash. For example the tutorial:
(Here is a version with debug texts)
#include <clutter/clutter.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
ClutterColor stage_color = { 0x00, 0x00, 0x00, 0xff };
ClutterColor actor_color = { 0xff, 0xff, 0xff, 0x99 };
printf("clutter init\n");
clutter_init (&argc, &argv);
/* Get the stage and set its size and color: */
ClutterActor *stage = clutter_stage_get_default ();
clutter_actor_set_size (stage, 1000, 1000);
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
printf("stage done and color set\n");
/* Add a rectangle to the stage: */
printf("rectangle\n");
ClutterActor *rect = clutter_rectangle_new_with_color (&actor_color);
printf("rectangle done\n");
clutter_actor_set_size (rect, 100, 100);
clutter_actor_set_position (rect, 20, 20);
clutter_container_add_actor (CLUTTER_CONTAINER (stage), rect);
printf("show rect\n");
clutter_actor_show (rect);
// #ifdef huuhaa
printf("label\n");
/* Add a label to the stage: */
ClutterActor *label = clutter_label_new_full ("Sans 12", "Some
Text", &actor_color);
clutter_actor_set_size (label, 500, 500); /* TODO: Has no effect
yet. See bug #631. */
clutter_actor_set_position (label, 20, 150);
printf("label add to container\n");
clutter_container_add_actor (CLUTTER_CONTAINER (stage), label);
clutter_actor_show (label);
// #endif
printf("show stage\n");
/* Show the stage: */
clutter_actor_show (stage);
printf("clutter_main()\n");
/* Start the main loop, so we can respond to events: */
clutter_main ();
printf("clutter main quitted\n");
return EXIT_SUCCESS;
}
What happens is:
[EMAIL PROTECTED]:~/work/clutter/clutter-tutorial/examples/actor$
./example
clutter init
stage done and color set
rectangle
rectangle done
show rect
label
label add to container
show stage
Floating point exception (core dumped)
If I comment out one line, this:
clutter_actor_show (label);
and then compile and run again, it does not crash.
Here is the output from gdb:
[EMAIL PROTECTED]:~/work/clutter/clutter-tutorial/examples/actor$
gdb ./example
GNU gdb 6.7.1-debian
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) run
Starting program:
/home/karoliina/work/clutter/clutter-tutorial/examples/actor/example
[Thread debugging using libthread_db enabled]
clutter init
stage done and color set
rectangle
rectangle done
show rect
label
[New Thread 0xb68c78e0 (LWP 11507)]
label add to container
show stage
Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0xb68c78e0 (LWP 11507)]
0xb6dcc2ab in ?? () from /usr/lib/libGLcore.so.1
(gdb) continue
Continuing.
Program terminated with signal SIGFPE, Arithmetic exception.
The program no longer exists.
(gdb) quit
Best Regards,
Karoliina Salminen
--
To unsubscribe send a mail to [EMAIL PROTECTED]