|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1213 Seg fault in emalloc?
Submitted: 1999-03-08 10:00 UTC Modified: 2000-07-05 02:16 UTC
From: bschaffner at accentonline dot com Assigned:
Status: Closed Package: Sybase (dblib) related
PHP Version: 3.0.7 OS: Redhat 5.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: bschaffner at accentonline dot com
New email:
PHP Version: OS:


 [1999-03-08 10:00 UTC] bschaffner at accentonline dot com
Program received signal SIGSEGV, Segmentation fault.
0x400c08d8 in chunk_free (ar_ptr=0x40115420, p=0x818fe68) at malloc.c:2942
malloc.c:2942: No such file or directory.
(gdb) bt
#0  0x400c08d8 in chunk_free (ar_ptr=0x40115420, p=0x818fe68) at malloc.c:2942
#1  0x400bffea in malloc_extend_top (ar_ptr=0x40115420, nb=56) at malloc.c:2464
#2  0x400c0635 in chunk_alloc (ar_ptr=0x40115420, nb=56) at malloc.c:2793
#3  0x400c00c5 in __libc_malloc (bytes=45) at malloc.c:2561
#4  0x805f169 in _emalloc (size=29) at alloc.c:115
#5  0x80782f4 in php3_sybase_get_column_content (sybase_ptr=0x80ca250, offset=21, 
    result=0x818fab8, column_type=111) at functions/sybase.c:664
#6  0x80785e9 in php3_sybase_query (ht=0x80c5a20, return_value=0x80a46f8, list=0x80b5bd0, 
    plist=0x80b5ba4) at functions/sybase.c:770
#7  0x804fd68 in phpparse () at control_structures_inline.h:930
#8  0x8058d50 in php3_parse (yyin=0x80c0a58) at main.c:1534
#9  0x80594cd in main (argc=2, argv=0xbffffda4) at main.c:1842

This is using the FreeTDS dblib implementation - however, it appears that the failure is in a call to emalloc(); of course, this should be rock solid code. So my next guess is a data segment corruption of some sort; and we all know how much fun that can be to track down....

Here's the script:
$conn = sybase_connect("mysqlserver", "user", "password");
if ($conn) {
    if (sybase_select_db("mydatabase", $conn)) {
        $sql = "SELECT * FROM mytable";
        $result = sybase_query($sql, $conn);
        if ($result) {
            $nrows = sybase_num_rows($result);
            for ($i = 0; $i < $nrows; $i++) {
                $value = sybase_result($result, $i, "somefield");
                echo "$value<BR>\n";
} else {
    echo "No connection\n";

I'm using the FreeTDS static libs as the shared ones didn't do anything... (still figuring that one out). 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-01 16:21 UTC] jim at cvs dot php dot net
Reclassifying as a sybase bug.
 [1999-12-03 20:22 UTC] rasmus at cvs dot php dot net
Is this still a problem with the current version of FreeTDS?  It has improved a lot lately.
 [2000-07-05 02:16 UTC] rasmus at cvs dot php dot net
Closing - all the parts of this are ancient now.  Resubmit if current versions exhibit same symptoms.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 15:01:29 2024 UTC