Re: Abend in gdk_pixbuf_new_from_file



Well, to continue the saga (segmentation fault when trying to read a png
file into a pixbuf), I had to resort to getting the source code for
gdk_pixbuf_new_from_file and inserting debug printf statements to see what
was happening internally.

Bottom line: an error occurs during the file read, but
gdk_pixbuf_new_from_file abends with a segmentation fault when trying to
report it.

Rather than include the long listing of the debug-laden source code here,
I've put both it and the resulting output temporarily at

  http://www.radix.net/~bbrown/temp/snipped_code.txt
  http://www.radix.net/~bbrown/temp/zzz_out.txt

To compile this in, I inserted the modified source code into the file
"support.c"  built by glade many moons ago.  The modifications include

(1) adding "_mod" to the end of the file name to avoid confusing the
linker

(2) inserting printf statements at strategic points in the code to follow
the flow of control

(3) forcing an exit to examine the results.

Anyway, the abend occurs in the statement

   e->message = g_strdup_printf (_("Failed to load image '%s': %s"),
                                    filename, old);

where "old" is set by

      GError *e = *error;
      gchar *old;
      e = *error;

      old = e->message;

When I try to display the contents of old[0], for example, I get a
segmentation fault.  The file name passed into
gdk_pixbuf_new_from_file_mod() remains OK, as you can see from the debug
output.

Note that the error structure is set by the png loader:

  libpixbufloader-png.so

as shown in the debug output.

Further experimentation indicates that a valid pixbuf is generated but the
png file is only partially loaded, i.e., an error occurred during the file
load process.

So, has anyone encountered such an error with the png loader?  The same
problem occurs with the jpg loader.  At least, with the version installed
on my machine from the Redhat 9 installation CD.  The debug printout
indicates that I've got gtk version 2.2.0, if I'm interpreting the path to
the png loader correctly.

Debugging the png loader is beyond my current capabilities, so is there
anything else I can do about this problem?  Workaround?

Is this a valid gtk problem?

Thanks,

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]