From: ljsebald <ljs...@us...> - 2023-12-15 20:08:37
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A serial program loader for the Dreamcast.". The branch, master has been updated via cd5e409584bf390cfeb8e88430cb05bd1a76823b (commit) via dce9e9a9b05613d410b74dbdd713f68279640f3f (commit) via 04348321e3dbd19177487e4e0392c6cb1c9ad2aa (commit) from da35b5992eda1330497aec78192bdd0400c239f9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cd5e409584bf390cfeb8e88430cb05bd1a76823b Merge: da35b59 dce9e9a Author: Lawrence Sebald <ljs...@us...> Date: Fri Dec 15 15:08:11 2023 -0500 Merge pull request #23 from KallistiOS/dcload_ip_fix_ports Ported 2 Bugfixes/Enhancements from DCLoad-IP commit dce9e9a9b05613d410b74dbdd713f68279640f3f Author: Falco Girgis <gyr...@gm...> Date: Thu Nov 16 12:29:46 2023 -0600 Fixed build issue + preexisting warning - log_error() is only defined in dc-load-ip, switched to perror() - included <time.h> to remove undeclared function warnings for time() commit 04348321e3dbd19177487e4e0392c6cb1c9ad2aa Author: Falco Girgis <gyr...@gm...> Date: Thu Nov 16 12:16:49 2023 -0600 Ported two bugfixes from dcload/tool IP 1) dcload-ip commit ID 6522d8089593690852b3685be2b5f5d9222ad796: - Previously, if you had completed a debugging session and had started a new one too quickly, you could very frequently get the error "error binding gdb server socket" which would also freeze the DC, making it need a hard reboot - This is because the OS hadn't had a chance to terminate the existing socket bound to the existing address - This commit sets the socket to allow for reuse of local addresses 2) dcload-ip commit ID 871419616992ce86d0437b5b3a80fc3925ebdab7: - Fixed crash on GDB disconnect. - We were getting a -1 from recv(), which we were then passing on to send_command(), which was causing a buffer overflow and crash. It seems as though MinGW might be protected from this. ----------------------------------------------------------------------- Summary of changes: host-src/tool/dc-tool.c | 11 +++++++++++ host-src/tool/syscalls.c | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/host-src/tool/dc-tool.c b/host-src/tool/dc-tool.c index 2f6c416..992ccb5 100644 --- a/host-src/tool/dc-tool.c +++ b/host-src/tool/dc-tool.c @@ -784,6 +784,17 @@ int open_gdb_socket(int port) { perror("error creating gdb server socket"); return -1; } + + const int enable_reuse_addr = 1; + int checkopt = setsockopt(gdb_server_socket, SOL_SOCKET, SO_REUSEADDR, + &enable_reuse_addr, sizeof(enable_reuse_addr)); +#ifdef __MINGW32__ + if( checkopt == SOCKET_ERROR ) { +#else + if( checkopt < 0 ) { +#endif + perror( "warning: failed to set gdb socket options" ); + } int checkbind = bind(gdb_server_socket, (struct sockaddr*)&server_addr, sizeof(server_addr)); #ifdef __MINGW32__ diff --git a/host-src/tool/syscalls.c b/host-src/tool/syscalls.c index 2632a18..ada7aa6 100644 --- a/host-src/tool/syscalls.c +++ b/host-src/tool/syscalls.c @@ -25,7 +25,9 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <errno.h> #include <sys/time.h> +#include <time.h> #include <unistd.h> #include <utime.h> #include <dirent.h> @@ -507,6 +509,11 @@ void dc_gdbpacket(void) { fprintf(stderr, "Got socket error: %d\n", WSAGetLastError()); return; } +#else + if(retval == -1) { + fprintf(stderr, "Got socket error: %s\n", strerror(errno)); + return; + } #endif send_uint(retval); if(retval > 0) hooks/post-receive -- A serial program loader for the Dreamcast. |