[Gambas-user] error calling external function from c library

Marcos Antonio Pandolfo Jr marcos at ...1756...
Thu Jun 19 20:14:43 CEST 2008


Hi

Im using Centos 5 and Gambas 2.0.0 and when I call  a external function in a
C library this error occurs and Gambas crash with error #6....

EXTERN TEF_inicia(Resultado AS String, Funcao AS String, Valor AS String,
CuponFiscal AS String, DataFiscal AS String, Horario AS String, Operador AS
String, ParamAdic AS String) IN "libclisitef" EXEC
"IniciaFuncaoSiTefInterativoA"

DIM la AS String
TEF_inicia(la, "000000", "{200,00}", "{12345}", "20080618", "100000",
"{MARCOS}", "{}")
The variable "la" receive the return from function TEF_inicia.

This is the error that appears in console:

*** glibc detected *** teste: double free or corruption (!prev): 0x0989bed8
***
======= Backtrace: =========
/lib/libc.so.6[0x9c2aa6]
/lib/libc.so.6(cfree+0x90)[0x9c5fc0]
teste[0x804b59f]
teste[0x8069584]
teste[0x806113c]
teste[0x80617cb]
/lib/libc.so.6(__libc_start_main+0xdc)[0x971dec]
teste[0x804a5f1]
======= Memory map: ========
001a8000-001a9000 r-xp 001a8000 00:00 0          [vdso]
001a9000-00289000 r-xp 00000000 fd:00 21541420   /usr/lib/libstdc++.so.6.0.8
00289000-0028c000 r-xp 000e0000 fd:00 21541420   /usr/lib/libstdc++.so.6.0.8
0028c000-0028e000 rwxp 000e3000 fd:00 21541420   /usr/lib/libstdc++.so.6.0.8
0028e000-00294000 rwxp 0028e000 00:00 0
007e8000-00818000 r-xp 00000000 fd:00 21541346   /usr/lib/liblcms.so.1.0.15
00818000-00819000 rwxp 00030000 fd:00 21541346   /usr/lib/liblcms.so.1.0.15
00819000-0081c000 rwxp 00819000 00:00 0
00849000-0085b000 r-xp 00000000 fd:00 21541417   /usr/lib/libXft.so.2.1.2
0085b000-0085c000 rwxp 00012000 fd:00 21541417   /usr/lib/libXft.so.2.1.2
0085e000-008c6000 r-xp 00000000 fd:00 21541348   /usr/lib/libmng.so.1.0.0
008c6000-008c9000 rwxp 00067000 fd:00 21541348   /usr/lib/libmng.so.1.0.0
0093a000-00953000 r-xp 00000000 fd:00 36339783   /lib/ld-2.5.so
00953000-00954000 r-xp 00019000 fd:00 36339783   /lib/ld-2.5.so
00954000-00955000 rwxp 0001a000 fd:00 36339783   /lib/ld-2.5.so
00957000-00959000 r-xp 00000000 fd:00 21536871   /usr/lib/libXau.so.6.0.0
00959000-0095a000 rwxp 00001000 fd:00 21536871   /usr/lib/libXau.so.6.0.0
0095c000-00a96000 r-xp 00000000 fd:00 36339785   /lib/libc-2.5.so
00a96000-00a98000 r-xp 0013a000 fd:00 36339785   /lib/libc-2.5.so
00a98000-00a99000 rwxp 0013c000 fd:00 36339785   /lib/libc-2.5.so
00a99000-00a9c000 rwxp 00a99000 00:00 0
00a9e000-00ac3000 r-xp 00000000 fd:00 36339805   /lib/libm-2.5.so
00ac3000-00ac4000 r-xp 00024000 fd:00 36339805   /lib/libm-2.5.so
00ac4000-00ac5000 rwxp 00025000 fd:00 36339805   /lib/libm-2.5.so
00ac7000-00ac9000 r-xp 00000000 fd:00 36339787   /lib/libdl-2.5.so
00ac9000-00aca000 r-xp 00001000 fd:00 36339787   /lib/libdl-2.5.so
00aca000-00acb000 rwxp 00002000 fd:00 36339787   /lib/libdl-2.5.so
00acd000-00ae0000 r-xp 00000000 fd:00 36339789   /lib/libpthread-2.5.so
00ae0000-00ae1000 r-xp 00012000 fd:00 36339789   /lib/libpthread-2.5.so
00ae1000-00ae2000 rwxp 00013000 fd:00 36339789   /lib/libpthread-2.5.so
00ae2000-00ae4000 rwxp 00ae2000 00:00 0
00ae6000-00af8000 r-xp 00000000 fd:00 21536867   /usr/lib/libz.so.1.2.3
00af8000-00af9000 rwxp 00011000 fd:00 21536867   /usr/lib/libz.so.1.2.3
00afb000-00b00000 r-xp 00000000 fd:00 21536872   /usr/lib/libXdmcp.so.6.0.0
00b00000-00b01000 rwxp 00004000 fd:00 21536872   /usr/lib/libXdmcp.so.6.0.0
00b03000-00c02000 r-xp 00000000 fd:00 21536873   /usr/lib/libX11.so.6.2.0
00c02000-00c06000 rwxp 000fe000 fd:00 21536873   /usr/lib/libX11.so.6.2.0
00c08000-00c17000 r-xp 00000000 fd:00 21537268   /usr/lib/libXext.so.6.4.0
00c17000-00c18000 rwxp 0000e000 fd:00 21537268   /usr/lib/libXext.so.6.4.0
00c1a000-00c97000 r-xp 00000000 fd:00 21536868  
/usr/lib/libfreetype.so.6.3.10
00c97000-00c9a000 rwxp 0007d000 fd:00 21536868  
/usr/lib/libfreetype.so.6.3.10
00c9c000-00cbb000 r-xp 00000000 fd:00 36339814   /lib/libexpat.so.0.5.0
00cbb000-00cbd000 rwxp 0001e000 fd:00 36339814   /lib/libexpat.so.0.5.0
00cbf000-00ce6000 r-xp 00000000 fd:00 21536869  
/usr/lib/libfontconfig.so.1.1.0
00ce6000-00cee000 rwxp 00027000 fd:00 21536869  
/usr/lib/libfontconfig.so.1.1.0
00cf0000-00cf8000 r-xp 00000000 fd:00 21536874  
/usr/lib/libXrender.so.1.3.0
00cf8000-00cf9000 rwxp 00007000 fd:00 21536874  
/usr/lib/libXrender.so.1.3.0
00cfb000-00d20000 r-xp 00000000 fd:00 21536870   /usr/lib/libpng12.so.0.10.0
00d20000-00d21000 rwxp 00024000 fd:00 21536870   /usr/lib/libpng12.so.0.10.0
00d23000-00d25000 r-xp 00000000 fd:00 21537301  
/usr/lib/libXinerama.so.1.0.0
00d25000-00d26000 rwxp 00001000 fd:00 21537301  
/usr/lib/libXinerama.so.1.0.0
00d28000-00d2c000 r-xp 00000000 fd:00 21537458   /usr/lib/libXfixes.so.3.1.0
00d2c000-00d2d000 rwxp 00003000 fd:00 21537458   /usr/lib/libXfixes.so.3.1.0
00d2f000-00d32000 r-xp 00000000 fd:00 21537382   /usr/lib/libXrandr.so.2.0.0
00d32000-00d33000 rwxp 00002000 fd:00 21537382   /usr/lib/libXrandr.so.2.0.0
00d35000-00d3e000 r-xp 00000000 fd:00 21537461  
/usr/lib/libXcursor.so.1.0.2
00d3e000-00d3f000 rwxp 00008000 fd:00 21537461  
/usr/lib/libXcursor.so.1.0.2
00d4c000-00d6d000 r-xp 00000000 fd:00 21541344   /usr/lib/libjpeg.so.62.0.0
00d6d000-00d6e000 rwxp 00020000 fd:00 21541344   /usr/lib/libjpeg.so.62.0.0
00d70000-00d87000 r-xp 00000000 fd:00 21541103   /usr/lib/libICE.so.6.3.0
00d87000-00d88000 rwxp 00016000 fd:00 21541103   /usr/lib/libICE.so.6.3.0
00d88000-00d8a000 rwxp 00d88000 00:00 0
00d8c000-00d97000 r-xp 00000000 fd:00 36339904  
/lib/libgcc_s-4.1.1-20070105.so.1
00d97000-00d98000 rwxp 0000a000 fd:00 36339904  
/lib/libgcc_s-4.1.1-20070105.so.1
00d9a000-00da2000 r-xp 00000000 fd:00 21541263   /usr/lib/libSM.so.6.0.0
00da2000-00da3000 rwxp 00007000 fd:00 21541263   /usr/lib/libSM.so.6.0.0
00fdb000-00fe4000 r-xp 00000000 fd:00 36339752   /lib/libnss_files-2.5.so
00fe4000-00fe5000 r-xp 00008000 fd:00 36339752   /lib/libnss_files-2.5.so
00fe5000-00fe6000 rwxp 00009000 fd:00 36339752   /lib/libnss_files-2.5.so
02000000-02837000 r-xp 00000000 fd:00 22021333  
/usr/lib/qt-3.3/lib/libqt-mt.so.3.3.6
02837000-02878000 rwxp 00837000 fd:00 22021333  
/usr/lib/qt-3.3/lib/libqt-mt.so.3.3.6
02878000-0287b000 rwxp 02878000 00:00 0
08048000-0806f000 r-xp 00000000 fd:00 21536857   /usr/local/bin/gbx2
0806f000-08074000 rw-p 00027000 fd:00 21536857   /usr/local/bin/gbx2
08074000-08076000 rw-p 08074000 00:00 0
0988d000-098ae000 rw-p 0988d000 00:00 0
b7b00000-b7b21000 rw-p b7b00000 00:00 0
b7b21000-b7c00000 ---p b7b21000 00:00 0
b7ce8000-b7ee8000 r--p 00000000 fd:00 21535779  
/usr/lib/locale/locale-archive
b7ee8000-b7eef000 rw-p b7ee8000 00:00 0
b7efd000-b7efe000 rw-p b7efd000 00:00 0
b7efe000-b7f05000 r--s 00000000 fd:00 21595010  
/usr/lib/gconv/gconv-modules.cache
b7f05000-b7f07000 rw-p b7f05000 00:00 0
bfaf3000-bfb08000 rwxp bfaf3000 00:00 0          [stack]
bfb08000-bfb09000 rw-p bfb08000 00:00 0

Thanks



Abraços

Marcos Pandolfo Jr
ADS Telecom




More information about the User mailing list