bugPSPP - Bugs: bug #48015, Bug in gui Independent Samples GUI

 
 

bug #48015: Bug in gui Independent Samples GUI

Submitted by:  Harry Thijssen <unknown_one>
Submitted on:  Wed 25 May 2016 02:26:42 PM UTC  
 
Category:  Graphical User Interface Severity:  5 - Average
Status:  Fixed Assigned to:  None
Open/Closed:  Closed Release:  None
Effort:  0.00

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Mon 06 Jun 2016 04:20:28 PM UTC, comment #11: 

I think this has been fixed now.

John Darrington <jmd>
Project Administrator
Sat 28 May 2016 12:36:48 PM UTC, comment #10: 

Hi John

After your coomit it doesn crash anymore in the situation  like before.

Harry Thijssen <unknown_one>
Sat 28 May 2016 11:45:51 AM UTC, comment #9: 

Hi John,

with your  commit eed5852df052914a45dc2e241 psppire does not crash with long and short string variables as group variables on MacOS when doing the independent samples test via gui.

Selecting a variable to the group entry field, does not remove the variable from the list of variables. Is this how it is supposed to be?

Friedrich

Friedrich Beckmann <beckmanf>
Project Member
Sat 28 May 2016 06:05:57 AM UTC, comment #8: 

I pushed a change which should improve things.

Please give it a thorough test.

John Darrington <jmd>
Project Administrator
Fri 27 May 2016 06:56:51 PM UTC, comment #7: 

Hi the output on a dbg session I did on MSWindows:

Program received signal SIGSEGV, Segmentation fault.
0x0058695c in var_get_type (v=0x0) at src/data/variable.c:239
warning: Source file is more recent than executable.
239       return val_type_from_width (v->width);
(gdb) backtrace
#0  0x0058695c in var_get_type (v=0x0) at src/data/variable.c:239
#1  0x00586b52 in var_is_numeric (v=0x0) at src/data/variable.c:330
#2  0x00455f61 in run_define_groups (act=0x3b51048)
    at src/ui/gui/psppire-dialog-action-indep-samps.c:163
#3  0x63c4604a in ?? ()
   from C:\Program Files (x86)\PSPP\bin\libgobject-2.0-0.dll
(gdb)

Hope this helps

Harry Thijssen <unknown_one>
Fri 27 May 2016 01:36:51 PM UTC, comment #6: 

Hi John,

i also had a look at the code. The immediate problem is the assumption of short strings in the grp_val in psppire-dialog-action-indep-samps.c:


  if (act->grp_var)
    {
      int width = var_get_width (act->grp_var);
      value_destroy (&act->cut_point, width);       <----- Here the crash, because of free of long_string
      value_destroy (&act->grp_val[0], width);
      value_destroy (&act->grp_val[1], width);
    }

  if (v)
    {
      const int width = var_get_width (v);
      value_init (&act->cut_point, width);
      value_init (&act->grp_val[0], width);
      value_init (&act->grp_val[1], width);

      if (width == 0)
        {
          act->cut_point.f  = SYSMIS;
          act->grp_val[0].f = SYSMIS;
          act->grp_val[1].f = SYSMIS;
        }
      else
        {
          act->cut_point.short_string[0] = '\0';    <-- only o.k for width < 8, else long_string
          act->grp_val[0].short_string[0] = '\0';
          act->grp_val[1].short_string[0] = '\0';
        }
    }

To crash psppire, the group variable has to be a string with length such that short_string is not used.

I noticed an additional problem:

The variable that is selected as group variable is not removed from the left treeview. I think this is coded in the selector code where there is probably a difference between treeview -> treeview and treeview->entry.

Then you can select a variable as group variable and as test variable, is this o.k.?

Friedrich

Friedrich Beckmann <beckmanf>
Project Member
Fri 27 May 2016 05:01:38 AM UTC, comment #5: 

Thanks for this backtrace.

Now that I look at this code I see that it is written rather naively.

I will try to improve it in the next few days.

John Darrington <jmd>
Project Administrator
Thu 26 May 2016 02:04:32 PM UTC, comment #4: 

This is the backtrace on MacOS when I click on the remove "sex" variable in the t-test dialog.

