On Sun, Aug 29, 2010 at 5:50 AM, Tomas Kuliavas <tokul@xxxxxxxxxxxxxxxxxxxxx> wrote: > 2010.08.26 23:19 Paul Lesniewski rašė: >>>> 100% CPU load after clicking the "Submit" button?? Do you mean after >>>> you click "Submit" and go to the INBOX message list? Or do you really >>>> mean the Display Options page "Submit" button locked up the server?? >>> >>> while() cycle in sm_truncate_string() assumes that strpos/mb_strpos >>> advances >>> to next symbol. In some conditions (mbstring + raw gb2313 text + utf-8 >>> charset used by translation + some PHP version, at least 5.3.13) >> >> I think you mean 5.2.13 >> >>> it does not >>> advance. If you want better explanation, I can split that string into >>> hex >>> codes and try to find what is specific in position which locks the >>> cycle. >> >> What do you mean by "does not advance?" i.e., mb_strpos($haystack, >> $needle, $offset, $charset) === $offset? If I fake this condition by >> returning $offset from sq_strpos(), this still won't create an >> infinite loop, because eventually the entity start position variable >> is incremented beyond the allowable maximum character count. >> >> However, if mb_strpos() is returning 0 (zero) instead of FALSE as it >> should, this *does* create an infinite loop. I have uploaded a new >> patch for this condition to the tracker I previously mentioned. > > mb_strpos returns position which is smaller than offset, but it is not > zero or boolean false. Reported position does not contain character > defined in $needle. First amp is reported correctly (position = 3), second > one is reported with -8 or -10 mistake (20 or 22 instead of 30). It is not > specific to one PHP version. & position is not reported correctly in 5.2.0 > (debian etch), 5.2.13 (standard php package) and 5.3.2 (debian squeeze). > 5.2.0 should not put while() into infinite loop, because reported ; > position is higher than real & position. That is behavior that could be termed incipient, even if unintentional. The PHP bug tracker link for this issue is: http://bugs.php.net/bug.php?id=52731 The OP took the time to test and report on the fix I suggested and confirmed that it works, so it has been added to our repository and the issue considered "fixed" as far as we are concerned. > Attached test script and test results. Can't see options for attaching > files on SF tracker. Will try to reduce test script to something suitable > for PHP bug tracker. Thanks for your research. -- Paul Lesniewski SquirrelMail Team Please support Open Source Software by donating to SquirrelMail! http://squirrelmail.org/donate_paul_lesniewski.php ------------------------------------------------------------------------------ This SF.net Dev2Dev email is sponsored by: Show off your parallel programming skills. Enter the Intel(R) Threading Challenge 2010. http://p.sf.net/sfu/intel-thread-sfd ----- squirrelmail-users mailing list Posting guidelines: http://squirrelmail.org/postingguidelines List address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx List archives: http://news.gmane.org/gmane.mail.squirrelmail.user List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users