[freetds] freetds] Bus error with dbopen when FreeTDS on Solaris 8

ldai ldai at accunettech.com
Mon Aug 23 23:05:26 EDT 2004


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;
		}




More information about the FreeTDS mailing list