Skip to Content.
Sympa Menu

freetds - [freetds] Segmentation fault on dbinit()

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Paul Andrews <andrewsp AT andronics.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] Segmentation fault on dbinit()
  • Date: Thu, 25 Oct 2007 13:42:01 +0100

Hi All.

Getting a segmentation fault on dbinit().

Platform: Suse 10.2 / 10.3 using rpm's from OpenSuse.org

Tsql works fine.

Using GDB, it looks like fopen on the locales.conf file in
tds_get_locale is failing.

int db_connect(int nDbType, char acServer[], char acUsername[], char
acPassword[], char acAppName[], char acDatabase[], char acFreeTdsDbName[])
{
printf("\nServer: %s\n",acServer);
printf("\nUsername: %s\n",acUsername);
printf("\nPassword: %s\n", acPassword);
printf("\nAppName: %s\n", acAppName);
printf("\nDatabase: %s\n", acDatabase);
printf("\nDbName: %s\n", acFreeTdsDbName);



//dberrhandle((EHANDLEFUNC)dberr_handler);
//dbmsghandle((MHANDLEFUNC)dbmsg_handler);

if ( dbinit() == FAIL ) ==> Segmentation Fault here
printf("\nFail\n");
else
printf("\nSuccess\n");

printf("\nbefore\n");

if ( dblogin() == FAIL)
{
printf("\ndblogin() FAIL\n");
}
else
{
login = dblogin();
printf("\nLogin ok\n");
}

DBSETLUSER(login, acUsername);
DBSETLPWD(login, acPassword);
DBSETLHOST(login, acServer);
DBSETLAPP(login, acAppName);

printf("\nafter\n");

/*if ( dbopen(login, acFreeTdsDbName) == NULL )
{
return -1;
}*/

if ( dbopen(login, acFreeTdsDbName) == NULL )
{
printf("\nDBOpen() Error\n");
}
else
{
dbconn = dbopen(login, acFreeTdsDbName);
//return 0;
}

printf("\nafter 1\n");


if(dbuse(dbconn, acDatabase) == FAIL)
return -1;

printf("\nafter 2\n");

return 0;

}


Any and all help appreciated.

Paul.




Archive powered by MHonArc 2.6.24.

Top of Page