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 364291 - Bad dialog behaviour after deleting a target sheet in a new view.
Bad dialog behaviour after deleting a target sheet in a new view.
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: GUI
git master
Other All
: Normal major
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2006-10-22 22:15 UTC by sum1
Modified: 2013-03-04 00:58 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description sum1 2006-10-22 22:15:38 UTC
Steps to reproduce:
- View > New View
- Press OK
- In the first view, Tools > Scenarios > Add
- In the second view, right-click on the Sheet1 tab and remove Sheet1
- In the first view, name the scenario 'a' and press OK
- Press OK (on the "Invalid changing cells" message box)

Backtrace:
Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 2164)

  • #0 gnm_expr_expr_find_range
    at gnumeric-expr-entry.c line 804
  • #1 gnm_expr_entry_can_rangesel
    at gnumeric-expr-entry.c line 1350
  • #2 gee_notify_cursor_position
    at gnumeric-expr-entry.c line 969
  • #3 g_cclosure_marshal_VOID__PARAM
    from /lib/libgobject-2.0.so.0
  • #4 g_closure_invoke
    from /lib/libgobject-2.0.so.0
  • #5 g_signal_override_class_closure
    from /lib/libgobject-2.0.so.0
  • #6 g_signal_emit_valist
    from /lib/libgobject-2.0.so.0
  • #7 g_signal_emit
    from /lib/libgobject-2.0.so.0
  • #8 g_object_class_override_property
    from /lib/libgobject-2.0.so.0
  • #9 g_enum_register_static
    from /lib/libgobject-2.0.so.0
  • #10 g_object_thaw_notify
    from /lib/libgobject-2.0.so.0
  • #11 gtk_entry_new
    from /usr/lib/libgtk-x11-2.0.so.0
  • #12 gtk_entry_new
    from /usr/lib/libgtk-x11-2.0.so.0
  • #13 gtk_editable_select_region
    from /usr/lib/libgtk-x11-2.0.so.0
  • #14 gnm_expr_entry_grab_focus
    at gnumeric-expr-entry.c line 1554
  • #15 scenario_add_ok_clicked_cb
    at dialog-scenarios.c line 131
  • #16 g_cclosure_marshal_VOID__VOID
    from /lib/libgobject-2.0.so.0
  • #17 g_closure_invoke
    from /lib/libgobject-2.0.so.0
  • #18 g_signal_override_class_closure
    from /lib/libgobject-2.0.so.0
  • #19 g_signal_emit_valist
    from /lib/libgobject-2.0.so.0
  • #20 g_signal_emit
    from /lib/libgobject-2.0.so.0
  • #21 gtk_button_clicked
    from /usr/lib/libgtk-x11-2.0.so.0
  • #22 gtk_button_set_alignment
    from /usr/lib/libgtk-x11-2.0.so.0
  • #23 g_cclosure_marshal_VOID__VOID
    from /lib/libgobject-2.0.so.0
  • #24 g_value_set_static_boxed
    from /lib/libgobject-2.0.so.0
  • #25 g_closure_invoke
    from /lib/libgobject-2.0.so.0
  • #26 g_signal_override_class_closure
    from /lib/libgobject-2.0.so.0

Comment 1 Morten Welinder 2006-10-22 22:37:41 UTC
Ok, thanks.  There is no point looking for more cases like this -- we need
a general solution to this.
Comment 2 Morten Welinder 2006-10-23 00:41:36 UTC
I think we need gui-util.c function taking a dialog and a set of flags
specifying under what conditions the dialog should be destroyed.

* Sheet added
* Sheet deleted
* Sheets reordered
* Sheet renamed
* ...

If anything like this is done underneath the dialog, it goes *poof*.
Which is far better than a crash.

I imagine that most dialogs should be killed if the current sheet is
killed.  And that renames and reordering are mostly fine.
Comment 3 Morten Welinder 2006-10-25 01:24:23 UTC
Ok, gnm_dialog_setup_destroy_handlers is in place and the scenarios->add
dialog uses it (and this crash is thus history).

Leaving open since, surely, most other dialog will need a suitable call
to gnm_dialog_setup_destroy_handlers too.

Lowering severity.  This bug reminds me a little bit of TeX' "Intervowen
alignment preables are not allowed." error message.  You're invited to
look up the manual's explanation of that.
Comment 4 Morten Welinder 2006-10-27 20:32:08 UTC
I added handlers for

