ID: 36817 Updated by: [EMAIL PROTECTED] Reported By: noah at allresearch dot com -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: Linux 2.6.11.8 PHP Version: 4.4.2 New Comment:
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 for *NIX and http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32 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. Previous Comments: ------------------------------------------------------------------------ [2006-03-22 02:22:40] noah at allresearch dot com Description: ------------ The issue: when I load a php file in a browser that references mysql, it crashes the apache thread. The clues: if I call the same php from the command line, it works perfectly! If I call a php file that doesn't use mysql, it works perfectly! The problem is only when calling a php file using mysql THROUGH A BROWSER. The environment slackware with kernel 2.6.11.8 php 5.1.2 apache 2.2.0 mysql 4.1.18 (pre-compiled downloaded from mysql.com) apache config command: ./configure --with-apr=/usr/local/apr-httpd/ --with-apr- util=/usr/local/apr-util-httpd/ --enable-so --enab le-rewrite --disable-autoindex --enable-ssl --with-ssl=/usr/ local/ssl php config command: './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '-- with-mysql=/usr/local/mysql' '--with-mysql-sock=/tmp/ mysql.sock' '--with-sqlite' '--enable-sqlite-utf8' '--with- zlib' '--with-zlib-dir' '--with-bz2' '--with-gd' '--enable- gd' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-ttf' '--with-curl=/usr/ local' '--enable-track-vars' '--with-gettext' '--with- config-file-path=/usr/local/apache2/conf' '--enable-trans- id' '--enable-ftp' '--enable-mbstring' '--with-openssl=/usr/ local/ssl' Reproduce code: --------------- Any code tht calls a mysql connection. Expected result: ---------------- The apache thread that handles this request dies with a segmentation fault php filname.php - WORKS PERFECTLY http://server.com/filename.php - CRASHES Actual result: -------------- [{fd=4, events=POLLIN}, {fd=3, events=POLLIN, revents=POLLIN}], 2, -1) = 1 accept(3, {sin_family=AF_INET, sin_port=htons(53520), sin_addr=inet_addr("70.88.177.202")}}, [16]) = 44 semop(18448458, 0xb7db66ea, 1) = 0 gettimeofday({1142990034, 232824}, NULL) = 0 getsockname(44, {sin_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("38.144.36.11")}}, [16]) = 0 fcntl64(44, F_GETFL) = 0x2 (flags O_RDWR) fcntl64(44, F_SETFL, O_RDWR|O_NONBLOCK) = 0 gettimeofday({1142990034, 233450}, NULL) = 0 brk(0x8220000) = 0x8220000 read(44, "GET /noah.php HTTP/1.1\r\nAccept: "..., 8000) = 287 gettimeofday({1142990034, 233919}, NULL) = 0 gettimeofday({1142990034, 234131}, NULL) = 0 gettimeofday({1142990034, 234261}, NULL) = 0 stat64("/usr/local/apache2/conf/hosts-deny.txt", {st_mode=S_IFREG|0644, st_size=12, ...}) = 0 open("/usr/local/apache2/conf/hosts-deny.txt", O_RDONLY| O_LARGEFILE) = 45 brk(0x8223000) = 0x8223000 read(45, "24.81.2.240\n", 4096) = 12 read(45, "", 4096) = 0 close(45) = 0 brk(0x8226000) = 0x8226000 gettimeofday({1142990034, 235119}, NULL) = 0 semop(18415689, 0xb7db66e4, 1) = 0 write(43, "70.88.177.202 - - [21/Mar/2006:1"..., 130) = 130 semop(18415689, 0xb7db66ea, 1) = 0 stat64("/data/allresearch/websites/webclipping/htdocs/ noah.php", {st_mode=S_IFREG|0644, st_size=297, ...}) = 0 getpid() = 1122 setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={60, 0}}, NULL) = 0 rt_sigaction(SIGPROF, {0xb7d4a078, [PROF], SA_RESTART| 0x4000000}, {SIG_DFL}, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [PROF], NULL, 8) = 0 brk(0x8227000) = 0x8227000 gettimeofday({1142990034, 236867}, NULL) = 0 getpid() = 1122 getcwd("/data/src/httpd-2.2.0", 4095) = 22 chdir("/data/allresearch/websites/webclipping/htdocs") = 0 lstat64("/data", {st_mode=S_IFDIR|0755, st_size=856, ...}) = 0 lstat64("/data/allresearch", {st_mode=S_IFDIR|0775, st_size=256, ...}) = 0 lstat64("/data/allresearch/websites", {st_mode=S_IFDIR|0775, st_size=688, ...}) = 0 lstat64("/data/allresearch/websites/webclipping", {st_mode=S_IFDIR|0775, st_size=192, ...}) = 0 lstat64("/data/allresearch/websites/webclipping/htdocs", {st_mode=S_IFDIR|0775, st_size=2512, ...}) = 0 lstat64("/data/allresearch/websites/webclipping/htdocs/ noah.php", {st_mode=S_IFREG|0644, st_size=297, ...}) = 0 setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={30, 0}}, NULL) = 0 rt_sigaction(SIGPROF, {0xb7d4a078, [PROF], SA_RESTART| 0x4000000}, {0xb7d4a078, [PROF], SA_RESTART|0x4000000}, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [PROF], NULL, 8) = 0 getcwd("/data/allresearch/websites/webclipping/htdocs", 4096) = 46 brk(0x8228000) = 0x8228000 lstat64("/data", {st_mode=S_IFDIR|0755, st_size=856, ...}) = 0 lstat64("/data/allresearch", {st_mode=S_IFDIR|0775, st_size=256, ...}) = 0 lstat64("/data/allresearch/websites", {st_mode=S_IFDIR|0775, st_size=688, ...}) = 0 lstat64("/data/allresearch/websites/webclipping", {st_mode=S_IFDIR|0775, st_size=192, ...}) = 0 lstat64("/data/allresearch/websites/webclipping/htdocs", {st_mode=S_IFDIR|0775, st_size=2512, ...}) = 0 lstat64("/data/allresearch/websites/webclipping/htdocs/ noah.php", {st_mode=S_IFREG|0644, st_size=297, ...}) = 0 open("/data/allresearch/websites/webclipping/htdocs/ noah.php", O_RDONLY) = 45 fstat64(45, {st_mode=S_IFREG|0644, st_size=297, ...}) = 0 fstat64(45, {st_mode=S_IFREG|0644, st_size=297, ...}) = 0 lseek(45, 0, SEEK_CUR) = 0 lseek(45, 0, SEEK_SET) = 0 brk(0x822d000) = 0x822d000 read(45, "<?php\n\n$dbh = mysql_pconnect(\'38"..., 8192) = 297 read(45, "", 8192) = 0 close(45) = 0 open("/usr/local/apr-util-httpd//lib/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) PrivoxyWindowOpen("/usr/local/BerkeleyDB.4.2/lib/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) PrivoxyWindowOpen("/usr/local/apr-httpd/lib/libnss_db.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) PrivoxyWindowOpen("/etc/ld.so.cache", O_RDONLY) = 45 fstat64(45, {st_mode=S_IFREG|0644, st_size=28726, ...}) = 0 old_mmap(NULL, 28726, PROT_READ, MAP_PRIVATE, 45, 0) = 0xb79ab000 close(45) = 0 open("/lib/libnss_db.so.2", O_RDONLY) = 45 read(45, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000 \23\0"..., 1024) = 1024 fstat64(45, {st_mode=S_IFREG|0755, st_size=18756, ...}) = 0 old_mmap(NULL, 21240, PROT_READ|PROT_EXEC, MAP_PRIVATE, 45, 0) = 0xb79a5000 mprotect(0xb79aa000, 760, PROT_NONE) = 0 old_mmap(0xb79aa000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 45, 0x4000) = 0xb79aa000 close(45) = 0 open("/usr/local/apr-util-httpd//lib/libnss_files.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) PrivoxyWindowOpen("/usr/local/BerkeleyDB.4.2/lib/libnss_files.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) PrivoxyWindowOpen("/usr/local/apr-httpd/lib/libnss_files.so.2", O_RDONLY) = -1 ENOENT (No such file or directory) PrivoxyWindowOpen("/lib/libnss_files.so.2", O_RDONLY) = 45 read(45, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \320\34"..., 1024) = 1024 fstat64(45, {st_mode=S_IFREG|0755, st_size=233089, ...}) = 0 old_mmap(NULL, 33740, PROT_READ|PROT_EXEC, MAP_PRIVATE, 45, 0) = 0xb799c000 mprotect(0xb79a4000, 972, PROT_NONE) = 0 old_mmap(0xb79a4000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 45, 0x8000) = 0xb79a4000 close(45) = 0 open("/usr/local/apr-util-httpd//lib/libdb-3.1.so", O_RDONLY) = -1 ENOENT (No such file or directory) PrivoxyWindowOpen("/usr/local/BerkeleyDB.4.2/lib/libdb-3.1.so", O_RDONLY) = -1 ENOENT (No such file or directory) PrivoxyWindowOpen("/usr/local/apr-httpd/lib/libdb-3.1.so", O_RDONLY) = -1 ENOENT (No such file or directory) PrivoxyWindowOpen("/lib/libdb-3.1.so", O_RDONLY) = 45 read(45, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \200\361"..., 1024) = 1024 fstat64(45, {st_mode=S_IFREG|0755, st_size=494600, ...}) = 0 old_mmap(NULL, 489772, PROT_READ|PROT_EXEC, MAP_PRIVATE, 45, 0) = 0xb7924000 mprotect(0xb799a000, 6444, PROT_NONE) = 0 old_mmap(0xb799a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 45, 0x75000) = 0xb799a000 close(45) = 0 munmap(0xb79ab000, 28726) = 0 open("/etc/mtab", O_RDONLY) = 45 fstat64(45, {st_mode=S_IFREG|0644, st_size=185, ...}) = 0 old_mmap(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE| MAP_ANONYMOUS, -1, 0) = 0xb7904000 read(45, "/dev/hda1 / reiserfs rw 0 0\n/dev"..., 131072) = 185 close(45) = 0 munmap(0xb7904000, 131072) = 0 open("/proc/cpuinfo", O_RDONLY) = 45 fstat64(45, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE| MAP_ANONYMOUS, -1, 0) = 0xb7923000 read(45, "processor\t: 0\nvendor_id\t: Genuin"..., 1024) = 924 read(45, "", 1024) = 0 close(45) = 0 munmap(0xb7923000, 4096) = 0 --- SIGSEGV (Segmentation fault) --- +++ killed by SIGSEGV +++ ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36817&edit=1
