|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-03-23 04:07 UTC] rob at wildlime dot com
Description:
------------
Experiencing an intermittent (once every 5-10 requests) access violation.
btw, I have posted this to the PHP bug list rather than the PEAR one as it is a crash, not just a script error.
Here's the info I can glean from the debugger. I'm afraid I don't have the debug builds.
Windows XP pro SP2
Apache/1.3.33 (Win32)
PHP/4.3.10
stack trace:
7C910C27 C:\WINDOWS\system32\ntdll.dll
7C910D5C C:\WINDOWS\system32\ntdll.dll
77C2C2DE C:\WINDOWS\system32\msvcrt.dll
77C39AE9 C:\WINDOWS\system32\msvcrt.dll
77C35F5D C:\WINDOWS\system32\msvcrt.dll
77C35FEC C:\WINDOWS\system32\msvcrt.dll
10047D4E c:\php4\php4ts.dll
or sometimes:
77C46137 C:\WINDOWS\system32\msvcrt.dll
100CA6AE c:\php4\php4ts.dll
60002E50 c:\php4\php4apache.dll
6000186F c:\php4\php4apache.dll
dll base addresses:
0x60000000 php4apache.dll
0x10000000 php4ts.dll
Reproduce code:
---------------
<?php
require_once 'Date.php';
$now =& new Date();
$year = 2005;
$month = 3;
$day = 24;
$time = '09:00';
$s = sprintf("%04d-%02d-%02dT%s:00", $year, $month, $day, $time);
$date = new Date($s);
$date->before($now);
?>
Expected result:
----------------
nothing - no output, so blank browser window
Actual result:
--------------
Access violation every 5-10 requests.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 09:00:01 2025 UTC |
I am currently tracing bug that is somehow related to sprintf with %d parameters. first it occured with dotproject project-environment, on line looking like this (PEAR date package, format method): $output .= sprintf("%02d",$this->month); Again with phpmyadmin, file defines.lib.php line 47: define('PMA_PHP_INT_VERSION', (int)sprintf('%d%02d%02d', $match[1], $match[2], $match[3])); I can not reproduce this just by creating new script, creating match array and running that define - everything works just FINE! Server is: php version 4.4.0 Linux hostname 2.4.7-10 #1 Thu Sep 6 16:46:36 EDT 2001 i686 I was able to bypass this by installing dotproject to another server with php 4.3.5 / Linux hostname 2.4.27-grs-smp #1 SMP Thu Sep 16 22:12:09 EEST 2004 i686 WHAT IS IMPORTANT is that I copy pasted from your code lines: $year = 2005; $month = 3; $day = 24; $time = '09:00'; $s = sprintf("%04d-%02d-%02dT%s:00", $year, $month, $day, $time); to file defines.lib.php before line 47 and these lines from your code made system just silently die in a same way that lines I have presented. I have debugged this by using exit before and after these problem lines. So your lines made the same error I am tracing. Error is that nothing is returned to the browser. Script just silently dies on calling sprintf. So we are getting at least some hint that your error is also sprintf -related! I am totally confused what causes this. I do not know if this is php bug, but wanted to comment it here to make some more glues to anyone having this problem.