[PHP-DEV] Bug #10508: Wrong result when comparing two specific strings via ==.
From: [EMAIL PROTECTED] Operating system: W2K PHP version: 4.0.4pl1 PHP Bug Type: Scripting Engine problem Bug description: Wrong result when comparing two specific strings via ==. Hi! This seems to be a bug: ?php $TextColor=00; if ($TextColor == D0) echo Why?; ? This will produce the output Why? on my system ... but: why? 00 isn't equal D0!? If I'm wrong, please tell me why ... thanks!! ... tobias wiersch -- Edit Bug report at: http://bugs.php.net/?id=10508edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Memory limit is used for all scripts instead of one?
Warning: Could not execute mail delivery program in /local/Web/sites/phpweb/bugs.php on line 419 Mail not sent! Please send this page in a mail to [EMAIL PROTECTED] manually. -- Hi there! As far as I understand, the option memory_limit sets the mem-limit for ONE script. I installed PHP as a Apache module and I set the memory_limit to 16M (via php.ini). When I allocate 8M of memory, all works fine. But when two different scripts each allocate 8M, I will get sometimes the following message: Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 4194304 bytes) in /usr/local/httpd/htdocs/testxx.php on line 6 Both scripts (testx.php and testxx.php) contain the following code: ?php $str = x; for($i=0; $i23; $i++) { $str .= $str; echo strlen($str) . br; } ? First, 1 byte will be allocated, then 2, then 4 and so on. The last allocated string has a size of 8M. It's a little difficult to reproduce the problem because I have to call both scripts exactly at the same time from my browser. But, as I said, sometimes I get the described error-message. My question is: Is this normal and memory_limit sets the limit for ALL scripts that are currently running or is this a bug? Thanks in advance! ... tobias wiersch from germany -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Memory limit is used for all scripts instead ofone? NEW: CRASHING
Hi Zeev! Zeev Suraski wrote: memory_limit applies for the duration of a single script. Each script will not be allowed to obtain more than 8MB; So, the problem you're having originates someplace else (perhaps other parts of PHP grow to consume more memory, e.g., persistent resource tables or something of the sort). The problem arrived with PHP4.0.6 which I installed yesterday. But in the meantime I discovered another BIG problem: Our server crashed tonight! Until yesterday PHP4.0.4pl1 was installed and it run without problems for months. So it seems that PHP4.0.6 caused the problem. I looked through the apache's error_log but I couldn't find anything special...the server simply stopped. Is this a known problem? Should I go back to 4.0.4pl1 or is it possible that I made a mistake while compiling the source? But the strange thing is that the server crashed not instantly but after 9 hours (we have 800,000 hits per day and at the time of the crash we had only a very small load). There were no seg. fault or something like that. Thanx for your help.. ... tobias wiersch from .de -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Memory limit is used for all scripts insteadofone? NEW: CRASHING
Hi Zeev! Zeev Suraski wrote: This isn't a known problem (well, at least I haven't heard any such complaints). It may be a coincidence (i.e. not related to 4.0.6) - I'd wait and see if this problem persists. Thanks for your help. Ok, I will give it a try. But back to the first problem. You said that the memory_limit applies to only ONE script (as I thought). You said that the problem may be somewhere else. But I got the described error-message without any load! I cutted our leased-line before the tests and then only executed the 2 test-scripts. And in 10-20% of the cases I got the error-message. BTW, our server has 512MB RAM and 90% free, so RAM seems not to be the problem. The second strange thing is: With 4.0.4pl1 the memory_limit was 8M and with 4.0.6 I increased it to 16M. I never got the message with 4.0.4pl1 but with 4.0.6 nearly instantly (after a few minutes the first time)! The two test-scripts only allocate 8MB each. When I execute only these two scripts and the server has no load besides of that and 400MB free RAM, and the mem-limit is 16M --- why will I get sometimes the out-of-memory warning? This theoretically can't be, right!? Maybe this has something to do why the server crashed tonight...? Help! ... tobias wiersch from .de -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] More infos: Memory limit is used for all scripts instead of one?
Hi Zeev! I tested a little around: 1) I dropped our leased-line, so there is no load. 2) I set the mem_limit to 12M. 3) Reboot 4) I used the 2 test-scripts as shown in one of my last mails. I called both scripts via wget at the same time. Each script should allocate 8M. 5) The wget-script then automatically saves the result and waits for 10 seconds. Then looping 4) and 5) 100 times. When I looked at the results I saw that in 40-50% of cases I will get the described out-of-mem-error!? And this can't be, because there was 400MB free memory. Do you have an idea what I can do now? After that I made a reboot and plugged our leased-line back in place. I fear that the server will crash again tonight. But the server will now write the results from 'ps', 'pstree' and 'free' every 2 minutes to a text-file. I hope this will explain some things. ... tobias wiersch from .de -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]