[freetds] Help me. Core dump with dbopen when FreeTDS on Solaris 8

ldai ldai at accunettech.com
Thu Aug 26 05:07:41 EDT 2004


On Tue, 24 Aug 2004 11:05:26 +0800, ldai wrote
> Hi,everybody:
>    I have met a strange problem with freetds's db-lib.
>    I am only to do connecting sqlserver operation in solaris 8. When 
> my code ran more than 2 days. I got a bus error.   I found bus error 
> would occur when calling dbopen and didn't return any value.   My 
> test  code is multithread and I must free any memory and struction 
> strictly.    Do you meet so strange problem? Can you help me? Or 
> give me some advice.   Thank you very much.
> 
>    My code is running in solaris , Freetds package is 0.62.4 
> ,sqlserver 2000 + win2000Server and tds version is 4.2.   My test 
> code is written in C language.   This is core code in my test code: 
|+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 		if (dbinit() == FAIL)
> 		{
> 			strcpy(cfReturnMessage, "");
> 			strcpy(cfReturnMessage, "Failed to connect 
> database. ");
> 			iFailFlag++;
> 			goto f_error;
> 		}
> 		login = dblogin();
> 		if(login==NULL)
> 		{
> 			strcpy(cfReturnMessage, "");
> 			strcpy(cfReturnMessage, "Failed to connect 
> database. ");
> 			iFailFlag++;
> 			goto f_error;
> 		}
> 		if( login < 0)
> 		{
> 			strcpy(cfReturnMessage, "");
> 			strcpy(cfReturnMessage, "Failed to connect 
> database. ");
> 			goto f_error;
> 		}
> 		DBSETLUSER(login, sUserName);
> 		DBSETLPWD(login, sPasswd);
> 		DBSETLAPP(login, "Leon-2");
> 		//This point will occur bus error when calling more than 2 
> days.
> 		dbproc = dbopen(login, sServerName);
> 		if(dbproc==NULL)
> 		{
> 			strcpy(cfReturnMessage, "");
> 			strcpy(cfReturnMessage, "Failed to connect 
> database. ");
> 			goto f_error;
> 		}
> 
> _______________________________________________

This is my core dump message:
Please help me or give me some advise.

Thank you very much.
|+++++++++++++++++++++++++++++++++++++++++++++++++++|
This GDB was configured as "sparc-sun-solaris2.8"...
Core was generated by `/export/home/leon/mssql/ms_t'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/lib/libm.so.1...done.
Loaded symbols for /usr/lib/libm.so.1
Reading symbols from /usr/lib/libsocket.so.1...done.
Loaded symbols for /usr/lib/libsocket.so.1
Reading symbols from /usr/lib/libnsl.so.1...done.
Loaded symbols for /usr/lib/libnsl.so.1
Reading symbols from /usr/lib/librt.so.1...done.
Loaded symbols for /usr/lib/librt.so.1
Reading symbols from /usr/lib/libresolv.so.2...done.
Loaded symbols for /usr/lib/libresolv.so.2
Reading symbols from /usr/local/lib/libiconv.so.2...done.
Loaded symbols for /usr/local/lib/libiconv.so.2
Reading symbols from /usr/lib/libpthread.so.1...done.
Loaded symbols for /usr/lib/libpthread.so.1
Reading symbols from /usr/lib/libc.so.1...done.
Loaded symbols for /usr/lib/libc.so.1
Reading symbols from /usr/lib/libdl.so.1...done.
Loaded symbols for /usr/lib/libdl.so.1
Reading symbols from /usr/lib/libmp.so.2...done.
Loaded symbols for /usr/lib/libmp.so.2
Reading symbols from /usr/lib/libaio.so.1...done.
Loaded symbols for /usr/lib/libaio.so.1
Reading symbols from /usr/local/lib/libgcc_s.so.1...done.
Loaded symbols for /usr/local/lib/libgcc_s.so.1
Reading symbols from /usr/platform/FJSV,GPUS/lib/libc_psr.so.1...done.
Loaded symbols for /usr/platform/FJSV,GPUS/lib/libc_psr.so.1
Reading symbols from /usr/lib/libthread.so.1...done.
Loaded symbols for /usr/lib/libthread.so.1
#0  tdsdbopen (login=0xffffffff, server=0x5bf33120 "lwb") at dblib.c:941
941             tds_set_server(login->tds_login, server);
(gdb) bt

#0  tdsdbopen (login=0xffffffff, server=0x5bf33120 "lwb") at dblib.c:941
#1  0x00016754 in SACheckIP (sConnStr=0x4ac50 "SACheck - 09-B servername=%s", 
cIpaddr=0x5bf33120 "lwb", 
    cMacAddr=0xfe807698 "nextip", iCheckNum=1835335680, 
cRetCode=0xfe807698 "nextip", cReturnMessage=0xfe807658 "lwb")
    at f_nip_SACheckIP.c:244
#2  0x00015bac in Test (arg=0x4ac50) at test_s_thread_3.c:91

--
Open WebMail Project (http://openwebmail.org)




More information about the FreeTDS mailing list