php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20935 mssql_query causes segfault
Submitted: 2002-12-11 08:40 UTC Modified: 2003-02-07 23:44 UTC
Votes:10
Avg. Score:4.6 ± 0.8
Reproduced:8 of 8 (100.0%)
Same Version:1 (12.5%)
Same OS:5 (62.5%)
From: jonas at ionax dot se Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 4.3.0 OS: RedHat Linux 7.2 / Apache 1.3.27
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
36 - 27 = ?
Subscribe to this entry?

 
 [2002-12-11 08:40 UTC] jonas at ionax dot se
(FreeTDS 1.5 2002/08/24, MSSQL 7 (remote))

mssql_query causes when using the following SQLSTATEMENT

"SELECT a.*, b.* FROM dbo.psl AS b LEFT JOIN dbo.prc AS a ON (a.idPSL = b.idPSL) WHERE b.OrderNo LIKE '%123169%' AND a.idPSL > '0'"

while simple queries like "SELECT * FROM dbo.psl" works just fine.

The problem appears only if the query tries to return
information.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-11 08:42 UTC] edink@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
 [2003-01-02 18:45 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-01-21 07:56 UTC] jonas at ionax dot se
recompiled as cgi but still generates the same error.

(gdb) bt
#0  0x00000000 in ?? ()
#1  0x08094c14 in _mssql_fetch_batch (mssql_ptr=0x82658f4, result=0x82682d4, retvalue=-1)
    at /home/jonas/devel/php-4.3.0/ext/mssql/php_mssql.c:1020
#2  0x08095267 in zif_mssql_query (ht=2, return_value=0x827731c, this_ptr=0x0, return_value_used=1)
    at /home/jonas/devel/php-4.3.0/ext/mssql/php_mssql.c:1143
#3  0x08194083 in execute (op_array=0x8264864) at /home/jonas/devel/php-4.3.0/Zend/zend_execute.c:1596
#4  0x0818406a in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/jonas/devel/php-4.3.0/Zend/zend.c:864
#5  0x08153e05 in php_execute_script (primary_file=0xbfffe780) at /home/jonas/devel/php-4.3.0/main/main.c:1573
#6  0x0819a234 in main (argc=3, argv=0xbfffe834) at /home/jonas/devel/php-4.3.0/sapi/cgi/cgi_main.c:1424
#7  0x40238657 in __libc_start_main (main=0x8199878 <main>, argc=3, ubp_av=0xbfffe834, init=0x8067d2c <_init>,
    fini=0x819aa40 <_fini>, rtld_fini=0x4000dcd4 <_dl_fini>, stack_end=0xbfffe82c) at ../sysdeps/generic/libc-start.c:129
 [2003-01-21 11:03 UTC] fmk@php.net
Can you test the same code under Win32 ?

This could be a bug in FreeTDS. To my knowledge the latest version of that is 0.60!

- Frank
 [2003-01-27 09:46 UTC] ernesto at gupos dot com dot ar
It doesn't seemd to be a FreeTDS bug. I tested the tarball and CVS version of FreeTDS with sqsh (a command line client that use FreeTDS library, www.sqsh.org) and it worked fine.

But, when I do a remote connect with PHP using the same FreeTDS library, it segfault when I do a simple:

$res = mssql_query("select * from Test");

The connection and selection of the database works fine.

That's all that I can say for now.
Thanks for all.

Ernesto
 [2003-01-27 12:29 UTC] ernesto at gupos dot com dot ar
Well, I finally make it work using the FreeTDS 0.60 with the --with-sybase=/path_to_freetds instead of --with-mssql=/path_to_freetds as metioned on the manual.

I'm using the MSSQL function anyway.

Greettings.
Ernesto
 [2003-02-07 23:44 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2003-03-11 07:27 UTC] bds at geekboys dot org
With this setup:

PHP Version 4.3.0
Red Hat 8.0 (Linux 2.4.18-3)
Apache 1.3.27
FreeTDS 0.60

It worked fine with --with-mssql

In this setup:

PHP Version 4.3.1
Red Hat 8.0 (Linux 2.4.18-14)
Apache 1.3.27
FreeTDS 0.61

I had to compile with --with-sybase to get it to work.

Exact same installation routine on both systems.
 [2003-06-14 00:44 UTC] hasshk at hotmail dot com
I'm getting an error  message 8007007F when i try to view data either by query or by Returning all rows.

Need an Advice Please.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 14 12:01:32 2024 UTC