-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*** Error in `php': malloc(): 0x000055c853bafde0 *** and e.t.c #10
Comments
You are attempting to spawn 100 * 1000 = 100,000 threads as fast as possible. I would never expect something like this to work. Honestly I'm impressed you get any sort of output. To see something actually work, simply add |
@trowski It actually should wait anyway on the threads to exit first as we have open I/O watchers as long as they exist. |
@antonim It was pointed out to me by @bwoebi that I missed the obvious: |
@antonim I guess you have some extension enabled that isn't thread-safe? |
So I reproduced the error, it would appear that this originates in PHP itself, at the point where INI entries are copied for new threads - not by pthreads but by ZE - I vaguely remember someone mentioning that this was a problem since we started refcounting strings, but I don't remember the detail. Let me poke a few people and see what I can find out ... |
The best advice right now seems to be use pre-release builds of 7.2 with pthreads ... ZTS is broken in 7.0 and 7.1 ... I'm not sure why we didn't fix it when we first became aware of it, but we didn't, and I'm not sure how reasonable it is to back port the changes (zts supports interned strings in 7.2, which are not refcounted), and I don't know who has the appetite or time (I probably don't). |
This is the commit that fixed it: php/php-src@c698299 It contains ABI breaks, so 7.2 requirement is the only reasonable thing to do ... sorry about that ... |
@krakjoe Thanks for looking into this. It's now segfaulting instead of having that memory corruption error on 7.2.0beta1. |
This runs fine now with the latest pthreads and PHP 7.2.0beta1. |
The pthreads started requiring PHP 7.2. ("ZTS in versions 7.0 and 7.1 is broken"). This locks the library to the last commit supporting PHP 7.1. See amphp/parallel#10.
Hello. When I use code:
Everytime I'v get system error ex:
*** Error in `php': malloc(): memory corruption (fast): 0x0000000002209ee2 ***
Aborted (core dumped)
or
Segmentation fault (core dumped)
or
*** Error in `php': free(): invalid pointer: 0x00005579a7f2157d ***
or
*** Error in `php': corrupted double-linked list: 0x000055ca863cc7e0 ***
This can happen after the third iteration and can be after 1000 iterations. I can not find the relationship between the number of iterations and the receipt of this error.
Could you tell me how can I avoid that problem?
The text was updated successfully, but these errors were encountered: