GNOME Bugzilla – Bug 329236
Underscores in sheet names do not round trip
Last modified: 2006-01-31 02:50:14 UTC
Distribution: Slackware Slackware 10.2.0 Package: Gnumeric Severity: critical Version: GNOME2.12.2 1.7.x Gnome-Distributor: FRG gsb.sourceforge.net build for slackware Synopsis: Sorting Broken Bugzilla-Product: Gnumeric Bugzilla-Component: General Bugzilla-Version: 1.7.x BugBuddy-GnomeVersion: 2.0 (2.12.0) Description: Description of the crash: I select a range of cells (contiguous) and select data->sort. The usual popup appears, with no sort columns showing. When I select +Add, gnumeric dies, giving me the popup saying that it has crashed, do I want to restart, etc. Steps to reproduce the crash: 1. 2. 3. Expected Results: Things sort How often does this happen? Always Additional Information: I'm on a slackware-current box, with freerock gnome running. I built from CVS using gcc-4.0.2 and am running linux-2.6.15.1 Debugging Information: Backtrace was generated from '/usr/bin/gnumeric' (no debugging symbols found) Using host libthread_db library "/lib/tls/libthread_db.so.1". [Thread debugging using libthread_db enabled] [New Thread -1231783712 (LWP 29707)] 0xb6b4f04e in __waitpid_nocancel () from /lib/tls/libpthread.so.0
+ Trace 65750
------- Bug created by bug-buddy at 2006-01-30 17:05 -------
Would you be able to rebuild gnumeric with debugging symbols and add a more useful backtrace? Which optimization settings are you using when you build gnumeric?
First, I'm using the default optimizations that result from using ./configure with CFLAGS and CXXFLAGS unset. I rebuilt with debugging, ran under ddd, and crashed in the same way (a SIGSEGV). Backtrace shows : (gdb) backtrace
+ Trace 65755
In particular we seem to be at dialog-cell-sort.c:769 if (state->is_cols) { start = state->sel->v_range.cell.a.col; end = state->sel->v_range.cell.b.col; index = state->sel->v_range.cell.a.row; } else { start = state->sel->v_range.cell.a.row; end = state->sel->v_range.cell.b.row; index = state->sel->v_range.cell.a.col; } state is null (after the crash). I've put a breakpoint at the calling routine and stepped through; state is fine until after the assignment. The problem seems to be state->sel with is null on entry. David
Yeah that should be protected against sucha a crash. I am still wondering: when you open the dialog, is anything selected on your sheet? You must be getting into this dialog without any selection and I am not sure how that could happen.
Another question: Is there any range shown in the range box at the top of the dialog? What happens if you click in the box and reselect your sort range?
The crash should now be fixed in CVS. This not address the underlying problem that you should not have a NULL selection here. (There is the possibility that a NULL selection could occur but because of 329250 this can't be the case here.)
Couple of things: 1. Yes I had selected a range of rows and columns (but had done so for earlier versions). 2. The selected range does show at the top of the dialog box. 3. Even if I don't select the range by dragging with the mouse (actually I click the topmost left cell and then alt-click the bottommost right cell), but add it manually to the dialog box, the crash still happens. 4. While the CVS patch keeps things from crashing, the sort dialog is still broken. Normally, when I click on +Add, I get a popup list of columns or rows to add to the sort criteria; this doesn't happen, and activating the sort does nothing.
If you add columns or rows to the sort specification by clicking in the entry box to the left of the add button, then selecting a column (or row) intersecting the sort range and then clicking add, do you get any column specifications added to the dialog? How does the sort range at the top of the dialog look like? (Unfortunately I can't replicate your problem so it is difficult to determine why your sort range as stored inside the dialog is empty.)
Created attachment 58431 [details] Screenshot showing sort dialog
The entry box you mentioned (to the left of the +Add) button seems to be dead. The main sort range is: grade_365!$A$4:$C$50 (where I'd previously selected the cells who's upper left corner is A4 and lower right is at C50). I've attached a screenshot of the dialog (the main gnumeric window contains sensitive information and I've moved it off to the side on purpose).
Something is horribly broken, and it isn't the sorting dialog: the problem is the underscore in the sheet name. Gnumeric creates the underscore in its reference name without escaping the sheet name but it does not understand the name. For the moment please remove the underscore from your sheet name and the sort dialog should work for you.
Please note that the same problem occurs with various dialogs in gnumeric. For example selecteing a range on that sheet and opening the descriptive statics tool explicitly warns of an invalid range.
You are indeed correct; removing the underscore on the sheet name makes everything work as expected.
Argh! Any idea whether Excel quotes underscores?
I just tried it with gnumeric version 1.6.0 (well that may not be the final release 1.6.0 but some nearly 1.6.0 cvs version) and it quoted sheet names with underscores, so this is relatively recent!
Fixed in cvs.