From: Eric Bollengier Date: Thu, 15 Jan 2009 13:01:18 +0000 (+0000) Subject: ebl Too many external segfault in this way X-Git-Tag: Release-7.0.0~3459 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f8131fce74a9c8dad35d0476b2a80f65f8b534ee;p=bacula%2Fbacula ebl Too many external segfault in this way git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8370 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/patches/testing/build-w64.patch b/bacula/patches/testing/build-w64.patch deleted file mode 100644 index be694733f0..0000000000 --- a/bacula/patches/testing/build-w64.patch +++ /dev/null @@ -1,542 +0,0 @@ -Index: src/win32/filed/vss.cpp -=================================================================== ---- src/win32/filed/vss.cpp (revision 8361) -+++ src/win32/filed/vss.cpp (working copy) -@@ -215,7 +215,7 @@ - const int VSSClient::GetWriterState(int nIndex) - { - alist* pV = (alist*)m_pAlistWriterState; -- return (int)pV->get(nIndex); -+ return (int)(intptr_t)pV->get(nIndex); - } - - void VSSClient::AppendWriterInfo(int nState, const char* pszInfo) -Index: src/win32/filed/Makefile -=================================================================== ---- src/win32/filed/Makefile (revision 8361) -+++ src/win32/filed/Makefile (working copy) -@@ -62,7 +62,7 @@ - $(LIBS_ZLIB) \ - -lole32 \ - -loleaut32 \ -- -lwsock32 \ -+ -lws2_32 \ - -luuid \ - -lcomctl32 - -Index: src/win32/build-depkgs-mingw-w64 -=================================================================== ---- src/win32/build-depkgs-mingw-w64 (revision 8361) -+++ src/win32/build-depkgs-mingw-w64 (working copy) -@@ -246,7 +246,14 @@ - perl util/mkdef.pl 32 libeay no-static-engine >ms/libeay32.def - perl util/mkdef.pl 32 ssleay >ms/ssleay32.def - perl util/mkdef.pl crypto ssl NT update -- CFLAG=-I${DEPPKG_DIR}/include do_make Makefile all -+ CFLAGS=-I${DEPPKG_DIR}/include do_make Makefile all -+ cd engines -+ touch lib4758cca.bad libaep.bad libatalla.bad libcswift.bad libchil.bad libgmp.bad libnuron.bad libsureware.bad libubsec.bad libcapi.bad -+ cd .. -+ sed -i 's/ cc/ mingw32-gcc/' crypto/comp/Makefile -+ sed -i 's/ ar/ mingw32-ar/' crypto/comp/Makefile -+ sed -i 's:^CFLAGS=:CFLAGS= -I${DEPPKG_DIR}/include:' crypto/comp/Makefile -+ CFLAGS=-I${DEPPKG_DIR}/include do_make Makefile all - echo Installing openssl - do_make Makefile install_sw - } -Index: src/win32/Makefile -=================================================================== ---- src/win32/Makefile (revision 8361) -+++ src/win32/Makefile (working copy) -@@ -1,4 +1,4 @@ --ECHO_CMD=@ -+ECHO_CMD= - - DIRS= dll \ - cats \ -Index: src/win32/compat/winhost.h -=================================================================== ---- src/win32/compat/winhost.h (revision 8361) -+++ src/win32/compat/winhost.h (working copy) -@@ -41,7 +41,11 @@ - - #define HOST_OS "Linux" - #define DISTNAME "Cross-compile" -+#ifdef MINGW64 -+#define DISTVER "Win64" -+#else - #define DISTVER "Win32" -+#endif - - #else - -Index: src/win32/compat/compat.cpp -=================================================================== ---- src/win32/compat/compat.cpp (revision 8361) -+++ src/win32/compat/compat.cpp (working copy) -@@ -733,7 +733,7 @@ - } - - int --fstat(int fd, struct stat *sb) -+fstat(intptr_t fd, struct stat *sb) - { - BY_HANDLE_FILE_INFORMATION info; - -@@ -827,7 +827,7 @@ - return -1; - } - -- rval = fstat((int)h, sb); -+ rval = fstat((intptr_t)h, sb); - CloseHandle(h); - - if (attr & FILE_ATTRIBUTE_DIRECTORY && -@@ -2201,7 +2201,7 @@ - // process terminates we can - // detect eof. - // ugly but convert WIN32 HANDLE to FILE* -- int rfd = _open_osfhandle((long)hChildStdoutRdDup, O_RDONLY | O_BINARY); -+ int rfd = _open_osfhandle((intptr_t)hChildStdoutRdDup, O_RDONLY | O_BINARY); - if (rfd >= 0) { - bpipe->rfd = _fdopen(rfd, "rb"); - } -@@ -2210,7 +2210,7 @@ - CloseHandle(hChildStdinRd); // close our read side so as not - // to interfre with child's copy - // ugly but convert WIN32 HANDLE to FILE* -- int wfd = _open_osfhandle((long)hChildStdinWrDup, O_WRONLY | O_BINARY); -+ int wfd = _open_osfhandle((intptr_t)hChildStdinWrDup, O_WRONLY | O_BINARY); - if (wfd >= 0) { - bpipe->wfd = _fdopen(wfd, "wb"); - } -@@ -2316,6 +2316,7 @@ - return result; - } - -+#ifndef MINGW64 - int - utime(const char *fname, struct utimbuf *times) - { -@@ -2367,6 +2368,7 @@ - } - return rval; - } -+#endif - - #if 0 - int -Index: src/win32/compat/compat.h -=================================================================== ---- src/win32/compat/compat.h (revision 8361) -+++ src/win32/compat/compat.h (working copy) -@@ -57,6 +57,15 @@ - - #include - -+#ifdef MINGW64 -+#include -+#define _declspec __declspec -+#endif -+ -+#ifdef _WIN64 -+# define GWL_USERDATA GWLP_USERDATA -+#endif -+ - typedef UINT64 u_int64_t; - typedef UINT64 uint64_t; - typedef INT64 int64_t; -@@ -74,8 +83,11 @@ - #endif - - #if !defined(_MSC_VER) || (_MSC_VER < 1400) // VC8+ --typedef long time_t; -+#ifndef _TIME_T_DEFINED -+#define _TIME_T_DEFINED -+ typedef long time_t; - #endif -+#endif - - #if __STDC__ && !defined(HAVE_MINGW) - typedef _dev_t dev_t; -@@ -129,10 +141,15 @@ - #endif - #endif - -+#ifndef _TIMEZONE_DEFINED /* also in sys/time.h */ -+#define _TIMEZONE_DEFINED -+ - struct timezone { - int foo; - }; - -+#endif -+ - int strcasecmp(const char*, const char *); - int gettimeofday(struct timeval *, struct timezone *); - -@@ -244,10 +261,12 @@ - ssize_t win32_write(int fd, const void *buffer, size_t count); - int win32_ioctl(int fd, unsigned long int req, ...); - --#define open _open -+#if !defined(MINGW64) -+# define open _open -+#endif - - int fcntl(int fd, int cmd, long arg); --int fstat(int fd, struct stat *sb); -+int fstat(intptr_t fd, struct stat *sb); - - int inet_aton(const char *cp, struct in_addr *inp); - int kill(int pid, int signo); -@@ -263,7 +282,6 @@ - #define snprintf _snprintf - #endif //HAVE_MINGW - -- - #define WNOHANG 0 - #define WIFEXITED(x) 0 - #define WEXITSTATUS(x) x -Index: src/win32/compat/print.cpp -=================================================================== ---- src/win32/compat/print.cpp (revision 8361) -+++ src/win32/compat/print.cpp (working copy) -@@ -340,7 +340,7 @@ - case 'p': - strvalue = (char *) va_arg(args, void *); - flags |= DP_F_UNSIGNED; -- fmtint(buffer, &currlen, maxlen, (long) strvalue, 16, min, max, -+ fmtint(buffer, &currlen, maxlen, (INT64) strvalue, 16, min, max, - flags, outch); - break; - case 'n': -Index: src/win32/libwin32/statusDialog.cpp -=================================================================== ---- src/win32/libwin32/statusDialog.cpp (revision 8361) -+++ src/win32/libwin32/statusDialog.cpp (working copy) -@@ -110,7 +110,7 @@ - - if (*p == '\n') { - SendMessage(statDlg->m_textWin, EM_SETSEL, (WPARAM)-1, (LPARAM)-1); -- SendMessage(statDlg->m_textWin, EM_REPLACESEL, 0, (LONG)"\r\n"); -+ SendMessage(statDlg->m_textWin, EM_REPLACESEL, 0, (LPARAM)"\r\n"); - } - - if (*p == '\0'){ -@@ -149,7 +149,7 @@ - { - if (show && !m_visible) { - DialogBoxParam(appInstance, MAKEINTRESOURCE(IDD_STATUS), NULL, -- (DLGPROC)dialogProc, (LONG)this); -+ (DLGPROC)dialogProc, (LPARAM)this); - } - } - -Index: src/win32/libwin32/bacula.rc -=================================================================== ---- src/win32/libwin32/bacula.rc (revision 8361) -+++ src/win32/libwin32/bacula.rc (working copy) -@@ -104,15 +104,14 @@ - * About Dialog - */ - IDD_ABOUT DIALOG 0, 0, 250, 145 --STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU - CAPTION "About Bacula" - FONT 8, "MS Sans Serif" - BEGIN -- DEFPUSHBUTTON "OK",IDOK,190,120,50,15 -+// DEFPUSHBUTTON "OK",IDOK,190,120,50,15 - // CONTROL "\3", IDC_BACULABMP,"Static",SS_ICON | SS_CENTERIMAGE | - // SS_SUNKEN,7,5,73,65 - #ifndef HAVE_MINGW -- CONTROL IDB_BACULABMP,IDB_BACULABMP,"Static",SS_BITMAP|SS_SUNKEN,7,5,32,32 -+// CONTROL IDB_BACULABMP,IDB_BACULABMP,"Static",SS_BITMAP|SS_SUNKEN,7,5,32,32 - #endif - - LTEXT " by Kern Sibbald",-1,134,38,78,10 -@@ -132,10 +131,10 @@ - * Status Dialog - */ - IDD_STATUS DIALOGEX 0, 0, 411, 244 --STYLE DS_SETFONT | DS_3DLOOK | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -+//STYLE DS_SETFONT | DS_3DLOOK | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME - CAPTION "Bacula Status" - FONT 8, "Courier New" - BEGIN -- DEFPUSHBUTTON "&OK",IDOK,355,5,51,15 -- EDITTEXT IDC_TEXTDISPLAY, 2, 2, 350, 240, WS_VSCROLL | WS_HSCROLL | WS_BORDER | ES_READONLY | ES_MULTILINE -+// DEFPUSHBUTTON "&OK",IDOK,355,5,51,15 -+// EDITTEXT IDC_TEXTDISPLAY, 2, 2, 350, 240, WS_VSCROLL | WS_HSCROLL | WS_BORDER | ES_READONLY | ES_MULTILINE - END -Index: src/win32/libwin32/main.cpp -=================================================================== ---- src/win32/libwin32/main.cpp (revision 8361) -+++ src/win32/libwin32/main.cpp (working copy) -@@ -53,7 +53,7 @@ - #include - - #undef _WIN32_IE --#define _WIN32_IE 0x0401 -+#define _WIN32_IE 0x0501 - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0501 - #include -Index: src/win32/libwin32/trayMonitor.cpp -=================================================================== ---- src/win32/libwin32/trayMonitor.cpp (revision 8361) -+++ src/win32/libwin32/trayMonitor.cpp (working copy) -@@ -73,7 +73,7 @@ - } - - /* Save our class pointer */ -- SetWindowLong(m_hwnd, GWL_USERDATA, (LONG)this); -+ SetWindowLong(m_hwnd, GWL_USERDATA, (LPARAM)this); - - - // Load the icons for the tray -Index: src/win32/libwin32/aboutDialog.cpp -=================================================================== ---- src/win32/libwin32/aboutDialog.cpp (revision 8361) -+++ src/win32/libwin32/aboutDialog.cpp (working copy) -@@ -76,6 +76,6 @@ - { - if (show && !m_visible) { - DialogBoxParam(appInstance, MAKEINTRESOURCE(IDD_ABOUT), NULL, -- (DLGPROC)DialogProc, (LONG)this); -+ (DLGPROC)DialogProc, (LPARAM)this); - } - } -Index: src/win32/Makefile.inc.in -=================================================================== ---- src/win32/Makefile.inc.in (revision 8361) -+++ src/win32/Makefile.inc.in (working copy) -@@ -9,7 +9,7 @@ - - # Global Configuration - --ECHO_CMD = @ -+ECHO_CMD = - - # Main Bacula source dir - MAINDIR := @WIN32MAINDIR@ -@@ -37,12 +37,12 @@ - AR := $(MINGW_BIN)/mingw32-ar - RANLIB := $(MINGW_BIN)/mingw32-ranlib - WINDRES := $(MINGW_BIN)/mingw32-windres --DLLTOOL := $(MINGW_BIN)/../mingw32/bin/dlltool -+DLLTOOL := $(MINGW_BIN)/mingw32-dlltool - OBJCPY := $(MINGW_BIN)/mingw32-objcopy - NSIS_DIR := $(DEPKGS)/nsis - STAB2CV := $(DEPKGS)/tools/bin/stab2cv - --CFLAGS := -g -Wall -mno-cygwin -m32 -mwin32 -mthreads -O3 -fno-strict-aliasing -+CFLAGS := -g -Wall -mno-cygwin -mthreads -O3 -fno-strict-aliasing -DHAVE_VSS64 - LDFLAGS := -g -Wall -mno-cygwin -Wl,--disable-auto-import - - INCLUDE_DDK := -I$(MINGW_INCLUDE)/ddk -Index: src/win32/dll/bacula.def -=================================================================== ---- src/win32/dll/bacula.def (revision 8361) -+++ src/win32/dll/bacula.def (working copy) -@@ -23,8 +23,8 @@ - _Z17SetVSSPathConvertPFiPKcPciEPFiPKwPwiE - _Z18CreateChildProcessPKcPvS1_S1_ - _Z18GetApplicationNamePKcPPcPS0_ -+_Z18cvt_utime_to_ftimeRKxR9_FILETIME - _Z18cvt_ftime_to_utimeRK9_FILETIME --_Z18cvt_utime_to_ftimeRKlR9_FILETIME - _Z18unix_name_to_win32PPcS_ - _Z21Win32ConvCleanupCachev - _Z21make_wchar_win32_pathPcPi -@@ -37,7 +37,7 @@ - _Z5chownPKcjj - _Z5fcntlii - _Z5fcntliil --_Z5fstatiP4stat -+_Z5fstatxP4stat - _Z5lstatPKcP4stat - _Z5sleepi - _Z6execvpPKcPPc -@@ -73,11 +73,11 @@ - _Z19dbg_plugin_add_hookPFvP6PluginP6_iobufE - - ; print.o --_Z10__snprintfPcjPKcz - _Z10__vsprintfPcPKcS_ --_Z11__vsnprintfPcjPKcS_ --_Z4doprPcjPKcS_PFvS_PjjiE -+_Z11__vsnprintfPcyPKcS_ -+_Z10__snprintfPcyPKcz - _Z9__sprintfPcPKcz -+_Z4doprPcyPKcS_PFvS_PyyiE - - ; winapi.o - _Z17InitWinAPIWrapperv -@@ -89,12 +89,6 @@ - _Z14set_attributesP3JCRP4ATTRP5BFILE - _Z16encode_attribsExP3JCRPcP6FF_PKT - _Z18select_data_streamP6FF_PKT --_Z4plugIjEvRT_y --_Z4plugIlEvRT_y --_Z4plugImEvRT_y --_Z4plugIsEvRT_y --_Z4plugItEvRT_y --_Z4plugIyEvRT_y - _Z9win_errorP3JCRPcS1_ - _Z9win_errorP3JCRPcm - -@@ -109,15 +103,15 @@ - _Z18is_portable_backupP5BFILE - _Z19set_portable_backupP5BFILE - _Z14set_cmd_pluginP5BFILEP3JCR --_Z26processWin32BackupAPIBlockP5BFILEPvl -+_Z26processWin32BackupAPIBlockP5BFILEPvx - _Z27is_restore_stream_supportedi - _Z5binitP5BFILE - _Z5bopenP5BFILEPKcit --_Z5breadP5BFILEPvj -+_Z5breadP5BFILEPvy - _Z6bcloseP5BFILE - _Z6blseekP5BFILExi --_Z6bwriteP5BFILEPvj - _Z8is_bopenP5BFILE -+_Z6bwriteP5BFILEPvy - - ; create_file.o - _Z11create_fileP3JCRP4ATTRP5BFILEi -@@ -133,7 +127,7 @@ - _Z13is_in_filesetP6FF_PKT - _Z15init_find_filesv - _Z15term_find_filesP6FF_PKT --_Z16set_find_optionsP6FF_PKTil -+_Z16set_find_optionsP6FF_PKTix - _Z22get_win32_drivelettersP6FF_PKTPc - _Z25set_find_changed_functionP6FF_PKTPFbP3JCRS0_E - -@@ -269,7 +263,7 @@ - _ZN7BREGEXP7replaceEPKc - - ; bregex.o --_Z24re_registers_to_regmatchP12re_registersP12b_regmatch_tj -+_Z24re_registers_to_regmatchP12re_registersP12b_regmatch_ty - b_re_compile_fastmap - b_re_compile_initialize - b_re_compile_pattern -@@ -298,12 +292,12 @@ - _ZN5BSOCK4initEv - _ZN5BSOCK4recvEv - _ZN5BSOCK4sendEv --_ZN5BSOCK5_openEP3JCRPKcPcS4_ixPi -+_ZN5BSOCK4openEP3JCRPKcPcS4_ixPi -+_ZN5BSOCK7despoolEPFvxEx - _ZN5BSOCK5closeEv - _ZN5BSOCK5fsendEPKcz - _ZN5BSOCK6signalEi - _ZN5BSOCK7connectEP3JCRixxPKcPcS4_ii --_ZN5BSOCK7despoolEPFvlEl - _ZN5BSOCK7destroyEv - _ZN5BSOCK8fin_initEP3JCRiPKcS3_iP8sockaddr - _ZN5BSOCK8get_peerEPci -@@ -311,7 +305,7 @@ - _ZN5BSOCK9wait_dataEii - - ; bsys.o --_Z10b_strerroriPcj -+_Z10b_strerroriPcy - _Z11bmicrosleepii - _Z15create_pid_filePcPKci - _Z15delete_pid_filePcPKci -@@ -322,11 +316,11 @@ - _Z4dropPcS_ - _Z5bfreePv - _Z6bfgetsPciP6_iobuf --_Z7bcallocjj -+_Z7bcallocyy - _Z7bstrcmpPKcS0_ - _Z7cstrlenPKc --_Z8b_mallocPKcij --_Z8breallocPvj -+_Z8b_mallocPKciy -+_Z8breallocPvy - _Z8bstrncatPcPKci - _Z8bstrncatPcR8POOL_MEMi - _Z8bstrncpyPcPKci -@@ -349,7 +343,6 @@ - _Z17date_time_compareP9date_timeS0_ - _Z17get_current_btimev - _Z6tm_womii --_Z6tm_woyl - _Z9bstrftimePcix - _Z9bstrutimePcix - _Z9tm_decodeP9date_timeP2tm -@@ -359,7 +352,7 @@ - _Z16stop_bsock_timerP8btimer_t - _Z16stop_child_timerP8btimer_t - _Z17start_bsock_timerP5BSOCKj --_Z17start_child_timerP3JCRij -+_Z17start_child_timerP3JCRxj - _Z17stop_thread_timerP8btimer_t - _Z18start_thread_timerP3JCRP10pthread_t_j - -Index: src/win32/dll/Makefile -=================================================================== ---- src/win32/dll/Makefile (revision 8361) -+++ src/win32/dll/Makefile (working copy) -@@ -109,7 +109,7 @@ - $(LIBS_CRYPTO) \ - $(LIBS_PTHREADS) \ - $(LIBS_ZLIB) \ -- -lwsock32 \ -+ -lws2_32 \ - -lole32 \ - -loleaut32 \ - -luuid -Index: src/lib/message.c -=================================================================== ---- src/lib/message.c (revision 8361) -+++ src/lib/message.c (working copy) -@@ -370,10 +370,10 @@ - { - if (jcr) { - Mmsg(name, "%s/%s.%s.%d.mail", working_directory, my_name, -- jcr->Job, (int)(long)d); -+ jcr->Job, (int)(intptr_t)d); - } else { - Mmsg(name, "%s/%s.%s.%d.mail", working_directory, my_name, -- my_name, (int)(long)d); -+ my_name, (int)(intptr_t)d); - } - Dmsg1(850, "mailname=%s\n", name); - } -Index: src/lib/smartall.c -=================================================================== ---- src/lib/smartall.c (revision 8361) -+++ src/lib/smartall.c (working copy) -@@ -134,7 +134,7 @@ - head->ablineno = (sm_ushort)lineno; - head->abin_use = true; - /* Emplace end-clobber detector at end of buffer */ -- buf[nbytes - 1] = (uint8_t)((((long) buf) & 0xFF) ^ 0xC5); -+ buf[nbytes - 1] = (uint8_t)((((intptr_t) buf) & 0xFF) ^ 0xC5); - buf += HEAD_SIZE; /* Increment to user data start */ - if (++sm_buffers > sm_max_buffers) { - sm_max_buffers = sm_buffers; -@@ -212,7 +212,7 @@ - allocated space in the buffer by comparing the end of buffer - checksum with the address of the buffer. */ - -- if (((unsigned char *)cp)[head->ablen - 1] != ((((long) cp) & 0xFF) ^ 0xC5)) { -+ if (((unsigned char *)cp)[head->ablen - 1] != ((((intptr_t) cp) & 0xFF) ^ 0xC5)) { - V(mutex); - Emsg2(M_ABORT, 0, _("Buffer overrun called from %s:%d\n"), file, line); - } -@@ -463,7 +463,7 @@ - bad |= 0x2; - } - if (((unsigned char *) ap)[((struct abufhead *)ap)->ablen - 1] != -- ((((long) ap) & 0xFF) ^ 0xC5)) { -+ ((((intptr_t) ap) & 0xFF) ^ 0xC5)) { - bad |= 0x4; - } - } else {