Re: Abend in gdk_pixbuf_new_from_file



On 26 Feb 2004, Iago Rubio wrote:

[snip]

Could you provide a backtrace? Just the first 20 lines. It could help us
to track the problem.

[snip]

   filename_local = g_strdup(filename);

Thanks for the suggestion.  Here's the code with the as-suggested
modifications.

=== begin code snippet ===

void
on_read_ok_button_clicked (GtkButton  *button,
                           gpointer    user_data)
{
   GdkPixbuf *pixbuf = NULL;
   gchar *filename_local;
   GError *error;
   gchar *filename_local;

   filename = (gchar *) gtk_file_selection_get_filename (
      GTK_FILE_SELECTION (file_selector));
   filename_local = g_strdup (filename);
   gtk_widget_destroy (file_selector);
   pixbuf = gdk_pixbuf_new_from_file (filename_local,
                                      &error);

[snip]

=== end code snippet ===

After figuring out how to run gdb I set a breakpoint at the entry to the
above routine, and got the following gdb output:

=== begin gdb output ===

Breakpoint 1 at 0x804eef8: file callbacks.c, line 229.
[New Thread 1086104992 (LWP 11212)]
[Switching to Thread 1086104992 (LWP 11212)]

Breakpoint 1, on_read_ok_button_clicked (button=0x81807b8, user_data=0x0)
    at callbacks.c:229
229        filename = (gchar *) gtk_file_selection_get_filename
(GTK_FILE_SELECTION (file_selector));

Program received signal SIGSEGV, Segmentation fault.
0x4207a42b in strlen () from /lib/tls/libc.so.6
#0  0x4207a42b in strlen () from /lib/tls/libc.so.6
#1  0x4204752d in vfprintf () from /lib/tls/libc.so.6
#2  0x42069d27 in vasprintf () from /lib/tls/libc.so.6
#3  0x407b4810 in g_strdup_vprintf () from /usr/lib/libglib-2.0.so.0
#4  0x407b4886 in g_strdup_printf () from /usr/lib/libglib-2.0.so.0
#5  0x40588de3 in gdk_pixbuf_new_from_file ()
   from /usr/lib/libgdk_pixbuf-2.0.so.0
#6  0x0804ef3b in on_read_ok_button_clicked (button=0x81807b8,
user_data=0x0)
    at callbacks.c:259

=== end gdb output ===

The name of the file that was selected was

  /home/bbrown/Projects/xxxxxx/src/zzz_master.png

Thanks for the help so far.

Bryan


*---------------------------------------------------------------
* Bryan Brown      <*>              bbrown radix net
* http://www.radix.net/~bbrown
*---------------------------------------------------------------




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