bugPSPP - Bugs: bug #30689, GUI crashes after a syntax error.

 
 

bug #30689: GUI crashes after a syntax error.

Submitter:  John Darrington <jmd>
Submitted:  Sun 08 Aug 2010 05:40:56 PM UTC
   
 
Category:  Graphical User Interface Severity:  7 - Major
Status:  Fixed Assigned to:  None
Open/Closed:  Closed Release:  None
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 31 Oct 2010 11:15:57 PM UTC, comment #8: 


>Not having pending transformations seems a shame. But as they don't seem to currently work properly anyway, this patch is technically an improvement.


I can read some frustration in that comment, and I sympathize with it.  I would be happy to, later, restore pending transformations after fixing the underlying problem, and if you want to file a separate bug report to that effect then that would make sense too.

Nevertheless, as you say, this is an improvement, so I pushed it.

Ben Pfaff <blp>
Group administrator
Sun 31 Oct 2010 12:49:48 PM UTC, comment #7: 

Not having pending transformations seems a shame.  But as they don't seem to currently work properly anyway, this patch is technically an improvement.

John Darrington <jmd>
Group administrator
Sat 30 Oct 2010 05:33:15 PM UTC, comment #6: 

The following patch fixes the crash and the glib criticals, but it also eliminates pending transformations from the GUI.  That might not be a bad thing, since they do tend to confuse new users at least.

John, what do you think?


From a3d409c10697a73dc2482f8f3632ff6994b2c2ea Mon Sep 17 00:00:00 2001
From: Ben Pfaff <blp@cs.stanford.edu>
Date: Sat, 30 Oct 2010 10:31:06 -0700
Subject: [PATCH] executor: Execute pending transformations after processing syntax.

Bug #30689.
---
 src/ui/gui/executor.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/ui/gui/executor.c b/src/ui/gui/executor.c
index 6ccb5a5..7b4d10c 100644
--- a/src/ui/gui/executor.c
+++ b/src/ui/gui/executor.c
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2007, 2009  Free Software Foundation
+   Copyright (C) 2007, 2009, 2010  Free Software Foundation

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -95,6 +95,8 @@ execute_syntax (struct getl_interface *sss)

   lex_destroy (lexer);

+  proc_execute (the_dataset);
+
   psppire_dict_replace_dictionary (the_data_store->dict,
                                    dataset_dict (the_dataset));

--
1.7.1


Ben Pfaff <blp>
Group administrator
Sat 30 Oct 2010 08:59:13 AM UTC, comment #5: 

The general problem seems to be that the datastore is left in an inconsistent state when syntax terminates with outstanding transformations.

John Darrington <jmd>
Group administrator
Sat 30 Oct 2010 03:42:48 AM UTC, comment #4: 

Actually, running with G_DEBUG=fatal_criticals, it is sufficient to run the original syntax file only once in the GUI to make PSPPIRE die with:


