Hi guys...another "bad new"...I was compiling some code and checking it within C and everithing was ok...but when I compile the code in order to use it inside R there something wrong.
This is what I type on the terminal in order to compile
gcc -std=gnu99 -I/usr/share/R/include -fpic -g -O2 -c codeRGLM.c -o codeRGLM.o
gcc -std=gnu99 -shared -o codeRGLM.so codeRGLM.o dgesv.o dgetrf.o dlaswp.o dgetf2.o ilaenv.o ieeeck.o dgetrs.o dpofa.o dpodi.o eigen.o svd.o -L/usr/lib/R/lib -lR
And running it inside R I got this...I have tried to do not include usr/share/R/include, but I need the headers inside in order to run the code inside R.
*** glibc detected *** /usr/lib/R/bin/exec/R: free(): invalid pointer: 0xb712d180 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7c9b454]
/lib/tls/i686/cmov/libc.so.6(cfree+0x96)[0xb7c9d4b6]
/home/.../Lavoro_PHD/revenge_C/matrix/Statistical_header/codeRGLM.so(Simpson_Simpson_Adaptive+0x1ed)[0xb7119e0d]
/home/...Lavoro_PHD/revenge_C/matrix/Statistical_header/codeRGLM.so(bstr_Q_m1+0x74)[0xb7119eb4]
/usr/lib/R/lib/libR.so[0xb7e39c39]
/usr/lib/R/lib/libR.so(Rf_eval+0x73a)[0xb7e663ea]
/usr/lib/R/lib/libR.so[0xb7e688a7]
/usr/lib/R/lib/libR.so(Rf_eval+0x465)[0xb7e66115]
/usr/lib/R/lib/libR.so(Rf_applyClosure+0x2e7)[0xb7e69e07]
/usr/lib/R/lib/libR.so(Rf_eval+0x38b)[0xb7e6603b]
/usr/lib/R/lib/libR.so(Rf_ReplIteration+0x24d)[0xb7e8d11d]
/usr/lib/R/lib/libR.so[0xb7e8d3d3]
/usr/lib/R/lib/libR.so(run_Rmainloop+0x65)[0xb7e8d475]
/usr/lib/R/lib/libR.so(Rf_mainloop+0x1c)[0xb7e8d49c]
/usr/lib/R/bin/exec/R(main+0x46)[0x80487c6]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0xb7c42685]
/usr/lib/R/bin/exec/R[0x80486b1]
What can I do without changing the source code of the function that causes this? (it is an integration routine and I have not written it :-( )