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

Segfault on tcp connect to tcp_echosvr.lua #6

Closed
losinggeneration opened this issue Oct 8, 2012 · 3 comments
Closed

Segfault on tcp connect to tcp_echosvr.lua #6

losinggeneration opened this issue Oct 8, 2012 · 3 comments

Comments

@losinggeneration
Copy link

This code causes a segfault on cleanup:

local luv = require('luv')
luv.net.tcp():connect('127.0.0.1', 8080)

OS: Arch Linux 64 bit
Lua: 5.1.5
git head: e48f475

Let me know if you need more info to reproduce the crash.

-- update to indicate that it's not on connect, but rather on cleanup

@richardhundt
Copy link
Owner

Hi, thanks for the report.

I can't repro on Ubuntu 12.04 x86_64. It may be a GC race as you have don't have the tcp socket object anchored (no local variable).

Could you change line 27 of ./src/luv.h from

#undef LUV_DEBUG

to

#define LUV_DEBUG

and recompile.

It's pretty noisy, but it'd be great if you could send me the output from the client code and I'll take a look

Thanks!
Richard

On Oct 8, 2012, at 11:54 PM, Harley Laue wrote:

local luv = require('luv')
luv.net.tcp():connect('127.0.0.1', 8080)

@losinggeneration
Copy link
Author

lua tcp_echoclient.lua
luv_thread.c: 26: luvL_thread_suspend: loop top
luv_thread.c: 5: luvL_thread_ready: SET READY
luv_thread.c: 29: luvL_thread_suspend: uv_run_once returned, active: 0
luv_thread.c: 31: luvL_thread_suspend: main ready, breaking
luv_thread.c: 36: luvL_thread_suspend: back in main
luv_object.c: 23: luvL_object_close: object closing 0x926828, type: 12
luv_stream.c: 277: luvL_stream_free: free stream: 0x926828
luv_object.c: 23: luvL_object_close: object closing 0x923868, type: 7
zsh: segmentation fault lua tcp_echoclient.lua

@richardhundt
Copy link
Owner

This was a bug in libuv - git HEAD is now fixed.

On Oct 9, 2012, at 1:59 AM, Harley Laue wrote:

lua tcp_echoclient.lua
luv_thread.c: 26: luvL_thread_suspend: loop top
luv_thread.c: 5: luvL_thread_ready: SET READY
luv_thread.c: 29: luvL_thread_suspend: uv_run_once returned, active: 0
luv_thread.c: 31: luvL_thread_suspend: main ready, breaking
luv_thread.c: 36: luvL_thread_suspend: back in main
luv_object.c: 23: luvL_object_close: object closing 0x926828, type: 12
luv_stream.c: 277: luvL_stream_free: free stream: 0x926828
luv_object.c: 23: luvL_object_close: object closing 0x923868, type: 7
zsh: segmentation fault lua tcp_echoclient.lua


Reply to this email directly or view it on GitHub.

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

No branches or pull requests

2 participants