bug-gnu-pspp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PSPP-BUG: Re: [bug #29872] Bivariate Correlation crash


From: Harry Thijssen
Subject: PSPP-BUG: Re: [bug #29872] Bivariate Correlation crash
Date: Wed, 19 May 2010 17:51:47 +0200

This fix works for my MSWindows build.

Have fun

2010/5/19 Michel Boaventura <address@hidden>:
>
> Follow-up Comment #6, bug #29872 (project pspp):
>
> I get what is going on.
> On file covariance.c:90-92, we have:
>
> cov->n_cm = (n_vars * (n_vars - 1) ) / 2;
>
> cov->cm = xcalloc (sizeof *cov->cm, cov->n_cm);
>
> Since we only have one variable, the value of cov-> n_cm will be zero. On
> xcalloc.c:96 we have:
>
> if ((! HAVE_GNU_CALLOC && xalloc_oversized (n, s))
>
> On linux, HAVE_GNU_CALLOC is true, so the second part of this if if not being
> executed. But on windows this is false and then we execute xalloc_oversized
> passing zero as it second argument, which causes a division by zero at
> xalloc.h:77:
>
> #define xalloc_oversized(n, s)
>  ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n))
>
> I think it should be fixed at high level, by not allowing the execution of
> bivariate correlation with only one variable selectec. The attached patch
> should do it.
>
> (file #20565)
>    _______________________________________________________
>
> Additional Item Attachment:
>
> File name: fix_correlation.patch          Size:0 KB
>
>
>    _______________________________________________________
>
> Reply to this item at:
>
>  <http://savannah.gnu.org/bugs/?29872>
>
> _______________________________________________
>  Message sent via/by Savannah
>  http://savannah.gnu.org/
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]