For some reason, this code simply isn't working.
The errors it is giving:
I've not been able to make head or tail of it. 
EDIT: For some reason, the "code" markers don't play nice with C. So I'll attach the file in the next post.
Code:
#include#include #include /* float determinant(float *a, int n) {{{1 */ float determinant(float *a, int n) { float *b, det=0; if(n<2) return 0; if(n==2) det=( (*a)*(*(a+3)) - (*(a+1))*(*(a+2))); else { b=malloc((n-1)*(n-1)*sizeof(float)); int i,j,k,m=0,l=0; for(i=0;i
Code:
*** glibc detected *** ./a.out: free(): invalid next size (fast): 0x0000000000601040 *** ======= Backtrace: ========= /lib/libc.so.6[0x2ab41ff97b23] /lib/libc.so.6(cfree+0x8c)[0x2ab41ff9b26c] ./a.out[0x400877] ./a.out[0x40095a] /lib/libc.so.6(__libc_start_main+0xf4)[0x2ab41ff458e4] ./a.out[0x4005e9] ======= Memory map: ======== 00400000-00401000 r-xp 00000000 08:04 4014120 /home/aneeshm/work/se/pl-ass/mat/a.out 00600000-00601000 rw-p 00000000 08:04 4014120 /home/aneeshm/work/se/pl-ass/mat/a.out 00601000-00622000 rw-p 00601000 00:00 0 [heap] 2ab41fa89000-2ab41faa5000 r-xp 00000000 08:04 8880137 /lib/ld-2.5.so 2ab41faa5000-2ab41faaa000 rw-p 2ab41faa5000 00:00 0 2ab41fca4000-2ab41fca6000 rw-p 0001b000 08:04 8880137 /lib/ld-2.5.so 2ab41fca6000-2ab41fd27000 r-xp 00000000 08:04 8912908 /lib/libm-2.5.so 2ab41fd27000-2ab41ff26000 ---p 00081000 08:04 8912908 /lib/libm-2.5.so 2ab41ff26000-2ab41ff28000 rw-p 00080000 08:04 8912908 /lib/libm-2.5.so 2ab41ff28000-2ab42006f000 r-xp 00000000 08:04 8880190 /lib/libc-2.5.so 2ab42006f000-2ab42026f000 ---p 00147000 08:04 8880190 /lib/libc-2.5.so 2ab42026f000-2ab420272000 r--p 00147000 08:04 8880190 /lib/libc-2.5.so 2ab420272000-2ab420274000 rw-p 0014a000 08:04 8880190 /lib/libc-2.5.so 2ab420274000-2ab42027a000 rw-p 2ab420274000 00:00 0 2ab42027a000-2ab420287000 r-xp 00000000 08:04 8880139 /lib/libgcc_s.so.1 2ab420287000-2ab420487000 ---p 0000d000 08:04 8880139 /lib/libgcc_s.so.1 2ab420487000-2ab420488000 rw-p 0000d000 08:04 8880139 /lib/libgcc_s.so.1 2ab424000000-2ab424021000 rw-p 2ab424000000 00:00 0 2ab424021000-2ab428000000 ---p 2ab424021000 00:00 0 7fff8b00c000-7fff8b021000 rw-p 7fff8b00c000 00:00 0 [stack] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vdso] Aborted (core dumped)

EDIT: For some reason, the "code" markers don't play nice with C. So I'll attach the file in the next post.
Comment