[freetds] 0.61 tsql core dump, locale = "C C C C C C"

James K. Lowden jklowden at schemamania.org
Thu May 8 20:44:16 EDT 2003


On Thu, 8 May 2003 17:24:09 -0400 , "Cooperstock, Dan"
<dan.cooperstock at hepcoe.com> wrote:
> I don't seem to have TDSDUMPCONFIG set in my environment. At least,
> 	env | grep TDS
> doesn't show anything. Is there some other way this functionality could
> be turned on?
> 
> I am indeed on a 64-bit architecture.

Dan, 

Well, as usual, it didn't help a lot, but we know more than we did before.
:-/

AFAIK, no, there's no other way to turn on that functionality.  The
trouble starts hereabouts, in scr/tds/config.c:

TDSCONNECTINFO *
tds_read_config_info(TDSSOCKET * tds, TDSLOGIN * login, TDSLOCALE *
locale)
{
	TDSCONNECTINFO *connect_info;
	char *s;
	char *path;
	pid_t pid;
	int opened = 0;

	/* allocate a new structure with hard coded and build-time defaults */
	connect_info = tds_alloc_connect(locale);
	if (!connect_info)
		return NULL;

	s = getenv("TDSDUMPCONFIG");
	if (s) {
		if (*s) {
			opened = tdsdump_open(s);
		} else {
			pid = getpid();
			if (asprintf(&path, "/tmp/tdsconfig.log.%d", pid) >= 0) {
				if (*path) {
					opened = tdsdump_open(path);
				}
				free(path);
			}
		}
	}

I'm sorry to blat all that in your inbox.  As you can see, though, we call
getenv(3), and open whatever it returns, if it returns anything.  Only by
that path do we arrive at tdsdump_open().  You can see from the bt that we
started there.  

It seems very likely that, for whatever reason, getenv("TDSDUMPCONFIG") is
returning something ... most likely would of course be "stderr".   

The bus error is something different, possibly stemming from our
misdetection of the semantics or signature of your getpwuid_r(3).  Maybe
we should try to figure out what's up with getenv() first?  

Regards, 

--jkl

> Program received signal SIGBUS, Bus error.
> 0x800003ffff6c2fc4 in __getpwuid_r_posix () from /lib/pa20_64/libc.2
> 
> Here's the backtrace:
> 
> #0  0x800003ffff6c2fc4 in __getpwuid_r_posix () from /lib/pa20_64/libc.2
> #1  0x800003ffff7901e8 in tds_get_homedir () at threadsafe.c:235
> #2  0x800003ffff788fa0 in tds_get_home_file (
>     file=0x800003ffff762a18 ".freetds.conf") at config.c:210
> #3  0x800003ffff789128 in tds_read_conf_file
> (connect_info=0x8000000100008810,
>     server=0x8000000100008450 "sqldev") at config.c:247
> #4  0x800003ffff788c80 in tds_read_config_info (tds=0x0,
>     login=0x8000000100007b60, locale=0x8000000100007c00) at config.c:143
> #5  0x4000000000004428 in main (argc=7, argv=0x800003ffff7f0760) at
> tsql.c:448



More information about the FreeTDS mailing list