Skip to Content.
Sympa Menu

freetds - Re: Apache 1.3.22 + PHP 4.0.6 + FreeTDS 0.53 + MS-SQL 7.0 (win2K) segfaulting

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Andre Costa <brblueser AT uol.com.br>
  • To: James Cameron <james.cameron AT compaq.com>
  • Cc: freetds AT franklin.metalab.unc.edu
  • Subject: Re: Apache 1.3.22 + PHP 4.0.6 + FreeTDS 0.53 + MS-SQL 7.0 (win2K) segfaulting
  • Date: Mon, 22 Apr 2002 17:40:48 -0300


Hi James,

thank you very much for the detailed response. I followed your
instructions to the letter, and here's what I've got (considerations
below) :

GNU gdb Red Hat Linux (5.1-0.71)
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux"...
(no debugging symbols found)...
(gdb) r testdb.php
Starting program: /usr/bin/php testdb.php
(no debugging symbols found)...(no debugging symbols found)...
X-Powered-By: PHP/4.0.6
Content-type: text/html

<br>
<b>Warning</b>: Sybase error: Cannot open user default database '<ID>'.
Using master database instead. (severity 11) in <b>testdb.php</b> on line
<b>2</b><br>
(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x0813c97a in tds_reset_msg_info ()
(gdb) bt
#0 0x0813c97a in tds_reset_msg_info ()
#1 0x0813a038 in dblib_handle_err_message ()
#2 0x0813c8b1 in tds_process_msg ()
#3 0x0813af52 in tds_process_default_tokens ()
#4 0x0813b12a in tds_process_login_tokens ()
#5 0x0813dc1a in tds_connect ()
#6 0x08137b9b in tdsdbopen ()
#7 0x080ea9c4 in php_sybase_do_connect ()
#8 0x080eab4d in php_if_sybase_connect ()
#9 0x0812cb1f in execute ()
#10 0x081080ec in zend_execute_scripts ()
#11 0x0806d264 in php_execute_script ()
#12 0x0806b22e in main ()
#13 0x403c5647 in __libc_start_main (main=0x806a820 <main>, argc=2,
ubp_av=0xbffff8b4, init=0x8067dac <_init>, fini=0x8147ee0 <_fini>,
rtld_fini=0x4000dcd4 <_dl_fini>, stack_end=0xbffff8ac)
at ../sysdeps/generic/libc-start.c:129

the error msg seems to be pretty obvious, so the chances I am making
something stupid is big -- please be patient with this ignorant fella ;)
However, I don't understand why it is not finding the proper DB and is
defaulting to the "master DB" instead. My /etc/freetds.conf has the
following entry:

[SQL1]
host = 10.0.3.170
port = 1433
tds version = 4.2
try domain logins = yes
try server logins = no
nt domain = KDIN\guias

(NOTE: I've tested with both protocol versions 4.2 and 7.0)

the tested PHP code was simply:

mssql_connect("SQL1", *HIDDEN*, *HIDDEN*) or die("DB CONNECT FAILED!!");

So, what's the magic?

TIA

Best,

Andre

On 22 Apr 2002 12:19:40 +1000
James Cameron <james.cameron AT compaq.com> wrote:

> Andre,
>
> To diagnose a segmentation fault, follow this procedure;
>
> a) compile PHP as a CGI
>
> (this should have been a side-effect of your build of PHP, look for
> an executable called php in the PHP build tree.)
>
> b) make a PHP script that reproduces the segmentation fault via the web
> server, but with no arguments.
>
> c) reproduce the segmentation fault using PHP on command line
>
> % ./php file.php
>
> (if this doesn't reproduce, then there is something about the
> environment that differs).
>
> d) re-run the process using gdb
>
> % gdb php
> gdb> run file.php
> gdb> bt
>
> e) send us the output from bt above, and the file.php, and it will tell
> us where the fault is happening.
>
> --
> James Cameron (james.cameron AT compaq.com)
>
> http://quozl.linux.org.au/ (or) http://quozl.netrek.org/
>




Archive powered by MHonArc 2.6.24.

Top of Page