[poppler] Segmentation fault when running "poppler_document_new_from_file"
bart at pluton.nl
bart at pluton.nl
Tue Jul 29 03:55:18 PDT 2008
Dear poppler people,
Currently I am trying to develop a program to sort documents. For this
program I would like to use poppler to render PDF files. I have made the
following code to try out and gain experience with poppler.
Unfortunately the results is a segmentation fault :-(. I hope someone
here can help me solve the problem.
The following messages are returned when executing the function
(process:15205): GLib-GObject-CRITICAL **: gtype.c:2248: initialization
assertion failed, use IA__g_type_init() prior to this function
(process:15205): GLib-CRITICAL **: g_once_init_leave: assertion
`initialization_value != 0' failed
(process:15205): GLib-GObject-CRITICAL **: g_object_new: assertion
`G_TYPE_IS_OBJECT (object_type)' failed
The code compiles without errors or warnings with the following command:
"gcc `pkg-config --libs --cflags glib-2.0 gtk+-2.0 poppler poppler-glib
gdk-2.0 gdk-pixbuf-2.0` test.c -o test"
The system in use is Fedora 9 kernel 18.104.22.168-96.fc9.i686 on a dual
core Intel pentium E2140. The (dev) packages are installed using the
package manager "gpk-application". I am running Gnome but KDE is
I hope someone has an idea. Maybe it is something really simple which I
forgot. I thank you for your reply and ideas in advance.
int main(int argc,
GError *error = NULL;
GdkPixbuf *pixBuf = NULL;
gchar *filename_uri = "file:///home/Bart/C/Poppler/test2.pdf";
printf("DEBUG: line A\n");
// Until here every thing is oke
PopplerDocument *doc = poppler_document_new_from_file (
// This print statement is not visible. The error occurs above it.
printf("DEBUG: line B\n");
if( error != NULL )
// Report the error
printf("\n\nError: %s\n", &error->message);
printf("DEBUG: line C\n");
PopplerPage *page = poppler_document_get_page ( doc,
// The next lines are not functional but should not be the problem
pixBuf = gdk_pixbuf_new ( GDK_COLORSPACE_RGB,
poppler_page_render_to_pixbuf ( page,
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
More information about the poppler