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 121560 - Repeatable segfault deleting sheets
Repeatable segfault deleting sheets
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: General
git master
Other Linux
: Normal major
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2003-09-05 19:10 UTC by J.H.M. Dassen (Ray)
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Demo (163.31 KB, application/x-gnumeric)
2003-09-05 19:10 UTC, J.H.M. Dassen (Ray)
Details

Description J.H.M. Dassen (Ray) 2003-09-05 19:10:00 UTC
[Originally reported as http://bugs.debian.org/204895]

From: Jan 'Miernik' Macek <miernik@ctnet.pl>
Subject: when removing n sheets from my n+4 spreadsheet, segfaults or ends up
	in "stopped" state
Date: Thu, 22 May 2003 08:15:33 +0200

Package: gnumeric
Version: 1.1.17-3
Severity: normal

I have a multi-sheet spreadsheet here: http://www.miernik.ctnet.pl/a.gnumeric
This file is anonymized a little. 

I go to "Manage sheets", and select all but the last 4 sheets for 
deletion. Press OK.

I have 64 MB RAM + 128 MB swap. First I tried this when I had many 
other programs running, so the whole 192 MB might had ended up. It 
worked for 10-30 minutes (didn't measure exactly) and then ended up 
with a segmentation fault.

Then I closed almost all other programs, started gnumeric and attached 
gdb to it with "gdb gnumeric 1071" command.

It worked very long, so I left it and went to sleep. In the morning I 
saw gnumeric in a "stopped" state (gnumeric window was just filled 
with white and grey boxes, no menus or anything).

top showed this:
top - 08:09:30 up 11:40,  5 users,  load average: 1.11, 1.21, 1.13
Tasks:  63 total,   3 running,  59 sleeping,   1 stopped,   0 zombie
Cpu(s):   2.6% user,   2.3% system,   0.0% nice,  95.1% idle,   0.0% IO-wait
Mem:     62104k total,    59160k used,     2944k free,      868k buffers
Swap:   128480k total,    77872k used,    50608k free,    13316k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  Command
 1071 miernik   24   0 58704 7636  15m T  0.0 12.3  11:32.98 gnumeric
 1598 miernik   15   0 16928 6244 4696 S  0.0 10.1   0:04.82 gdb

When I typed "bt" in gdb it showed this:

(gdb) bt
  • #0 yyparse
  • #1 yyparse
  • #2 gnm_expr_parse_str
  • #3 gnm_expr_parse_str_simple
  • #4 _init
    from /usr/lib/gnumeric/1.1.17-bonobo/plugins/fn-lookup/plugin.so
  • #5 function_call_with_list
  • #6 gnm_expr_eval
  • #7 function_call_with_list
  • #8 gnm_expr_eval
  • #9 gnm_expr_eval
  • #10 gnm_expr_eval
  • #11 cell_eval_content
  • #12 dependent_eval
  • #13 workbook_recalc
  • #14 workbook_recalc_all
  • #15 workbook_sheet_detach
  • #16 workbook_sheet_delete
  • #17 g_slist_foreach
    from /usr/lib/libglib-2.0.so.0
  • #18 dialog_search_replace_query
  • #19 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #20 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #21 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #22 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #23 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #24 gtk_button_clicked
    from /usr/lib/libgtk-x11-2.0.so.0
  • #25 _gtk_button_paint
    from /usr/lib/libgtk-x11-2.0.so.0
  • #26 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #27 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #28 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #29 g_signal_emit_by_name
    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_released
    from /usr/lib/libgtk-x11-2.0.so.0
  • #33 _gtk_button_paint
    from /usr/lib/libgtk-x11-2.0.so.0
  • #34 _gtk_marshal_BOOLEAN__BOXED
    from /usr/lib/libgtk-x11-2.0.so.0
  • #35 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #36 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #37 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #38 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #39 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #40 gtk_widget_send_expose
    from /usr/lib/libgtk-x11-2.0.so.0
  • #41 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #42 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #43 _gdk_events_queue
    from /usr/lib/libgdk-x11-2.0.so.0
  • #44 g_get_current_time
    from /usr/lib/libglib-2.0.so.0
  • #45 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #46 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #47 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #48 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #49 main
  • #50 __libc_start_main
    from /lib/libc.so.6

This is exactly the same "bt" showed when I run "bt" just after 
starting gnumeric (before lading the file).

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux szrenica 2.5.62-ac1 #1 Mon Feb 24 12:51:46 CET 2003 i586
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8

Date: Thu, 22 May 2003 19:09:50 +0200
From: Miernik <miernik@ctnet.pl>
Subject: Program received signal SIGSEGV, Segmentation fault.

Here is more info:

I've done the 'deleting all but last 4' sheets operation once more. It 
ended after 2 hours, and ended with a segfault.

I've had gdb attached to it. During the run I've hadthis line apprear 
many thousand times:

** (gnumeric:641): CRITICAL **: file ../../src/expr.c: line 1544
(gnm_expr_rewrite): assertion `expr != NULL' failed

And at the end I got:

(no debugging symbols found)...(no debugging symbols found)...(no debugging
symbols found)...
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 641)]
0x08090829 in dependent_queue_recalc ()
(gdb) 

In top:

top - 12:51:39 up  4:20,  7 users,  load average: 1.38, 1.15, 1.14
Tasks:  66 total,   1 running,  64 sleeping,   1 stopped,   0 zombie
Cpu(s):   3.3% user,   5.6% system,   0.0% nice,  82.7% idle,   8.5% IO-wait
Mem:     62104k total,    60244k used,     1860k free,      492k buffers
Swap:   128480k total,    94596k used,    33884k free,     8556k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  Command
  641 miernik   25   0 73512  19m  15m T  0.0 32.5  55:24.25 gnumeric
  385 miernik   15   0 12980 6084 5216 S  0.0  9.8  32:19.75 xterm

The file http://www.miernik.ctnet.pl/a.gnumeric is exactly the file on 
which this operation was performed.
Comment 1 J.H.M. Dassen (Ray) 2003-09-05 19:10:59 UTC
Created attachment 19772 [details]
Demo
Comment 2 J.H.M. Dassen (Ray) 2003-09-05 19:14:36 UTC
The problem is repeatable for me with CVS HEAD; unfortunately I
couldn't get an updated backtrace of it.
Comment 3 Morten Welinder 2003-09-06 01:33:44 UTC
Repeatable.

It looks like we need to clear dynamic dependencies when sheets are
removed.
Comment 4 Jody Goldberg 2003-09-06 19:32:18 UTC
I've got 3 comments

1) Crash is fixed in cvs

2) Thanks for the brutal test case.  That stressed the dynamic
dependency engine nicely.  It still loads too slowly for my taste, but
deletes are much faster.  The workbook even foudn a few leaks.

3) Just say NO to drugs.  I don't know what you're trying to do with
that collection of indirects, but that is without doubt one of the
nastiest expressions I have ever seen.  There were clearly some
narcotics involved in its creation.