From ed1e52172bfed7fbe7121cd57dfec70826a8d382 Mon Sep 17 00:00:00 2001 From: Timo Schroeder Date: Thu, 26 Aug 2021 11:33:50 +0200 Subject: [PATCH 1/3] Fix: mdsmisc GetXYSignalXd() invalid free xd on error (#2373) --- mdsmisc/ScopeUtilities.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mdsmisc/ScopeUtilities.c b/mdsmisc/ScopeUtilities.c index 74354fc9e4..f5c8cd9a93 100644 --- a/mdsmisc/ScopeUtilities.c +++ b/mdsmisc/ScopeUtilities.c @@ -886,6 +886,9 @@ EXPORT int GetXYSignalXd(mdsdsc_t *const inY, mdsdsc_t *const inX, return TdiNULL_PTR; EMPTYXD(yXd); EMPTYXD(xXd); + EMPTYXD(title); + EMPTYXD(xLabel); + EMPTYXD(yLabel); int estimatedSegmentSamples = 0; int isLong = FALSE; double xmin = -INFINITY, xmax = INFINITY; // requested @@ -936,9 +939,6 @@ EXPORT int GetXYSignalXd(mdsdsc_t *const inY, mdsdsc_t *const inX, if (STATUS_NOT_OK) goto return_err; // Get Y, title, and yLabel, if any - EMPTYXD(title); - EMPTYXD(xLabel); - EMPTYXD(yLabel); recGetHelp(yXd.pointer, &title); recGetUnits(yXd.pointer, &yLabel); // Get X From dd2e022efd4c2db9c049acb1910033e5805fab83 Mon Sep 17 00:00:00 2001 From: Josh Stillerman Date: Wed, 3 Nov 2021 14:06:41 -0400 Subject: [PATCH 2/3] Fix: need windows build fix --- configure.ac | 5 +++-- .../platform/windows/visual-studio-build.bat | 22 ------------------- .../platform/windows/windows_docker_build.sh | 5 ++++- mdsobjects/cpp/Makefile.in | 8 +++---- 4 files changed, 11 insertions(+), 29 deletions(-) diff --git a/configure.ac b/configure.ac index 0d346064f5..b676a17bf5 100644 --- a/configure.ac +++ b/configure.ac @@ -85,6 +85,7 @@ AC_PROG_RANLIB AC_PROG_MKDIR_P AC_PROG_INSTALL AC_PROG_SED +AC_CHECK_TOOL([DLLTOOL], [dlltool], [:]) AC_CHECK_TOOL([WINDRES], [windres], [:]) # Always do the visibility check but don't set AM_CFLAGS on Windows. @@ -365,12 +366,12 @@ case "$host" in SQL_ARCH=32 BINDIR=bin_x86 VS_ARCH=x86 - IDL_LIB="-L/mnt/scratch/mdsplus/idl-mingw-libs -lidl64" + IDL_LIB="-L/mnt/scratch/mdsplus/idl-mingw-libs -lidl64" else SQL_ARCH=64 BINDIR=bin_x86_64 VS_ARCH=x64 - IDL_LIB="-L/mnt/scratch/mdsplus/idl-mingw-libs -lidl32" + IDL_LIB="-L/mnt/scratch/mdsplus/idl-mingw-libs -lidl32" fi MAKELIBDIR="\$(top_builddir)/${BINDIR}/" MAKESHLIBDIR="\$(top_builddir)/${BINDIR}/" diff --git a/deploy/platform/windows/visual-studio-build.bat b/deploy/platform/windows/visual-studio-build.bat index 551b092f73..851a40c1d7 100644 --- a/deploy/platform/windows/visual-studio-build.bat +++ b/deploy/platform/windows/visual-studio-build.bat @@ -31,28 +31,6 @@ SET TEMP=\tmp echo %CCP% CD %CPP% -REM Build Visual Studio compatible lib files for the C based libraries (both 64 and 32 bit versions) - -lib /def:%DEFS%\MdsShr.def /out:%BUILD64%\bin_x86_64\MdsShr.lib /machine:x64 >NUL -lib /def:%DEFS%\TreeShr.def /out:%BUILD64%\bin_x86_64\TreeShr.lib /machine:x64 >NUL -lib /def:%DEFS%\TdiShr.def /out:%BUILD64%\bin_x86_64\TdiShr.lib /machine:x64 >NUL -lib /def:%DEFS%\MdsIpShr.def /out:%BUILD64%\bin_x86_64\MdsIpShr.lib /machine:x64 >NUL -lib /def:%DEFS%\MdsMisc.def /out:%BUILD64%\bin_x86_64\MdsMisc.lib /machine:x64 >NUL -lib /def:%DEFS%\MdsLib.def /out:%BUILD64%\bin_x86_64\MdsLib.lib /machine:x64 >NUL -lib /def:%DEFS%\Mdsdcl.def /out:%BUILD64%\bin_x86_64\Mdsdcl.lib /machine:x64 >NUL -lib /def:%DEFS%\MdsMath.def /out:%BUILD64%\bin_x86_64\MdsMath.lib /machine:x64 >NUL -lib /def:%DEFS%\MdsServerShr.def /out:%BUILD64%\bin_x86_64\MdsServerShr.lib /machine:x64 >NUL - -lib /def:%DEFS%\MdsShr.def /out:%BUILD32%\bin_x86\MdsShr.lib /machine:x86 >NUL -lib /def:%DEFS%\TreeShr.def /out:%BUILD32%\bin_x86\TreeShr.lib /machine:x86 >NUL -lib /def:%DEFS%\TdiShr.def /out:%BUILD32%\bin_x86\TdiShr.lib /machine:x86 >NUL -lib /def:%DEFS%\MdsIpShr.def /out:%BUILD32%\bin_x86\MdsIpShr.lib /machine:x86 >NUL -lib /def:%DEFS%\MdsMisc.def /out:%BUILD32%\bin_x86\MdsMisc.lib /machine:x86 >NUL -lib /def:%DEFS%\MdsLib.def /out:%BUILD32%\bin_x86\MdsLib.lib /machine:x86 >NUL -lib /def:%DEFS%\Mdsdcl.def /out:%BUILD32%\bin_x86\Mdsdcl.lib /machine:x86 >NUL -lib /def:%DEFS%\MdsMath.def /out:%BUILD32%\bin_x86\MdsMath.lib /machine:x86 >NUL -lib /def:%DEFS%\MdsServerShr.def /out:%BUILD32%\bin_x86\MdsServerShr.lib /machine:x86 >NUL - REM Use Visual studio compiler to compile the CPP modules REM _WINDOWS - required for zlib diff --git a/deploy/platform/windows/windows_docker_build.sh b/deploy/platform/windows/windows_docker_build.sh index 40b935ca1a..77a0d3e220 100755 --- a/deploy/platform/windows/windows_docker_build.sh +++ b/deploy/platform/windows/windows_docker_build.sh @@ -50,8 +50,11 @@ buildrelease() { fi popd if [ -z "$NOMAKE" ]; then + pushd /workspace/releasebld/32/mdsobjects/cpp + $MAKE generate-libs-from-dlls + popd pushd /workspace/releasebld/64/mdsobjects/cpp - $MAKE defs + $MAKE generate-libs-from-dlls HOME=/workspace/winebottle64 WINEARCH=win64\ wine cmd /C ${srcdir}/deploy/platform/windows/visual-studio-build.bat cp /workspace/releasebld/64/bin_x86_64/MdsObjectsCppShr-VS.dll ${MDSPLUS_DIR}/bin_x86_64/ diff --git a/mdsobjects/cpp/Makefile.in b/mdsobjects/cpp/Makefile.in index 21672e93f8..9af2b95903 100644 --- a/mdsobjects/cpp/Makefile.in +++ b/mdsobjects/cpp/Makefile.in @@ -46,19 +46,19 @@ install: $(libdir) $(AR) -cr $@ $(OBJECTS) @RANLIB@ $@ -defs: +generate-libs-from-dlls: @mkdir -p $(top_builddir)/defs @for i in $$(find @MAKESHLIBDIR@ -follow -name '*.dll'); do \ deffile=$(top_builddir)/defs/$$(basename $${i/.dll/.def}) ;\ gendef -a - $$i > $$deffile ;\ + @DLLTOOL@ -d $$deffile -l @MAKESHLIBDIR@/$$(basename $${i/.dll/.lib}); \ done -.PHONY: defs +.PHONY: generate-libs-from-dlls ifneq "$(VSDLL)" "" -$(VSDLL) : $(CXXSOURCES) $(SOURCES) $(IMPLIB) defs -@HAVE_WINE_TRUE@ @for i in $(top_builddir)/defs/*.def; do wine cmd.exe /C "cd @MAKESHLIBDIR@ & @VS_DIR@\\@VS_ARCH@\\bin\\lib /MACHINE:@VS_ARCH@ /DEF:Z:$${deffile////\\}"; done +$(VSDLL) : $(CXXSOURCES) $(SOURCES) $(IMPLIB) generate-libs-from-dlls @HAVE_WINE_TRUE@ wine cmd.exe /C vsbuild @VS_DIR@ @VS_ARCH@ @MAKESHLIBDIR@ @HAVE_WINE_FALSE@ @echo VSDLL defined but no wine: at this point we would have built VSDLLs From 228c165642ed8297c302dd66c2301b14b3ea3a68 Mon Sep 17 00:00:00 2001 From: Josh Stillerman Date: Wed, 3 Nov 2021 14:08:15 -0400 Subject: [PATCH 3/3] Ignore editor .swp files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 1eeec80ed7..17e56438e3 100644 --- a/.gitignore +++ b/.gitignore @@ -203,3 +203,6 @@ java/jtraverser/DecompileTree java/jtraverser/jTraverser java/jtraverser2/jTraverser2 java/jtraverser2/setupDevice + +# vscode swp files +*.swp