GithubHelp home page GithubHelp logo

Comments (6)

capflam avatar capflam commented on June 2, 2024 2

It happens because the applet is woken up before the connect. And here it happens because of the GC. Otherwise, we wait for the connect to wake the applet up. I'm on a fix.

from haproxy.

Darlelet avatar Darlelet commented on June 2, 2024

thanks for the repro, I'm able to reproduce:

Somehow alloc_dst_address() is called with srv being NULL here, so de-referencing it later in the function causes the above segfault

This is probably due to the recent patch serie to fix core.tcp() behavior when yield occurs in between socket creation and connecting: 751b59c (+ commits mentioned in the message)

However, this is strange because from the Lua snippet, connect() is not called, so this is strange that connect_server() is called for the socket. At this stage the stream target was not assigned (it is only assigned upon connect() from lua), so it is expected that:

srv = objt_server(s->target);

resolves to NULL in connect_server() in this case.

We need to find out why connect_server() is called too early while the stream is not yet ready.

from haproxy.

Darlelet avatar Darlelet commented on June 2, 2024

CCing @capflam since he knows this part best :)

from haproxy.

Darlelet avatar Darlelet commented on June 2, 2024

Oh nice! Good catch

from haproxy.

capflam avatar capflam commented on June 2, 2024

It should be fixed now. It will be backported as usual, as far as 2.6. @vvucetic, in the mean time, to avoid the crash, you should take care to not create a lua socket without calling Socket.connect(). Out of curiosity, what is your use case to do such thing ? I'm asking because I want to be sure to fully understand the root cause of the issue.

from haproxy.

vvucetic avatar vvucetic commented on June 2, 2024

It should be fixed now. It will be backported as usual, as far as 2.6. @vvucetic, in the mean time, to avoid the crash, you should take care to not create a lua socket without calling Socket.connect(). Out of curiosity, what is your use case to do such thing ? I'm asking because I want to be sure to fully understand the root cause of the issue.

I already reordered code because it didn’t make sense, indeed. Script initialized tcp then did some other checks and returned (in very special case). That caused crashes. I managed to isolate (reproduce) it so figured I’d report.

Thanks for the quick fix, as always.

from haproxy.

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.