simulation
search-and-replace
solver
tabulate
zoom
Comment 5 Andreas J. Guelzow 2008-10-03 02:34:02 UTC
Note: we can crash every analysis tool by directing the output to the sheet that is being deleted. These dialogs are typically resilient against deletion of a sheet from which the input is taken.
Comment 6 Andreas J. Guelzow 2008-10-03 03:39:35 UTC
The analysis tools should be okay now.
Comment 7 Andreas J. Guelzow 2009-03-11 06:22:07 UTC
Are tehre any problematic dialog left or is this bug really fixed in svn??
Comment 8 Morten Welinder 2009-03-11 14:19:03 UTC
Not fixed, but requires a hunt for victims.

"Goto cell" dialog is an example.
Comment 9 Morten Welinder 2009-03-11 14:25:41 UTC
Cell format dialog too.

(See comment #3 for the remedy.)
Comment 10 Andreas J. Guelzow 2009-03-11 15:41:30 UTC
I was hoping that maybe sum1 views this as a challenge to find all dialogs that are still affected.

But of course we can check for which dialogs we seem to have and delete those ones that already have destroy handlers in place. That leaves us with:

dialog-about.c                  should not be affected
dialog-advanced-filter.c        uses dialog_tool_init
dialog-analysis-tool-frequency.c      uses dialog_tool_init
dialog-analysis-tool-kaplan-meier.c   uses dialog_tool_init
dialog-analysis-tools.c         done  (in dialog_tool_init)
dialog-autocorrect.c
dialog-autofilter.c
dialog-autoformat.c
dialog-autosave.c
dialog-cell-comment.c
dialog-cell-format.c
dialog-cell-sort.c
dialog-col-row.c
dialog-col-width.c
dialog-consolidate.c           uses dialog_tool_init
dialog-data-table.c
dialog-define-names.c
dialog-delete-cells.c
dialog-doc-metadata.c
dialog-fill-series.c           uses dialog_tool_init
dialog-formula-guru.c
dialog-function-select.c
dialog-goal-seek.c
dialog-goto-cell.c
dialog-hyperlink.c
dialog-insert-cells.c
dialog-merge.c
dialog-password.c
dialog-paste-names.c
dialog-paste-special.c
dialog-pivottable.c
dialog-plugin-manager.c      should not be affected
dialog-preferences.c         should not be affected
dialog-printer-setup.c
dialog-quit.c                should not be affected
dialog-random-generator.c      uses dialog_tool_init
dialog-recent.c                should not be affected
dialog-row-height.c
dialog-scenarios.c           done   (and uses dialog_tool_init ?)
dialog-search.c              done
dialog-search-replace.c      done
dialog-sheet-order.c           should not be affected
dialog-shuffle.c             uses dialog_tool_init
dialog-simulation.c          done   (and uses dialog_tool_init ?)
dialog-so-list.c
dialog-solver.c              done
dialog-so-styled.c
dialog-stf.c
dialog-stf-csv-page.c
dialog-stf-export.c
dialog-stf-fixed-page.c
dialog-stf-format-page.c
dialog-stf-main-page.c
dialog-stf-preview.c
dialog-tabulate.c            done
dialog-view.c
dialog-workbook-attr.c         should not be affected
dialog-zoom.c                done
Comment 11 Morten Welinder 2009-03-11 16:58:31 UTC
It's actually quite difficult to trigger since the undo system generally
holds on to the sheets.  But here's how:

1. Append new sheet.
2. Open new view.
3. Select new sheet and open dialog in question.
4. In other view, Undo and enter "xxx" in a cell.
5. Play with dialog.


(4) moves the sheet to the redo queue which is then cleared.
Comment 12 Andreas J. Guelzow 2009-03-12 05:17:39 UTC
"Goto cell" dialog should be save now.
Comment 13 Andreas J. Guelzow 2009-03-12 06:45:01 UTC
"cell-format" dialog should be save now.
Comment 14 Morten Welinder 2009-03-12 19:25:19 UTC
cell comment dialog done.  (Note: I used GNM_DIALOG_DESTROY_CURRENT_SHEET_REMOVED even though that is currently implemented as GNM_DIALOG_DESTROY_SHEET_REMOVED.)

We need to do anything that stores a sheet in the state.
Comment 15 Andreas J. Guelzow 2009-03-14 19:18:48 UTC
It is not just about storing a sheet in the state. Many dialogs validate the input on the fly and disable/enable the okay buttons (for example all the analysis tools). If a sheet is renamed (or deleted) the validation result would change so ideally revaildation should happen.
Comment 16 Andreas J. Guelzow 2009-03-15 18:02:43 UTC
new overview:

dialog-autocorrect.c:   not affected
dialog-autofilter.c
dialog-autoformat.c
dialog-autosave.c:      not affected
dialog-cell-comment.c:  fixed by Morten
dialog-cell-format.c:   fixed
dialog-cell-sort.c
dialog-col-row.c:       not affected but needs extra work since 
                        we just apply grouping to 
                        whatwever sheet happens to be at the top.
dialog-col-width.c:     fixed
dialog-data-table.c
dialog-define-names.c
dialog-delete-cells.c
dialog-doc-metadata.c
dialog-formula-guru.c
dialog-function-select.c
dialog-goal-seek.c
dialog-goto-cell.c:     fixed
dialog-hyperlink.c
dialog-insert-cells.c
dialog-merge.c
dialog-password.c:      not affected
dialog-paste-names.c
dialog-paste-special.c
dialog-pivottable.c
dialog-printer-setup.c
dialog-row-height.c:    fixed
dialog-so-list.c
dialog-so-styled.c
dialog-stf.c
dialog-stf-csv-page.c
dialog-stf-export.c
dialog-stf-fixed-page.c
dialog-stf-format-page.c
dialog-stf-main-page.c
dialog-stf-preview.c
dialog-view.c
Comment 17 Andreas J. Guelzow 2009-03-16 00:58:50 UTC
dialog-autofilter.c: fixed
dialog-autoformat.c: not affected (blocks all views)
dialog-cell-sort.c:  fixed
dialog-printer-setup.c:  fixed
Comment 18 Andreas J. Guelzow 2009-03-16 23:14:15 UTC
dialog-delete-cells.c: fixed
dialog-hyperlink.c:    fixed
dialog-view.c:         not affected
dialog-merge.c:        fixed
Comment 19 Andreas J. Guelzow 2009-03-16 23:35:33 UTC
new overview:

dialog-data-table.c
dialog-define-names.c
dialog-doc-metadata.c
dialog-formula-guru.c
dialog-function-select.c
dialog-goal-seek.c
dialog-insert-cells.c
dialog-paste-names.c
dialog-paste-special.c:     fixed
dialog-pivottable.c:        not enabled yet
dialog-so-list.c
dialog-so-styled.c
dialog-stf.c:               not affected
dialog-stf-csv-page.c:      not affected
dialog-stf-export.c:        not affected
dialog-stf-fixed-page.c:    not affected
dialog-stf-format-page.c:   not affected
dialog-stf-main-page.c:     not affected
dialog-stf-preview.c:       not affected
Comment 20 Andreas J. Guelzow 2009-11-11 19:02:52 UTC
Note that dialog-paste-names.c can currently not be reached and is incomplete anyways. So the dialogs left to worry about are:

dialog-data-table.c
dialog-define-names.c
dialog-doc-metadata.c
dialog-formula-guru.c
dialog-function-select.c
dialog-goal-seek.c
dialog-insert-cells.c
dialog-so-list.c
dialog-so-styled.c

where dialog-doc-metadata.c is only trivially affected: the data shown on the statistics page may become incorrect.
Comment 21 Morten Welinder 2013-03-03 23:31:16 UTC
+dialog-goto-cell.c     [I think]
-dialog-goal-seek.c
Comment 22 Morten Welinder 2013-03-03 23:34:00 UTC
-dialog-goto-cell.c -- it's ok
Comment 23 Morten Welinder 2013-03-03 23:42:22 UTC
-dialog-define-names.c
Comment 24 Morten Welinder 2013-03-04 00:55:46 UTC
-dialog-insert-cells.c
-dialog-so-list.c
-dialog-so-styled.c
-dialog-data-table.c
-dialog-formula-guru.c
-dialog-function-select.c


I'm not sure dialog-doc-metadata.c needs anything.


This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
Comment 25 Morten Welinder 2013-03-04 00:58:13 UTC
-dialog-insert-cells.c
-dialog-so-list.c
-dialog-so-styled.c
-dialog-data-table.c
-dialog-formula-guru.c
-dialog-function-select.c


I'm not sure dialog-doc-metadata.c needs anything.


This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.