Bug #1213: Seg fault in emalloc?
| From: | bschaffner at accentonline dot com | Date: | Mon, 08 Mar 1999 15:00:51 +0000 |
| Subject: | Bug #1213: Seg fault in emalloc? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-4528@lists.php.net to get a copy of this message | ||
From: bschaffner@accentonline.com
Operating system: Redhat 5.2
PHP version: 3.0.7
PHP Bug Type: Reproduceable crash
Bug description: Seg fault in emalloc?
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";
}
sybase_free_result($result);
}
}
sybase_close($conn);
} 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).
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net