* thread #1: tid = 0xe09336, 0x00007fff8d563f06 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00007fff8d563f06 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff9dc314ec libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00007fffa1a446e7 libsystem_c.dylib`abort + 129
    frame #3: 0x00007fff98fb4041 libsystem_malloc.dylib`free + 425
    frame #4: 0x00000001000491af psppire`on_grp_var_change [inlined] value_destroy(width=<unavailable>) + 111 at value.h:150
    frame #5: 0x000000010004919e psppire`on_grp_var_change(entry=<unavailable>, act=0x000000010201d4c0) + 94 at psppire-dialog-action-indep-samps.c:247
    frame #6: 0x0000000100df08ab libgobject-2.0.0.dylib`g_closure_invoke + 258
    frame #7: 0x0000000100e05539 libgobject-2.0.0.dylib`signal_emit_unlocked_R + 1768
    frame #8: 0x0000000100e0628a libgobject-2.0.0.dylib`g_signal_emit_valist + 2039
    frame #9: 0x0000000100e06f3a libgobject-2.0.0.dylib`g_signal_emit_by_name + 1511
    frame #10: 0x00000001005f9aa6 libgtk-3.0.dylib`end_change + 96
    frame #11: 0x00000001005f99bd libgtk-3.0.dylib`gtk_entry_set_text + 409
    frame #12: 0x0000000100023f19 psppire`on_click [inlined] de_select_selection_entry(selector=<unavailable>) + 26 at psppire-selector.c:531
    frame #13: 0x0000000100023eff psppire`on_click [inlined] de_select_selection(selector=0x00000001021a0660) + 2 at psppire-selector.c:635
    frame #14: 0x0000000100023efd psppire`on_click(b=0x00000001021a0660) + 669 at psppire-selector.c:718
    frame #15: 0x0000000100df0adf libgobject-2.0.0.dylib`_g_closure_invoke_va + 279
    frame #16: 0x0000000100e05fb0 libgobject-2.0.0.dylib`g_signal_emit_valist + 1309
    frame #17: 0x0000000100e0693e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #18: 0x0000000100592c67 libgtk-3.0.dylib`gtk_button_do_release + 57
    frame #19: 0x0000000100592798 libgtk-3.0.dylib`gtk_real_button_released + 96
    frame #20: 0x0000000100df0adf libgobject-2.0.0.dylib`_g_closure_invoke_va + 279
    frame #21: 0x0000000100e05fb0 libgobject-2.0.0.dylib`g_signal_emit_valist + 1309
    frame #22: 0x0000000100e0693e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #23: 0x0000000100592d0f libgtk-3.0.dylib`multipress_released_cb + 38
    frame #24: 0x000000010182892c libffi.6.dylib`ffi_call_unix64 + 76
    frame #25: 0x0000000101828289 libffi.6.dylib`ffi_call + 877
    frame #26: 0x0000000100df1db6 libgobject-2.0.0.dylib`g_cclosure_marshal_generic_va + 1414
    frame #27: 0x0000000100df0adf libgobject-2.0.0.dylib`_g_closure_invoke_va + 279
    frame #28: 0x0000000100e05fb0 libgobject-2.0.0.dylib`g_signal_emit_valist + 1309
    frame #29: 0x0000000100e0693e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #30: 0x0000000100635060 libgtk-3.0.dylib`gtk_gesture_multi_press_end + 81
    frame #31: 0x0000000100df399c libgobject-2.0.0.dylib`g_cclosure_marshal_VOID__BOXEDv + 184
    frame #32: 0x0000000100df0adf libgobject-2.0.0.dylib`_g_closure_invoke_va + 279
    frame #33: 0x0000000100e05fb0 libgobject-2.0.0.dylib`g_signal_emit_valist + 1309
    frame #34: 0x0000000100e0693e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #35: 0x0000000100632227 libgtk-3.0.dylib`_gtk_gesture_check_recognized + 96
    frame #36: 0x000000010063352b libgtk-3.0.dylib`gtk_gesture_handle_event + 222
    frame #37: 0x0000000100636713 libgtk-3.0.dylib`gtk_gesture_single_handle_event + 521
    frame #38: 0x0000000100609856 libgtk-3.0.dylib`gtk_event_controller_handle_event + 107
    frame #39: 0x0000000100799c04 libgtk-3.0.dylib`_gtk_widget_run_controllers + 114
    frame #40: 0x0000000100675b    frame #40: 0x0000000100675b83 libgtk-3.0.dylib`_gtk_marshal_BOOLEAN__BOXEDv + 200
    frame #41: 0x0000000100df0b3c libgobject-2.0.0.dylib`_g_closure_invoke_va + 372
    frame #42: 0x0000000100e05fb0 libgobject-2.0.0.dylib`g_signal_emit_valist + 1309
    frame #43: 0x0000000100e0693e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #44: 0x0000000100799902 libgtk-3.0.dylib`gtk_widget_event_internal + 545
    frame #45: 0x00000001006747f4 libgtk-3.0.dylib`propagate_event + 367
    frame #46: 0x0000000100673e07 libgtk-3.0.dylib`gtk_main_do_event + 1591
    frame #47: 0x0000000100b55709 libgdk-3.0.dylib`_gdk_event_emit + 49
    frame #48: 0x0000000100b7e23f libgdk-3.0.dylib`gdk_event_source_dispatch + 39
    frame #49: 0x0000000100e5c7b9 libglib-2.0.0.dylib`g_main_context_dispatch + 279
    frame #50: 0x0000000100e5caa8 libglib-2.0.0.dylib`g_main_context_iterate + 413
    frame #51: 0x0000000100e5ccfe libglib-2.0.0.dylib`g_main_loop_run + 207
    frame #52: 0x0000000100021bf6 psppire`psppire_dialog_run(dialog=0x0000000102311c80) + 246 at psppire-dialog.c:429
    frame #53: 0x000000010003de97 psppire`psppire_dialog_action_activate(act=0x000000010201d4c0) + 359 at psppire-dialog-action.c:164
    frame #54: 0x0000000100df08ab libgobject-2.0.0.dylib`g_closure_invoke + 258
    frame #55: 0x0000000100e0531c libgobject-2.0.0.dylib`signal_emit_unlocked_R + 1227
    frame #56: 0x0000000100e0628a libgobject-2.0.0.dylib`g_signal_emit_valist + 2039
    frame #57: 0x0000000100e0693e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #58: 0x000000010051da3e libgtk-3.0.dylib`_gtk_action_emit_activate + 68
    frame #59: 0x0000000100df0adf libgobject-2.0.0.dylib`_g_closure_invoke_va + 279
    frame #60: 0x0000000100e05fb0 libgobject-2.0.0.dylib`g_signal_emit_valist + 1309
    frame #61: 0x0000000100e0693e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #62: 0x0000000100799ff8 libgtk-3.0.dylib`gtk_widget_activate + 73
    frame #63: 0x000000010068ee69 libgtk-3.0.dylib`gtk_menu_shell_activate_item + 252
    frame #64: 0x000000010068ff2a libgtk-3.0.dylib`gtk_menu_shell_button_release + 531
    frame #65: 0x0000000100675b83 libgtk-3.0.dylib`_gtk_marshal_BOOLEAN__BOXEDv + 200
    frame #66: 0x0000000100df0adf libgobject-2.0.0.dylib`_g_closure_invoke_va + 279
    frame #67: 0x0000000100e05fb0 libgobject-2.0.0.dylib`g_signal_emit_valist + 1309
    frame #68: 0x0000000100e0693e libgobject-2.0.0.dylib`g_signal_emit + 134
    frame #69: 0x0000000100799902 libgtk-3.0.dylib`gtk_widget_event_internal + 545
    frame #70: 0x00000001006747f4 libgtk-3.0.dylib`propagate_event + 367
    frame #71: 0x0000000100673e07 libgtk-3.0.dylib`gtk_main_do_event + 1591
    frame #72: 0x0000000100b55709 libgdk-3.0.dylib`_gdk_event_emit + 49
    frame #73: 0x0000000100b7e23f libgdk-3.0.dylib`gdk_event_source_dispatch + 39
    frame #74: 0x0000000100e5c7b9 libglib-2.0.0.dylib`g_main_context_dispatch + 279
    frame #75: 0x0000000100e5caa8 libglib-2.0.0.dylib`g_main_context_iterate + 413
    frame #76: 0x0000000100e5ccfe libglib-2.0.0.dylib`g_main_loop_run + 207
    frame #77: 0x000000010067369e libgtk-3.0.dylib`gtk_main + 74
    frame #78: 0x00000001000303fc psppire`main(argc=<unavailable>, argv=<unavailable>) + 492 at main.c:315
    frame #79: 0x00007fff8c4095ad libdyld.dylib`start + 1