** CRITICAL **: psppire_data_store_get_value: assertion `idx < datasheet_get_n_columns (ds->datasheet)' failed


with backtrace:


#0  0xf7fe0430 in __kernel_vsyscall ()
#1  0xf74d7751 in *__GI_raise (sig=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0xf74dab82 in *__GI_abort () at abort.c:92
#3  0xf76bfc0e in g_logv () from /lib/libglib-2.0.so.0
#4  0xf76bfc36 in g_log () from /lib/libglib-2.0.so.0
#5  0xf76bfe6b in g_return_if_fail_warning () from /lib/libglib-2.0.so.0
#6  0x080718e0 in psppire_data_store_get_value (store=0x810d030, row=0,
    column=1) at ../src/ui/gui/psppire-data-store.c:908
#7  psppire_data_store_get_string (store=0x810d030, row=0, column=1)
    at ../src/ui/gui/psppire-data-store.c:612
#8  0x0809292d in psppire_sheet_model_get_string (sheet_model=0x810d030,
    row=0, column=1) at ../src/ui/gui/sheet/psppire-sheetmodel.c:175
#9  0x0809c25e in psppire_sheet_cell_draw (sheet=0x8151578,
    region=<value optimized out>) at ../lib/gtk-contrib/psppire-sheet.c:2132
#10 draw_sheet_region (sheet=0x8151578, region=<value optimized out>)
    at ../lib/gtk-contrib/psppire-sheet.c:2243
#11 0x0809c9da in psppire_sheet_expose (widget=0x8151578, event=0xffffd26c)
    at ../lib/gtk-contrib/psppire-sheet.c:2773
#12 0xf7bc9e24 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#13 0xf775f7a9 in ?? () from /usr/lib/libgobject-2.0.so.0
#14 0xf7761142 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#15 0xf7777276 in ?? () from /usr/lib/libgobject-2.0.so.0
#16 0xf7778a83 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#17 0xf7779086 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#18 0xf7cf61c6 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#19 0xf7bc3b1b in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
#20 0xf7a326cf in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#21 0xf7a3267e in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#22 0xf7a3267e in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#23 0xf7a5b4c4 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#24 0xf7a2ee73 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#25 0xf7a30e8f in gdk_window_process_all_updates ()
   from /usr/lib/libgdk-x11-2.0.so.0
#26 0xf7b3939f in ?? () from /usr/lib/libgtk-x11-2.0.so.0
#27 0xf7a0d2e8 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#28 0xf76b3371 in ?? () from /lib/libglib-2.0.so.0
#29 0xf76b52f5 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#30 0xf76b8fd8 in ?? () from /lib/libglib-2.0.so.0
#31 0xf76b9517 in g_main_loop_run () from /lib/libglib-2.0.so.0
#32 0xf7bc3dc9 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#33 0x0806b03b in run_inner_loop (data=0xffffd7c0) at ../src/ui/gui/main.c:219
#34 0xf7bc3f31 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#35 0x0806afb5 in main (argc=1, argv=0xffffd894) at ../src/ui/gui/main.c:295


Ben Pfaff <blp>
Group administrator
Sat 30 Oct 2010 03:23:05 AM UTC, comment #3: 

Applying the following patch causes an assertion failure:


diff --git a/src/data/datasheet.c b/src/data/datasheet.c
index 4abc526..d84407a 100644
--- a/src/data/datasheet.c
+++ b/src/data/datasheet.c
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -382,6 +382,8 @@ datasheet_insert_column (struct datasheet *ds,
 void
 datasheet_delete_columns (struct datasheet *ds, size_t start, size_t n)
 {
+  assert (start + n <= ds->n_columns);
+
   if (n > 0)
     {
       size_t i;


Ben Pfaff <blp>
Group administrator
Sat 30 Oct 2010 03:19:33 AM UTC, comment #2: 

valgrind shows the following


==7289== Invalid read of size 4
==7289==    at 0x4B71B2E: datasheet_delete_columns (datasheet.c:392)
==7289==    by 0x8072096: delete_variable_callback (psppire-data-store.c:312)
==7289==    by 0x7394141: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73AA62C: ??? (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73ABC03: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73AC085: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x8075486: delcb (psppire-dict.c:252)
==7289==    by 0x4B7519E: dict_delete_var (dictionary.c:627)
==7289==    by 0x4B75D05: dict_clear (dictionary.c:256)
==7289==    by 0x4B7DFAB: proc_discard_active_file (procedure.c:642)
==7289==    by 0x4A93FDC: cmd_new_file (command.c:784)
==7289==    by 0x4A94DDF: cmd_parse_in_state (command.c:219)
==7289==    by 0x4A95447: cmd_parse (command.c:150)
==7289==    by 0x8066E18: execute_syntax (executor.c:80)
==7289==    by 0x807B283: on_run_all (psppire-syntax-window.c:352)
==7289==    by 0x73A1CBB: g_cclosure_marshal_VOID__VOID (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x7394141: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73AA62C: ??? (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73ABC03: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73AC085: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x6F5EB64: ??? (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x6F60C6C: gtk_action_activate (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x73A1CBB: g_cclosure_marshal_VOID__VOID (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73927A8: ??? (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x7394141: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73A9EC9: ??? (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73ABC03: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73AC085: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x7166F74: gtk_widget_activate (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x704639F: gtk_menu_shell_activate_item (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x7047E6E: ??? (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x703D663: ??? (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x7036E23: ??? (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x73927A8: ??? (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x7394141: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73AA275: ??? (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73ABA82: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73AC085: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x71631C5: ??? (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x702F47C: gtk_propagate_event (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x7030806: gtk_main_do_event (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x4C31DD9: ??? (in /usr/lib/libgdk-x11-2.0.so.0.2000.1)
==7289==    by 0x74022F4: g_main_context_dispatch (in /lib/libglib-2.0.so.0.2400.1)
==7289==    by 0x7405FD7: ??? (in /lib/libglib-2.0.so.0.2400.1)
==7289==    by 0x7406516: g_main_loop_run (in /lib/libglib-2.0.so.0.2400.1)
==7289==    by 0x7030DC8: gtk_main (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x806B03A: run_inner_loop (main.c:219)
==7289==    by 0x7030F30: gtk_main (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x806AFB4: main (main.c:295)
==7289==  Address 0xfafdf70 is 0 bytes after a block of size 16 alloc'd
==7289==    at 0x48F2F50: malloc (vg_replace_malloc.c:236)
==7289==    by 0x4BBB2A1: xmalloc (xmalloc.c:45)
==7289==    by 0x4B71E91: datasheet_create (xalloc.h:126)
==7289==    by 0x80714F4: psppire_data_store_set_reader (psppire-data-store.c:438)
==7289==    by 0x8066EE8: execute_syntax (executor.c:103)
==7289==    by 0x807B283: on_run_all (psppire-syntax-window.c:352)
==7289==    by 0x73A1CBB: g_cclosure_marshal_VOID__VOID (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x7394141: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73AA62C: ??? (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73ABC03: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73AC085: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x6F5EB64: ??? (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x6F60C6C: gtk_action_activate (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x73A1CBB: g_cclosure_marshal_VOID__VOID (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73927A8: ??? (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x7394141: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73A9EC9: ??? (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73ABC03: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73AC085: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x7166F74: gtk_widget_activate (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x704639F: gtk_menu_shell_activate_item (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x7047E6E: ??? (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x703D663: ??? (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x7036E23: ??? (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x73927A8: ??? (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x7394141: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73AA275: ??? (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73ABA82: g_signal_emit_valist (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x73AC085: g_signal_emit (in /usr/lib/libgobject-2.0.so.0.2400.1)
==7289==    by 0x71631C5: ??? (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x702F47C: gtk_propagate_event (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x7030806: gtk_main_do_event (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x4C31DD9: ??? (in /usr/lib/libgdk-x11-2.0.so.0.2000.1)
==7289==    by 0x74022F4: g_main_context_dispatch (in /lib/libglib-2.0.so.0.2400.1)
==7289==    by 0x7405FD7: ??? (in /lib/libglib-2.0.so.0.2400.1)
==7289==    by 0x7406516: g_main_loop_run (in /lib/libglib-2.0.so.0.2400.1)
==7289==    by 0x7030DC8: gtk_main (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x806B03A: run_inner_loop (main.c:219)
==7289==    by 0x7030F30: gtk_main (in /usr/lib/libgtk-x11-2.0.so.0.2000.1)
==7289==    by 0x806AFB4: main (main.c:295)


Ben Pfaff <blp>
Group administrator
Wed 27 Oct 2010 04:37:49 PM UTC, comment #1: 

Confirmed here.  Also, doesn't crash in the terminal UI whether run once or twice.

Ben Pfaff <blp>
Group administrator
Sun 08 Aug 2010 05:40:56 PM UTC, original submission:  

The following syntax (which contains a error) ...

new file.

data list list /fred * .
begin data
99
99
97
end data.

compute x = 4.

DESCRIPTIVES /rxed .

... crashes on the second attempt to run it in the GUI.

The "compute x = 4." line seems to be relevant.

John Darrington <jmd>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by blp (Posted a comment)
  • -email is unavailable- added by jmd (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-10-31 blp StatusReady for Test/Review Fixed
        Open/ClosedOpen Closed
    2010-10-30 blp StatusNone Ready for Test/Review

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code