Fri 21 May 2010 11:23:44 AM UTC, comment #9:
I pushed both these patches.
Closing this item.
|
Wed 19 May 2010 04:29:23 PM UTC, comment #8:
> As I understand it, the gnulib *alloc routines are supposed to accept zero, without crashing. Perhaps we should report this as a bug on the gnulib list.
The xcalloc() function has this comment:
I personally think that this divergence from calloc()'s behavior is undesirable, but it is at least documented.
|
Wed 19 May 2010 04:12:22 PM UTC, comment #7:
Thanks for analysing this.
Your patch will fix the problem where the dialog box is used, but won't have any effect if someone types in the syntax manually.
Performing bivariate correlation on just one variable is a valid (albeit not very useful) operation.
As I understand it, the gnulib *alloc routines are supposed to accept zero, without crashing. Perhaps we should report this as a bug on the gnulib list.
Can you try the attached patch instead?
(file #20566)
|
Wed 19 May 2010 02:40:08 PM UTC, comment #6:
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)
|
Wed 19 May 2010 12:46:17 PM UTC, comment #5:
I can get the backtrace using wine:
=>0 0x00458134 xcalloc+0x14(n=0x0008, s=0) [/root/pspp-0.7.4-g360654/gl/xmalloc.c:96] in psppire (0x00bcee78)
1 0x004cbc46 covariance_create+0xa5(n_vars=0x0001, vars=0xd14430, weight=(nil), exclude=MV_ANY) [/root/pspp-0.7.4-g360654/src/math/covariance.c:92] in psppire (0x00bcef38)
2 0x0049f8f3 run_corr+0x32(r=0x2d0a10, opts=(nil), corr=(nil)) [/root/pspp-0.7.4-g360654/src/language/stats/correlations.c:284] in psppire (0x00bcefb8)
3 0x004a07ea cmd_correlation+0x1c9(lexer=0x2d5298, ds=0x2eb890) [/root/pspp-0.7.4-g360654/src/language/stats/correlations.c:480] in psppire (0x00bcf048)
4 0x0044ad09 cmd_parse_in_state+0x4b8(lexer=0x2d5298, ds=0x2eb890, state=CMD_STATE_DATA) [/root/pspp-0.7.4-g360654/src/language/command.c:227] in psppire (0x00bcf048)
5 0x002d5298 (0x00bcf068)
6 0x0040bed9 execute_syntax+0xc8(sss=0x2d5298) [/root/pspp-0.7.4-g360654/src/ui/gui/executor.c:80] in psppire (0x00bcf068)
7 0x0044b1ea cmd_parse+0x39(lexer=0x2d5298, ds=0x2eb890) [/root/pspp-0.7.4-g360654/src/language/command.c:158] in psppire (0x00bcf0b8)
8 0x0040bed9 execute_syntax+0xc8(sss=0x2dfa48) [/root/pspp-0.7.4-g360654/src/ui/gui/executor.c:80] in psppire (0x00bcf128)
9 0x00408dd9 correlation_dialog+0x1e8(de=0x1d1090) [/root/pspp-0.7.4-g360654/src/ui/gui/correlation-dialog.c:125] in psppire (0x00bcf128)
10 0x002dfa48 (0x00bcf1a8)
|
Wed 19 May 2010 08:15:51 AM UTC, comment #4:
That is right. It only happens on MSWindows. Don't know why.
|
Wed 19 May 2010 08:07:37 AM UTC, comment #3:
I'm not able to reproduce this (using GNU/Linux).
|
Sat 15 May 2010 12:37:48 PM UTC, comment #2:
I used the version of 2010-05-13 to check it before I filed the bug. So I guess it is not solved yet.
|
Fri 14 May 2010 07:00:36 PM UTC, comment #1:
I seem to remember this was a problem some time ago which has since been fixed. Can you try on Windoze with the latest master version.
|
Thu 13 May 2010 10:16:12 AM UTC, original submission:
On MSWindows, Bivariate Correlation crashes when only 1 variable is selected and OK is pressed. On openSUSE this doesn't crash and gives output.
Besides, the Bivariate Corrleation box selection box could be a bit bigger by default.
|