(lldb) bt

Friedrich Beckmann <beckmanf>
Project Member
Thu 26 May 2016 01:42:50 PM UTC, comment #3: 

The bug is also in the 0.10.1 released version.

Friedrich Beckmann <beckmanf>
Project Member
Thu 26 May 2016 01:32:41 PM UTC, comment #2: 

The bug is is reproducible on MacOS in the current git

To see the problem do:

input program.
string sex (A10).
loop #i = 1 to 1000.
compute weight  = rv.normal (56, 3).
end case.
end loop.
end file.
end input program.
compute sex = "male".
save outfile = "male.sav".

input program.
string sex (A10).
loop #i = 1 to 1000.
compute weight  = rv.normal (60, 3).
end case.
end loop.
end file.
end input program.
compute sex = "female".
save outfile = "female.sav".

add files file = "male.sav"
  /file="female.sav"

then go to gui: Analyze->Compare average->T-Test for independent samples

Choose weight for testvariable
Choose sex for Groupvariable

-> Ok Button is still gray

Click in GroupVariable
Click on Remove Variable
->psppire crashes

The error message is:

psppire(61415,0x7fff7eac5000) malloc: *** error for object 0x7fb8d5d59f00: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
FriedrichsMacBook:build fritz$

Friedrich Beckmann <beckmanf>
Project Member
Wed 25 May 2016 06:23:47 PM UTC, comment #1: 

Can you try to get a backtrace using your debug version.

John Darrington <jmd>
Project Administrator
Wed 25 May 2016 02:26:42 PM UTC, original submission:  

In the MSWindows build, with the source 2016-05-25, I get a GUI crash when I click "Define groups" in the Independent Samples T test.

Harry Thijssen <unknown_one>

 

(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 jmd
  • -email is unavailable- added by beckmanf (Posted a comment)
  • -email is unavailable- added by jmd (Posted a comment)
  • -email is unavailable- added by unknown_one (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-06-06 jmd StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2016-05-27 jmd SummaryBug in gui Independent Samples T test => Bug in gui Independent Samples GUI
    2016-05-27 jmd Carbon-Copy- => Added czubillaga31@gmail.com
    2016-05-26 beckmanf StatusNone => Confirmed

    Back to the top


    Powered by Savane 3.5