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 361391 - ssindex crashes
ssindex crashes
Status: RESOLVED DUPLICATE of bug 345477
Product: Gnumeric
Classification: Applications
Component: General
1.7.x
Other All
: Normal critical
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2006-10-11 09:52 UTC by Emmanuel Touzery
Modified: 2006-10-11 15:53 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Emmanuel Touzery 2006-10-11 09:52:06 UTC
Steps to reproduce:
1. create an empty file named ".csv" => touch test.csv
2. run ssindex -i test.csv
3. ssindex crashes

Stack trace:
see http://librarian.launchpad.net/4705196/_usr_bin_ssindex.1000.crash
for the apport report (>65k characters, bugzilla does not let me paste it here).

Other information:
ubuntu edgy (6.10) ships beagle by default, and when indexing the files on the harddisk, beagle is running ssindex on .csv files and maybe excel files too. edgy also uses "apport", a software to detect program crashes and collect stack traces.

"apport" started displaying messages about ssindex crashing. Those crashes, triggered by beagle indexing CSV files in the background, would go unnoticed without apport, and that's why they've been there so long (and they're coming up so numerous now).

Ubuntu bug #63297 collects several of those crash bugs (not only my case of an empty CSV file!). each of the crashes in that bug have stacktrace and most have the file which triggered the problem.
https://launchpad.net/distros/ubuntu/+source/gnumeric/+bug/63297
Comment 1 Morten Welinder 2006-10-11 14:29:16 UTC
I do not see this problem.

Are you sure that ssindex (which is not compiled by default) is not an old
executable?  The time stamp on ssindex and gnumeric should be roughly the
same.

I would like to see a stack trace for the crash.  (The link above does not
lead to a stack trace, but a crash report on some kind.)



./ssindex -i test.csv
-> test.csv
Reading file:///home/welinder/private/gnome/gnumeric/src/test.csv
<?xml version="1.0" encoding="UTF-8"?>
<gnumeric>
  <data>test.csv</data>
</gnumeric>
Comment 2 Emmanuel Touzery 2006-10-11 14:52:25 UTC
i never compiled gnumeric on this computer, it's from ubuntu packages.
/usr/bin/ssindex comes with gnumeric on ubuntu (just checked in synaptic).

ssindex --version
ssindex version '1.7.0'
datadir := '/usr/share/gnumeric/1.7.0'
libdir := '/usr/lib/gnumeric/1.7.0'

here's a backtrace from GDB:

Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 5061)

  • #0 strchr
    from /lib/tls/i686/cmov/libc.so.6
  • #1 stf_parse_options_guess
    from /usr/lib/libspreadsheet-1.7.0.so
  • #2 stf_init
    from /usr/lib/libspreadsheet-1.7.0.so
  • #3 go_file_opener_new
    from /usr/lib/libgoffice-0.so.3
  • #4 go_file_opener_open
    from /usr/lib/libgoffice-0.so.3
  • #5 wb_view_new_from_input
    from /usr/lib/libspreadsheet-1.7.0.so
  • #6 wb_view_new_from_uri
    from /usr/lib/libspreadsheet-1.7.0.so
  • #7 main

Comment 3 Morten Welinder 2006-10-11 14:55:23 UTC
Ah, that one.  Fixed in 1.7.1.


*** This bug has been marked as a duplicate of 345477 ***
Comment 4 Morten Welinder 2006-10-11 15:53:39 UTC
For the (Ubuntu) record: the above crash triggered when we failed to guess
a separator based on the data.

In particular, comma separated files in locales using decimal commas (such
as no_NO) could hit this.  Two fixes were involved:

(a) survive not being able to guess a separator.
(b) become better at guessing

The patch below should work, if you don't want to upgrade to 1.7.1 for
reasons that I cannot think of right now.

Mean_shrtest_path.csv looks like it might very well have hit the problem
in a decimal comma locale.


Index: stf-parse.c
===================================================================
RCS file: /cvs/gnome/gnumeric/src/stf-parse.c,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -r1.119 -r1.120
--- stf-parse.c 25 May 2006 16:09:36 -0000      1.119
+++ stf-parse.c 21 Jun 2006 00:39:23 -0000      1.120
@@ -1400,6 +1400,7 @@
                if (count_character (lines, (c = sepchar), 0.5) > 0 ||
                    count_character (lines, (c = format_get_col_sep ()), 0.5) > 0 ||
                    count_character (lines, (c = ':'), 0.5) > 0 ||
+                   count_character (lines, (c = ','), 0.5) > 0 ||
                    count_character (lines, (c = ';'), 0.5) > 0 ||
                    count_character (lines, (c = '|'), 0.5) > 0 ||
                    count_character (lines, (c = '!'), 0.5) > 0 ||
@@ -1414,14 +1415,18 @@
 
        if (1) {
                /* Separated */
+               gboolean dups =
+                       res->sep.chr &&
+                       strchr (res->sep.chr, ' ') != NULL;
+               gboolean trim =
+                       res->sep.chr &&
+                       strchr (res->sep.chr, ' ') != NULL;
 
                stf_parse_options_set_type (res, PARSE_TYPE_CSV);
                stf_parse_options_set_trim_spaces (res, TRIM_TYPE_LEFT | TRIM_TYPE_RIGHT);
                stf_parse_options_csv_set_indicator_2x_is_single (res, TRUE);
-               stf_parse_options_csv_set_duplicates
-                       (res, strchr (res->sep.chr, ' ') != NULL);
-               stf_parse_options_csv_set_trim_seps
-                       (res, strchr (res->sep.chr, ' ') != NULL);
+               stf_parse_options_csv_set_duplicates (res, dups);
+               stf_parse_options_csv_set_trim_seps (res, trim);
 
                stf_parse_options_csv_set_stringindicator (res, '"');
        } else {