Skip to content
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

Segment fault when run tty test #4303

Closed
hiiizxf opened this issue Feb 7, 2024 · 4 comments
Closed

Segment fault when run tty test #4303

hiiizxf opened this issue Feb 7, 2024 · 4 comments

Comments

@hiiizxf
Copy link
Contributor

hiiizxf commented Feb 7, 2024

When I run doc/code/tty/main.c, the process was terminated due to a segment fault.
In doc/code/tty/main.c, the function "uv_write" is called twice, and req with the same address is used.
And then uv__queue_insert_tail is called twice ,with the same address req->queue, causing some confusion in the stream->write_completed_queue.
It may be necessary to do the deduplication operation before the uv__queue_insert_tail.

  • Version: head
  • Platform: Linux version 6.2.0-39-generic
  • run the test as root
@bnoordhuis
Copy link
Member

Pull request welcome. The libuv book was an external contribution and isn't quite at the same level as the reference documentation.

@abidjappie
Copy link

I’d like to take a look at this if nobody else has!

@bnoordhuis
Copy link
Member

@abidjappie sure, go for it :)

@abidjappie
Copy link

@bnoordhuis I fixed it on my branch (v1.x...abidjappie:libuv:docs-tty-segment-fault)
It seems there's already a fix open by the OP, so I guess I shouldn't open a new one.

Let's get it merged? #4322

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants