#45 Assertion failure with --exec=date

open
nobody
5
2009-01-30
2009-01-30
Seungbeom Kim
No

I'm trying to simulate a daytime server with netcat.
I expect this to work, but it fails:

[on terminal A]
$ netcat -l -p 9999 -e date

[on terminal B]
$ netcat -c localhost 9999
netcat: core.c:372: core_tcp_connect: Assertion `ret == 0' failed.
Aborted

This certainly looks like a bug.
On the other hand, replacing 'date' with 'cat' apparently works.

Discussion

  • The problem with this is because the connection from the other side is closed and thus the file descriptor is reset before the client has time to read the answer. It's indeed a bug, i'll investigate it but unfortunately i'm unable to reproduce it here.