From afb4a67f0e985cfb331810917e78e0e59c823c7b Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 6 Dec 2019 12:59:18 -0800 Subject: [PATCH 1/2] PANICTRACE memory leak Changing from BETA to RELEASED resulted in turning off PANICTRACE and that exposed a minor memory leak. Only applies to program exit so doesn't impact play. --- doc/fixes36.4 | 33 +++++++++++++++++++++++++++++++++ src/sys.c | 5 ++--- 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 doc/fixes36.4 diff --git a/doc/fixes36.4 b/doc/fixes36.4 new file mode 100644 index 000000000..376382a97 --- /dev/null +++ b/doc/fixes36.4 @@ -0,0 +1,33 @@ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.0 $ $NHDT-Date: 1575665952 2019/12/06 20:59:12 $ + +This fixes36.4 file is here to capture information about updates in the 3.6.x +lineage following the release of 3.6.3 in December 2019. Hypothetical version +3.6.4 may not be released, in which case these fixes will appear in 3.7.0. + +General Fixes and Modified Features +----------------------------------- +GDBPATH and GREPPATH from sysconf or -D... on compilation command line were + being processed even if PANICTRACE was disabled but only being freed + at end of game when that was enabled + + +Fixes to Post-3.6.3 Problems that Were Exposed Via git Repository +------------------------------------------------------------------ + + +Platform- and/or Interface-Specific Fixes or Features +----------------------------------------------------- + + +General New Features +-------------------- + + +NetHack Community Patches (or Variation) Included +------------------------------------------------- + + +Code Cleanup and Reorganization +------------------------------- + + diff --git a/src/sys.c b/src/sys.c index 8c5fb428b..a72a87b4b 100644 --- a/src/sys.c +++ b/src/sys.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 sys.c $NHDT-Date: 1547118632 2019/01/10 11:10:32 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.43 $ */ +/* NetHack 3.6 sys.c $NHDT-Date: 1575665952 2019/12/06 20:59:12 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.46 $ */ /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -107,12 +107,11 @@ sysopt_release() if (sysopt.genericusers) free((genericptr_t) sysopt.genericusers), sysopt.genericusers = (char *) 0; -#ifdef PANICTRACE if (sysopt.gdbpath) free((genericptr_t) sysopt.gdbpath), sysopt.gdbpath = (char *) 0; if (sysopt.greppath) free((genericptr_t) sysopt.greppath), sysopt.greppath = (char *) 0; -#endif + /* this one's last because it might be used in panic feedback, although none of the preceding ones are likely to trigger a controlled panic */ if (sysopt.fmtd_wizard_list) From 7a3ce901abcbc4759be652d55a4e795330a88ed6 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 6 Dec 2019 16:35:47 -0500 Subject: [PATCH 2/2] make this branch recognizable for post-3.6.3 patch commits and patch tests --- include/global.h | 9 +++++---- util/makedefs.c | 14 +++++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/include/global.h b/include/global.h index c3d2b4f22..5c02491c3 100644 --- a/include/global.h +++ b/include/global.h @@ -11,14 +11,15 @@ /* * Development status possibilities. */ -#define NH_STATUS_RELEASED 0 /* Released */ -#define NH_STATUS_WIP 1 /* Work in progress */ -#define NH_STATUS_BETA 2 /* BETA testing */ +#define NH_STATUS_RELEASED 0 /* Released */ +#define NH_STATUS_WIP 1 /* Work in progress */ +#define NH_STATUS_BETA 2 /* BETA testing */ +#define NH_STATUS_POSTRELEASE 3 /* patch commit point only */ /* * Development status of this NetHack version. */ -#define NH_DEVEL_STATUS NH_STATUS_RELEASED +#define NH_DEVEL_STATUS NH_STATUS_POSTRELEASE #ifndef DEBUG /* allow tool chains to define without causing warnings */ #define DEBUG diff --git a/util/makedefs.c b/util/makedefs.c index 4334b9b0e..6b0ef9cc6 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -1201,16 +1201,20 @@ char *outbuf; const char *build_date; { char subbuf[64], versbuf[64]; - char betabuf[64]; + char statusbuf[64]; #if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) #if (NH_DEVEL_STATUS == NH_STATUS_BETA) - Strcpy(betabuf, " Beta"); + Strcpy(statusbuf, " Beta"); #else - Strcpy(betabuf, " Work-in-progress"); +#if (NH_DEVEL_STATUS == NH_STATUS_WIP) + Strcpy(statusbuf, " Work-in-progress"); +#else + Strcpy(statusbuf, " post-release"); +#endif #endif #else - betabuf[0] = '\0'; + statusbuf[0] = '\0'; #endif subbuf[0] = '\0'; @@ -1220,7 +1224,7 @@ const char *build_date; #endif Sprintf(outbuf, "%s NetHack%s Version %s%s - last %s %s.", PORT_ID, - subbuf, version_string(versbuf, "."), betabuf, + subbuf, version_string(versbuf, "."), statusbuf, date_via_env ? "revision" : "build", build_date); return outbuf; }