Giter Site home page Giter Site logo

Comments (8)

nielsdos avatar nielsdos commented on September 22, 2024 1

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.

thundor avatar thundor commented on September 22, 2024

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.

thundor avatar thundor commented on September 22, 2024

I attached a tested script and its output.
curl_problem.zip

from php-src.

nielsdos avatar nielsdos commented on September 22, 2024

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.

thundor avatar thundor commented on September 22, 2024

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.

nielsdos avatar nielsdos commented on September 22, 2024

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.

cmb69 avatar cmb69 commented on September 22, 2024

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.

github-actions avatar github-actions commented on September 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.