Comments (8)
I'm having trouble to replicate this.
I don't think there's a crash here, and I don't think curl is to blame.
I think the two requests are trying to append to the same file at the same time. This is bound to cause problems.
You can validate whether this is the case by creating a file with the hash as the filename. If two files exists, one for each request, you know that the curl code did finish and it was a race condition between writing to the same file.
If only one file exists, there's a bug in PHP.
from php-src.
I added the file_put_contents just to identify the stopping point. I tried to minimize the code as the relevancy as much as I could.
In my script, the second request i don't allow it to make the curl request.
My log shows:
2024-05-23 19:26:34 c052862e3b0a79bf2e85584d87fe328b 2
c052862e3b0a79bf2e85584d87fe328b - 3544
- 3447
- 479
- 488
- 490
- 495
- 502
- 518
- 523
- 526
- 528
- 535
2024-05-23 19:26:34 - 3510
2024-05-23 19:26:34 1ecfa999f2e74111e326ec0c771de847 0
DONE
2024-05-23 19:26:34 - 3510
c052862e3b0a79bf2e85584d87fe328b and 1ecfa999f2e74111e326ec0c771de847 are the hashes for the 2 requests
On first access i lock the request in the database so it is not allowed to perform a second time until unlocked.
2024-05-23 19:26:34 c052862e3b0a79bf2e85584d87fe328b 2 (2 means number of affected rows in the database and allows to make the curl request functionality)
2024-05-23 19:26:34 1ecfa999f2e74111e326ec0c771de847 0 (0 means number of affected rows in the database and stops the functionality)
535 is the line containing the file_put_contents before curl_exec
3510 is the line in the register_shutdown_function function
I am open to suggestions on how to demonstrate this further if necessary
from php-src.
I attached a tested script and its output.
curl_problem.zip
from php-src.
Thanks for the standalone reproducer!
I'm not seeing curl crashes on my end.
If I press F5 fast twice then the first request still completes and I see both lines 127 & 129 in the output log.
I tried this multiple times but no dice.
What version of libcurl are you using and which SAPI (e.g. fpm, apache, ...) are using?
from php-src.
Attached php_info for the server where i am still able to reproduce:
PHP 8.1.28 - phpinfo().zip
Informative only:
Please note that on OTHER server i was also UNABLE to reproduce. Attaching php_info for this server where all is working fine:
PHP 8.1.2-1ubuntu2.17 - phpinfo().zip
from php-src.
I don't really have a clue unfortunately.
I can see the curl and openssl versions are different though, so I wonder if that's related to the issue somehow... It wouldn't be the first time that a user experiences an upstream library issue.
from php-src.
Hmm, maybe that is a LiteSpeed API or server issue? Anyhow, if nobody can reproduce this with any of the actively supported PHP versions, that would be a WONTFIX.
from php-src.
No feedback was provided. The issue is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so. Thank you.
from php-src.
Related Issues (20)
- stream_get_contents/fread timeouts HOT 4
- Allow to build apache2 SAPI same time with other SAPIs HOT 2
- Running out of memory in custom session handler's `write` function causes "Cannot call session save handler in a recursive manner" HOT 4
- Reconsider usages of `gethostbyname_r()` HOT 6
- Require `poll()` for UNIX based OSs and improve emulation for Windows HOT 2
- Build with libxml2 versions 2.9.0 to 2.9.3 fails HOT 6
- Install Redis with PECL fatal error: standard/php_random.h: No such file or directory HOT 4
- OPCache File Inclusion and Function Call Errors: Letter Shifting Issue During High Load on PHP 8.3.10 HOT 19
- Run a nightly build with AVX-512 emulation
- Integer overflow in curl_multi_select HOT 3
- Segmentation fault (access null pointer) in ext/dom/xml_common.h HOT 1
- Signed integer overflow in ext/standard/scanf.c HOT 3
- Stubs: internally modifyable properties are not @readonly HOT 6
- --disable-ipv6 during compilation produces error EAI_SYSTEM not found on php-8.3.10-src HOT 2
- Segmentation fault (access null pointer) in ext/dom/html5_serializer.c HOT 1
- Readonly liskov violations in new Dom API HOT 6
- ReflectionClass::getParentClass() returns false on interfaces that extend another interface HOT 4
- Avoid circular module dependencies HOT 9
- Segmentation fault (access null pointer) in ext/date/lib/parse_tz.c HOT 3
- directory functions doesn't support IO_REPARSE_TAG_LX_SYMLINK reparse points (Unix/WSL symlinks) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-src.