bugPSPP - Bugs: bug #36395, src/math/histogram.c:111:...

 
 

bug #36395: src/math/histogram.c:111: adjust_bin_ranges: Assertion `lower_limit * half_bin_width <= min' failed

Submitter:  Mindaugas <embar>
Submitted:  Fri 04 May 2012 10:46:56 AM UTC
   
 
Category:  Other Severity:  7 - Major
Status:  Fixed Assigned to:  jmd
Open/Closed:  Closed Release:  Before 0.8.0
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 26 Nov 2012 08:17:24 PM UTC, comment #7: 

I pushed a fix for this.

John Darrington <jmd>
Group administrator
Mon 26 Nov 2012 06:32:08 PM UTC, comment #6: 


> Then I think the assertions should be dropped, since the example given generates perfectly acceptable histograms.
> I'll checkin a change which drops all those which can suffer from floating point rounding errors.


Thank you!

Ben Pfaff <blp>
Group administrator
Mon 26 Nov 2012 06:24:44 PM UTC, comment #5: 

Then I think the assertions should be dropped, since the example given generates perfectly acceptable histograms.

I'll checkin a change which drops all those which can suffer from
floating point rounding errors.

John Darrington <jmd>
Group administrator
Sun 25 Nov 2012 06:50:14 PM UTC, comment #4: 


>I think it is safe to remove that particular assertion (although it is algebraically correct).


Even though it's algebraically correct, Mindaugas demonstrated that it isn't correct in IEEE floating-point arithmetic.

I'm attaching a commit that would replace most the assertions by an error message.

I'm happy to use some other method, such as just dropping that assertion or some of the assertions, if you think that is better.  But assertion failures are serious problems for users.

>What other reasons do you think would cause it to fail?


I'm looking at this:


  if (max == min)
    {
      msg (MW, _("Not creating histogram because the data contains less than 2 distinct values"));
      return NULL;
    }


Thanks,

Ben.

(file #26969)

Ben Pfaff <blp>
Group administrator
Sun 25 Nov 2012 06:38:47 AM UTC, comment #3: 

I think it is safe to remove that particular assertion (although it is algebraically correct).

What other reasons do you think would cause it to fail?

John Darrington <jmd>
Group administrator
Sat 24 Nov 2012 07:39:44 PM UTC, comment #2: 

John, the histogram_create() function can already fail for other reasons.  Do you think that it would be reasonable to simply fail to create a histogram (with an appropriate message) if any of these assertions fail, instead of aborting the program?  I suspect that due to the nature of floating-point arithmetic it will be very difficult to construct a histogram in every possible case.

Ben Pfaff <blp>
Group administrator
Sun 06 May 2012 11:51:56 AM UTC, comment #1: 

Seems is fixed in psppire 0.7.9-g6fb502
But only with a.txt

But now try with attached RRI_duomenynas_filtruotas.sav file:
Crash if I execute this:
SORT CASES BY Zmogus dalis susitikimas_a.
SPLIT FILE LAYERED BY  Zmogus dalis susitikimas_a.
FREQUENCIES
/VARIABLES= RRI
/FORMAT=AVALUE NOTABLE
/HISTOGRAM=NONORMAL.



(file #25803)

Mindaugas <embar>
Fri 04 May 2012 10:46:56 AM UTC, original submission:  

Crash then try to obtain histogram from data (attached as a.txt).

How to reproduce:
Import a.txt (attached) in PSPPIRE
Go Analyze > Descriptive Statistics > Frequencies
Press Charts, select "Draw histogram".
Continue, OK.

Result in gdb:

psppire: src/math/histogram.c:111: adjust_bin_ranges: Assertion `lower_limit * half_bin_width <= min' failed.


Program received signal SIGABRT, Aborted.
0x00007ffff3b90d95 in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff3b90d95 in raise () from /lib64/libc.so.6
#1  0x00007ffff3b922ab in abort () from /lib64/libc.so.6
#2  0x00007ffff3b898fe in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007ffff3b899a2 in __assert_fail () from /lib64/libc.so.6
#4  0x00007ffff7b954d1 in adjust_bin_ranges () from /usr/lib64/pspp/libpspp-0.7.9-ge0d88b.so
#5  0x00007ffff7b95618 in histogram_create () from /usr/lib64/pspp/libpspp-0.7.9-ge0d88b.so
#6  0x00007ffff7b8e380 in freq_tab_to_hist () from /usr/lib64/pspp/libpspp-0.7.9-ge0d88b.so
#7  0x00007ffff7b8fc5b in cmd_frequencies () from /usr/lib64/pspp/libpspp-0.7.9-ge0d88b.so
#8  0x00007ffff7b0f68c in cmd_parse_in_state () from /usr/lib64/pspp/libpspp-0.7.9-ge0d88b.so
#9  0x000000000044b9df in execute_syntax ()
#10 0x000000000044bbc9 in execute_syntax_string ()
#11 0x000000000044d955 in frequencies_dialog ()
#12 0x00007ffff54f8a14 in g_closure_invoke (closure=0x809b70, return_value=0x0, n_param_values=1, param_values=
    0x159dc60, invocation_hint=<optimized out>) at gclosure.c:774
#13 0x00007ffff550a99a in signal_emit_unlocked_R (node=<optimized out>, detail=0, instance=0x7e0b00, emission_return=
    0x0, instance_and_params=0x159dc60) at gsignal.c:3272
#14 0x00007ffff5514021 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>,
    detail=<optimized out>, var_args=<optimized out>) at gsignal.c:3003
#15 0x00007ffff55141c2 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>)
    at gsignal.c:3060
#16 0x00007ffff6fec553 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
#17 0x00007ffff54f8a14 in g_closure_invoke (closure=0x7f29e0, return_value=0x0, n_param_values=1, param_values=
    0x15882a0, invocation_hint=<optimized out>) at gclosure.c:774
#18 0x00007ffff550a18a in signal_emit_unlocked_R (node=<optimized out>, detail=0, instance=0x81b5b0, emission_return=
    0x0, instance_and_params=0x15882a0) at gsignal.c:3202
#19 0x00007ffff5514021 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>,
    detail=<optimized out>, var_args=<optimized out>) at gsignal.c:3003
#20 0x00007ffff55141c2 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>)
    at gsignal.c:3060
#21 0x00007ffff71c6b0e in gtk_widget_activate () from /usr/lib64/libgtk-x11-2.0.so.0
#22 0x00007ffff70c1dbd in gtk_menu_shell_activate_item () from /usr/lib64/libgtk-x11-2.0.so.0
#23 0x00007ffff70c2157 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
#24 0x00007ffff70ae958 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
#25 0x00007ffff54f8a14 in g_closure_invoke (closure=0x6ff9f0, return_value=0x7fffffffd6d0, n_param_values=2,
    param_values=0x10f2a40, invocation_hint=<optimized out>) at gclosure.c:774
#26 0x00007ffff550a7cf in signal_emit_unlocked_R (node=<optimized out>, detail=0, instance=0x7f6dc0, emission_return=
    0x7fffffffd830, instance_and_params=0x10f2a40) at gsignal.c:3310
#27 0x00007ffff5513df3 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>,
    detail=<optimized out>, var_args=<optimized out>) at gsignal.c:3013
#28 0x00007ffff55141c2 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>)
    at gsignal.c:3060
#29 0x00007ffff71c7911 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
#30 0x00007ffff70acb13 in gtk_propagate_event () from /usr/lib64/libgtk-x11-2.0.so.0
#31 0x00007ffff70ace73 in gtk_main_do_event () from /usr/lib64/libgtk-x11-2.0.so.0
#32 0x00007ffff6d1864c in gdk_event_dispatch (source=<optimized out>, callback=<optimized out>,
    user_data=<optimized out>) at gdkevents-x11.c:2377
#33 0x00007ffff4c2758d in g_main_dispatch (context=0x6f9870) at gmain.c:2425
#34 g_main_context_dispatch (context=0x6f9870) at gmain.c:2995
#35 0x00007ffff4c27d88 in g_main_context_iterate (context=0x6f9870, block=<optimized out>, dispatch=1,
    self=<optimized out>) at gmain.c:3073
#36 0x00007ffff4c282c2 in g_main_loop_run (loop=0xb79dc0) at gmain.c:3281
#37 0x00007ffff70abec7 in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
#38 0x000000000044ecd6 in run_inner_loop ()
#39 0x00007ffff70ac01f in gtk_main () from /usr/lib64/libgtk-x11-2.0.so.0
#40 0x000000000041f3fb in main ()

Mindaugas <embar>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #25803:  RRI_duomenynas_filtruotas added by embar (919KiB - application/octet-stream - SAV data file for test)
file #25783:  a.txt added by embar (2KiB - text/plain - data)

 

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 (Updated the item)
  • -email is unavailable- added by embar (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 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-11-26 jmd StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2012-11-25 blp Attached File- Added 0001-histogram-Replace-assertion-failures-by-errors-for-b.patch, #26969
    2012-11-24 blp Assigned toNone jmd
    2012-05-06 embar Attached File- Added RRI_duomenynas_filtruotas, #25803
    2012-05-04 jmd CategoryNone Other
        Severity5 - Average 7 - Major
        StatusNone Confirmed
        ReleaseNone Before 0.8.0
    2012-05-04 embar Attached File- Added a.txt, #25783

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code