[cfe-dev] GSL 'make check' failure

Kelly Wilson wilsonkk at shaw.ca
Mon Jul 7 06:40:49 PDT 2008

Hello all,


I have built GSL without incident at this point, but 'make check' dies in
the block subdirectory with this:


make  check-TESTS

make[1]: Entering directory `/home/notroot/gsl-1.11/block'

*** glibc detected *** ./test: free(): invalid pointer: 0x0805f050 ***

======= Backtrace: =========





FAIL: test


1 of 1 tests failed


make[1]: *** [check-TESTS] Error 1

make[1]: Leaving directory `/home/notroot/gsl-1.11/block'

make: *** [check-am] Error 2


If anyone wants the full backtrace, just let me know, but the meat of it is
the invalid pointer in being passed to free(). The free function that fails
is being called in the test_complex_binary function
(test_complex_float_binary() fails as well, although
test_complex_long_double_binary() doesn't fail???). I have looked at the
assembly output of both failing functions (and the printed machine
instructions output for LLVM) and can't see anything grossly wrong with the
code. Something coming in off the stack is the problem, it seems.


All other test cases in the block directory work fine. Looking at the
differences between the regular test cases and the complex test cases, it
seems that there is an address calculation into a struct containing the
double (or float but not 'long double', as I said) that causes the next call
to free() to fail. Here is a small snippet:


For (i=0;i<N;i++)


  v->data[2*i] = ATOMIC(N - i);

  v->data[2*i + 1] = ATOMIC(10 * (N - i) + 1);







this free() is the one that fails and the second offset into v->data is the
only different calculation when compared to test_double_binary() or
test_float_binary().so that seems to be the culprit. Any ideas?






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080707/727ea61a/attachment.html>

More information about the cfe-dev mailing list