incorrect retval type used for socket API resulting in internal error
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
Several functions in src/socket.c use a size_t to contain the return value from socket API calls, where they (on linux at least) should be ssize_t (error is signaled with -1).
In vice_network_send(), this may generate the error "vice_network_send: internal error" if the socket is closed by the client during a send.
An additional anomaly is that when this happens during a remote monitor session, it will loop with this message indefinitely, probably due to the condition not being checked correctly further down.
src/monitor/monitor_network.c: monitor_network_transmit() casts this back from int to size_t again, not sure where it ends up.
Starting vice with
x64sc -default -remotemonitor -remotemonitoraddress ip4://127.0.0.1:6510
and then doingecho -en 'help\n\x03\n' | nc localhost 6510
followed by a manual ctrl-C seems to trigger the condition in vice_network_send().@compyx is this fixed now?
There was a rewrite of the return value types. The actual symptom reporter here remains however.