|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-04-14 00:19 UTC] kpw at jump9 dot com
Hi,
I've managed to uncover a reproducable segmentation fault that occurs during execution of a script containing a loop of pgsql mcrypt calls. As best as I can tell mcrypt doesn't appear to by the cuplrit as removing the mcrypt calls doesn't prent the segfault (although it does seem to change the time/position) when the crash happens. Commententing out the Db queries (implemented using PEAR DB) does prevent the crash, however, on several occausions I managed to get the script to crash after my code had completed and the send buffer had been flushed (only record of a fault was in the error log), so I'm doubtful that the error is in the db code per se.
Running gdb seems to show that memory is courupt before the script is run the first time (after researting apache) as can be seen in the trace below (this first memory error is exposed when executing any other script after an apache restart). Once the script runs for a while (it contains a rather expensive loop of db calls) it fails with the seg fault.
I've already rebuilt postgres, libmcrypt and php, to no avail...
Any ideas would be most appricated!
Thanks
Kevin
---
build flags:
'./configure' '--prefix=/etc/php' '--with-apxs=/etc/apache/bin/apxs' '--with-mysql' '--with-pgsql' '--with-mcrypt'
----
gdb session:
This GDB was configured as "ppc-yellowdog-linux"...
(gdb) run -X
Starting program: /etc/apache/bin/httpd -X
Cannot access memory at address 0x34623731.
(gdb) bt
#0 _dl_debug_state () at dl-debug.c:56
#1 0xfea2044 in dl_open_worker (a=0x30026c70) at dl-open.c:195
#2 0xfea21f8 in _dl_open (file=0xfea1d44 "\224!??|\b\002?\222a", mode=1948280425,
caller=0x7fffbdf8) at dl-open.c:232
#3 0xfede368 in dlopen_doit (a=0x7fffc018) at dlopen.c:41
#4 0x3000c078 in _dl_catch_error (errstring=0xfeef630, operate=0xfede314 <dlopen_doit>,
args=0x7fffc018) at dl-error.c:141
#5 0xfedeb04 in _dlerror_run (operate=0xfede314 <dlopen_doit>, args=0x7fffc018)
at dlerror.c:125
#6 0xfede3c4 in __dlopen_check (file=0x30026c70 "", mode=250742837) at dlopen.c:53
#7 0xf0053a0 in ?? () from /usr/lib/libltdl.so.0
#8 0x0 in ?? ()
(gdb) cont
Continuing.
Program received signal SIGSEGV, Segmentation fault.
0xf0e2c5c in ?? () from /etc/apache/libexec/libphp4.so
(gdb) bt
#0 0xf0e2c5c in ?? () from /etc/apache/libexec/libphp4.so
#1 0x0 in ?? ()
(gdb) Quit
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 13:00:01 2025 UTC |
Here's an example: If encrypt the string "Reed, Phyllis" with the key "70094cc48e1a23bf6fec60c2db6e4b71" using blowfish in CBC mode mycrypt will seg fault. However, if I change the string to "Reed,Phyllis" (no space) everything's fine. Removing a chacter from the end (""Reed, Phylli") doesn't fix the problem though, so it's apparently not length related. Very strange indeed... kpw