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 627066 - Out of memory reading ods format
Out of memory reading ods format
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2010-08-16 17:21 UTC by Morten Welinder
Modified: 2010-08-17 13:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Corrupted ods file (12.49 KB, application/vnd.oasis.opendocument.spreadsheet)
2010-08-16 17:21 UTC, Morten Welinder
Details

Description Morten Welinder 2010-08-16 17:21:57 UTC
Created attachment 167982 [details]
Corrupted ods file

../src/ssconvert 'zzuftmp/mmm-3023.ods' 'zzuftmp/mmm-3023.gnumeric'
Using exporter Gnumeric_XmlIO:sax

GLib-ERROR **: gmem.c:175: failed to allocate 1073741824 bytes
aborting...
Aborted

We're trying to generate an absurd format.

  • #0 raise
    from /lib64/libc.so.6
  • #1 abort
    from /lib64/libc.so.6
  • #2 g_logv
    from /usr/lib64/libglib-2.0.so.0
  • #3 g_log
    from /usr/lib64/libglib-2.0.so.0
  • #4 g_realloc
    from /usr/lib64/libglib-2.0.so.0
  • #5 ??
    from /usr/lib64/libglib-2.0.so.0
  • #6 g_string_set_size
    from /usr/lib64/libglib-2.0.so.0
  • #7 go_string_append_c_n
    at go-glib-extras.c line 329
  • #8 go_format_generate_str
    at go-format.c line 5059
  • #9 odf_scientific
    at openoffice-read.c line 2133

(gdb) p *details
$1 = {family = GO_FORMAT_SCIENTIFIC, magic = GO_FORMAT_MAGIC_NONE, min_digits = 1, num_decimals = 711379426, 
  thousands_sep = 0, negative_red = 0, negative_paren = 0, currency = 0x0, force_quoted = 0, exponent_step = 1, 
  use_markup = 0, simplify_mantissa = 0}
Comment 1 Andreas J. Guelzow 2010-08-16 22:27:54 UTC
I would think this should be checked in go_format_generate_str
Comment 2 Morten Welinder 2010-08-16 22:56:07 UTC
That's possible.  We are not able to return an error code there, but I guess
we can silently truncate at 2*DECIMAL_DIGITS or #mantissa bits.  (Yes, bits:
one bit gives rise to one decimal.)
Comment 3 Morten Welinder 2010-08-16 22:57:45 UTC
exponent_step is also going to need some care.  And we need to check for
negative values.
Comment 4 Morten Welinder 2010-08-17 13:10:07 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.