After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 335152 - Empty xml files crashed gnumeric
Empty xml files crashed gnumeric
Status: RESOLVED WONTFIX
Product: libxml2
Classification: Platform
Component: docs
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2006-03-19 19:33 UTC by Justin Findlay
Modified: 2006-10-17 19:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Justin Findlay 2006-03-19 19:33:24 UTC
Distribution: Gentoo Base System version 1.12.0_pre16
Package: Gnumeric
Severity: normal
Version: GNOME2.12.3 1.6.x
Gnome-Distributor: Gentoo
Synopsis: kspread .ods with emty xml files crashed gnumeric
Bugzilla-Product: Gnumeric
Bugzilla-Component: import/export OOo / OASIS
Bugzilla-Version: 1.6.x
BugBuddy-GnomeVersion: 2.0 (2.12.1)
Description:
Description of the crash:

A particular file that I have which seems to be malformed causes
gnumeric to crash.  This file was generated by kspread.

Steps to reproduce the crash:
1. $ gnumeric path/to/file.ods
2. 
Reading file:///home/justin/path/to/file.ods

(gnumeric:31192): XML-CRITICAL **: Document is empty


(gnumeric:31192): XML-CRITICAL **: Start tag expected, '<' not found

3. crash

Expected Results:

no crash

How often does this hapen:

Every time I open the file in gnumeric.

Additional Information:

Three of the files are completely empty.

$ ls -lhR
.:
total 12K
drwxr-xr-x 2 justin justin 4.0K Mar 19 12:18 META-INF
-rw-r--r-- 1 justin justin 1.2K Mar 19 12:17 content.xml
-rw-r--r-- 1 justin justin 1.5K Mar 19 12:06 file.ods
-rw-r--r-- 1 justin justin    0 Mar 19 12:17 meta.xml
-rw-r--r-- 1 justin justin    0 Mar 19 12:17 settings.xml
-rw-r--r-- 1 justin justin    0 Mar 19 12:17 styles.xml

./META-INF:
total 4.0K
-rw-r--r-- 1 justin justin 756 Mar 19 12:17 manifest.xml



Debugging Information:

Backtrace was generated from '/usr/bin/gnumeric'

(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 47300859253472 (LWP 31014)]
[New Thread 1074272592 (LWP 31023)]
[New Thread 1074006352 (LWP 31017)]
0x000000372540ce49 in waitpid () from /lib/libpthread.so.0

Thread 1 (Thread 47300859253472 (LWP 31014))

  • #0 waitpid
    from /lib/libpthread.so.0
  • #1 libgnomeui_module_info_get
    from /usr/lib/libgnomeui-2.so.0
  • #2 <signal handler called>
  • #3 free
    from /lib/libc.so.6
  • #4 g_ptr_array_free
    from /usr/lib/libglib-2.0.so.0
  • #5 gsf_xmlDocFormatDump
    from /usr/lib/libgsf-1.so.113
  • #6 xmlParseDocument
    from /usr/lib/libxml2.so.2
  • #7 gsf_xml_in_doc_parse
    from /usr/lib/libgsf-1.so.113
  • #8 openoffice_file_open
    from /usr/lib64/gnumeric/1.6.1/plugins/openoffice/openoffice.so
  • #9 plugin_service_plugin_loader_generate_type
    from /usr/lib/libgoffice-1.so.1
  • #10 wb_view_new_from_input
    from /usr/lib/libspreadsheet-1.6.1.so
  • #11 wb_view_new_from_uri
    from /usr/lib/libspreadsheet-1.6.1.so
  • #12 gui_file_read
    from /usr/lib/libspreadsheet-1.6.1.so
  • #13 gui_file_open
    from /usr/lib/libspreadsheet-1.6.1.so
  • #14 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #15 g_signal_handler_unblock
    from /usr/lib/libgobject-2.0.so.0
  • #16 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #17 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #18 gtk_action_get_type
    from /usr/lib/libgtk-x11-2.0.so.0
  • #19 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #20 g_signal_handler_unblock
    from /usr/lib/libgobject-2.0.so.0
  • #21 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #22 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #23 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #24 g_signal_handler_unblock
    from /usr/lib/libgobject-2.0.so.0
  • #25 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #26 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #27 gtk_button_get_type
    from /usr/lib/libgtk-x11-2.0.so.0
  • #28 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #29 g_signal_handler_unblock
    from /usr/lib/libgobject-2.0.so.0
  • #30 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #31 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #32 gtk_button_get_type
    from /usr/lib/libgtk-x11-2.0.so.0
  • #33 gtk_marshal_VOID__UINT_STRING
    from /usr/lib/libgtk-x11-2.0.so.0
  • #34 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #35 g_signal_handler_unblock
    from /usr/lib/libgobject-2.0.so.0
  • #36 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #37 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #38 gtk_widget_get_child_requisition
    from /usr/lib/libgtk-x11-2.0.so.0
  • #39 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #40 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #41 gdk_net_wm_supports
    from /usr/lib/libgdk-x11-2.0.so.0
  • #42 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #43 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #44 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #45 bonobo_main
    from /usr/lib/libbonobo-2.so.0
  • #46 main
  • #0 waitpid
    from /lib/libpthread.so.0

Comment 1 Morten Welinder 2006-03-20 15:35:05 UTC
Could you attach a sample file, please?
Comment 2 Morten Welinder 2006-03-20 16:03:58 UTC
This looks like a libxml bug -- tossing over there.

The "end document" handler is being called without the "start document"
handler having been called.

I am installing a simple workaround in libgsf.


Breakpoint 3, gsf_xml_in_end_document (state=0xffbee1c0) at gsf-libxml.c:724
724             g_string_free (state->pub.content, TRUE);
(gdb) where
  • #0 gsf_xml_in_end_document
    at gsf-libxml.c line 724
  • #1 xmlParseDocument
    at parser.c line 9142
  • #2 gsf_xml_in_doc_parse
    at gsf-libxml.c line 1019

Comment 3 Daniel Veillard 2006-03-20 16:31:36 UTC
> The "end document" handler is being called without the "start document"
> handler having been called.

  Hum ... client code should really not crash because of this.

paphio:~/XML -> touch empty
paphio:~/XML -> xmllint --sax empty
SAX.setDocumentLocator()
SAX.error: Document is empty
SAX.error: Start tag expected, '<' not found
SAX.endDocument()
paphio:~/XML ->

  true it's a bit weird, but I'm not sure it should be changed, for
example setDocumentLocator() could lead to some allocation. The behaviour
of libxml2 didn't chnaged over this for years, apps should definitely be
fixed, but I'm not sure it's a good idea to change libxml2 behaviour.

Daniel
Comment 4 Morten Welinder 2006-03-20 16:42:39 UTC
I don't have strong feelings about this being or not being something to
fix.  If you decide against it, however, a nice fat comment would be nice.