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

Freeze when accepting a DCC file #160

Closed
flashcode opened this Issue Aug 11, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@flashcode
Copy link
Member

commented Aug 11, 2014

Sometimes, when accepting a DCC file, there's a WeeChat freeze.
The backtrace:

(gdb) bt
#0  0x00007fc9e152fd4d in connect () at ../sysdeps/unix/syscall-template.S:81
#1  0x0000000000453152 in network_connect (sock=16, addr=0x2d8da80, addrlen=16) at /home/flashcode/src/weechat/dev/src/core/wee-network.c:620
#2  0x0000000000453462 in network_connect_to (proxy=0x2d8db00 "", address=0x2d8da80, address_length=16)
    at /home/flashcode/src/weechat/dev/src/core/wee-network.c:718
#3  0x00007fc9dbebb12b in xfer_network_connect (xfer=0x2d26850) at /home/flashcode/src/weechat/dev/src/plugins/xfer/xfer-network.c:582
#4  0x00007fc9dbebb245 in xfer_network_connect_init (xfer=0x2d26850) at /home/flashcode/src/weechat/dev/src/plugins/xfer/xfer-network.c:616
#5  0x00007fc9dbebb328 in xfer_network_accept (xfer=0x2d26850) at /home/flashcode/src/weechat/dev/src/plugins/xfer/xfer-network.c:653
#6  0x00007fc9dbeb5355 in xfer_buffer_input_cb (data=0x0, buffer=0x2d275f0, input_data=0x2d87c80 "a")
    at /home/flashcode/src/weechat/dev/src/plugins/xfer/xfer-buffer.c:278
#7  0x0000000000450d2c in input_exec_data (buffer=0x2d275f0, data=0x2d87c80 "a") at /home/flashcode/src/weechat/dev/src/core/wee-input.c:51
#8  0x00000000004512e3 in input_data (buffer=0x2d275f0, data=0xfe7540 "a") at /home/flashcode/src/weechat/dev/src/core/wee-input.c:231
#9  0x00000000004857a6 in gui_input_return (buffer=0x2d275f0) at /home/flashcode/src/weechat/dev/src/gui/gui-input.c:440
#10 0x0000000000427411 in command_input (data=0x0, buffer=0x2d275f0, argc=2, argv=0x2cc6d60, argv_eol=0x2d27f50)
    at /home/flashcode/src/weechat/dev/src/core/wee-command.c:2907
#11 0x0000000000447ba6 in hook_command_exec (buffer=0x2d275f0, any_plugin=1, plugin=0x15bc940, string=0x2d21060 "/input return")
    at /home/flashcode/src/weechat/dev/src/core/wee-hook.c:777
#12 0x0000000000450e7f in input_exec_command (buffer=0x2d275f0, any_plugin=1, plugin=0x15bc940, string=0x2d27dc0 "/input return")
    at /home/flashcode/src/weechat/dev/src/core/wee-input.c:101
#13 0x0000000000451307 in input_data (buffer=0x2d275f0, data=0x15dc520 "/input return")
    at /home/flashcode/src/weechat/dev/src/core/wee-input.c:236
#14 0x0000000000489fee in gui_key_pressed (key_str=0x6e6b00 <key_str> "\001M") at /home/flashcode/src/weechat/dev/src/gui/gui-key.c:1352
#15 0x00000000004a7876 in gui_key_flush (paste=0) at /home/flashcode/src/weechat/dev/src/gui/curses/gui-curses-key.c:424
#16 0x00000000004a7d7f in gui_key_read_cb (data=0x0, fd=0) at /home/flashcode/src/weechat/dev/src/gui/curses/gui-curses-key.c:593
#17 0x0000000000448b44 in hook_fd_exec (read_fds=0x7fffe30c4830, write_fds=0x7fffe30c47b0, exception_fds=0x7fffe30c4730)
    at /home/flashcode/src/weechat/dev/src/core/wee-hook.c:1329
 #18 0x00000000004a882c in gui_main_loop () at /home/flashcode/src/weechat/dev/src/gui/curses/gui-curses-main.c:424
 #19 0x000000000041f1e5 in main (argc=3, argv=0x7fffe30c49f8) at /home/flashcode/src/weechat/dev/src/gui/curses/main.c:41

@flashcode flashcode added this to the 1.1 milestone Aug 11, 2014

@flashcode flashcode added the bug label Aug 11, 2014

talisein added a commit to talisein/weechat-1 that referenced this issue Aug 12, 2014

@talisein

This comment has been minimized.

Copy link
Contributor

commented Aug 12, 2014

weechat_network_connect_to() shouldn't be called on an unforked process, but xfer_network_connect() is using it for receiving chats. So it is blocking on getnameinfo(remote_address), getaddrinfo(proxy), and network_connect(). I didn't touch this design FWIW ;)

Does weechat freeze permanently? Or is it just until it connects? If it is just until it connects, the above, TOTALLY UNTESTED patch may work

@flashcode

This comment has been minimized.

Copy link
Member Author

commented Aug 12, 2014

The freeze is only for some seconds, something like a timeout (about 30 seconds).
But it's hard to reproduce, I had this problem only with one guy. Maybe I could write a python script to simulate a very long answer on a connect, or preload a test lib that makes a long answer to the network functions called.

talisein added a commit to talisein/weechat-1 that referenced this issue Aug 19, 2014

@talisein

This comment has been minimized.

Copy link
Contributor

commented Aug 19, 2014

Patch has been tested and fixed. It should be ready to pull. Note: this only fixes freezes in DCC chat acceptance. There is apparently a different bug in DCC file transfers from irssi to weechat

talisein added a commit to talisein/weechat-1 that referenced this issue Aug 20, 2014

@flashcode flashcode self-assigned this Nov 9, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.