Changeset 99458 in vbox
- Timestamp:
- Apr 19, 2023 12:54:19 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156929
- Location:
- trunk
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r99445 r99458 3755 3755 endif 3756 3756 ifdef VBOX_WITH_DEBUG_VCC_CRT 3757 VBOX_VCC_CRT_TYPE = d 3758 VBOX_VCC_CRT_TYPE_N = 3757 VBOX_VCC_CRT_TYPE := d 3758 VBOX_VCC_CRT_TYPE_UPPER := D 3759 VBOX_VCC_CRT_TYPE_N := 3759 3760 else 3760 VBOX_VCC_CRT_TYPE = 3761 VBOX_VCC_CRT_TYPE_N = d 3761 VBOX_VCC_CRT_TYPE := 3762 VBOX_VCC_CRT_TYPE_UPPER := 3763 VBOX_VCC_CRT_TYPE_N := d 3762 3764 endif 3763 3765 … … 6107 6109 TEMPLATE_VBoxR3Exe_RCDEFS = VBOX_SVN_REV=$(VBOX_SVN_REV) VBOX_SVN_REV_MOD_5K=$(expr $(VBOX_SVN_REV) % 50000) 6108 6110 if "$(VBOX_VCC_TOOL_STEM)" >= "VCC140" 6109 TEMPLATE_VBoxR3Exe_SDKS = ReorderCompilerIncs WINSDK10-UCRT $(VBOX_WINPSDK)6111 TEMPLATE_VBoxR3Exe_SDKS = ReorderCompilerIncs WINSDK10-UCRT$(VBOX_VCC_CRT_TYPE_UPPER) $(VBOX_WINPSDK) 6110 6112 else 6111 6113 TEMPLATE_VBoxR3Exe_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) … … 6437 6439 if "$(VBOX_VCC_TOOL_STEM)" >= "VCC140" 6438 6440 ifdef VBOX_WITH_NOCRT_STATIC 6439 TEMPLATE_VBoxR3StaticBase_SDKS = $(subst WINSDK10-UCRT ,,$(TEMPLATE_VBoxR3Exe_SDKS))6441 TEMPLATE_VBoxR3StaticBase_SDKS = $(subst WINSDK10-UCRT$(VBOX_VCC_CRT_TYPE_UPPER),,$(TEMPLATE_VBoxR3Exe_SDKS)) 6440 6442 else 6441 TEMPLATE_VBoxR3StaticBase_SDKS = $(subst WINSDK10-UCRT , WINSDK10-UCRT-STATIC,$(TEMPLATE_VBoxR3Exe_SDKS))6443 TEMPLATE_VBoxR3StaticBase_SDKS = $(subst WINSDK10-UCRT$(VBOX_VCC_CRT_TYPE_UPPER), WINSDK10-UCRT$(VBOX_VCC_CRT_TYPE_UPPER)-STATIC,$(TEMPLATE_VBoxR3Exe_SDKS)) 6442 6444 endif 6443 6445 endif … … 6669 6671 TEMPLATE_VBoxR3StaticNoCrt = Static 6670 6672 TEMPLATE_VBoxR3StaticNoCrt_EXTENDS = VBoxR3Static 6671 TEMPLATE_VBoxR3StaticNoCrt_SDKS = $(subst WINSDK10-UCRT -STATIC,WINSDK10-UCRT-INCS, $(TEMPLATE_VBoxR3Static_SDKS))6673 TEMPLATE_VBoxR3StaticNoCrt_SDKS = $(subst WINSDK10-UCRT$(VBOX_VCC_CRT_TYPE_UPPER)-STATIC,WINSDK10-UCRT-INCS, $(TEMPLATE_VBoxR3Static_SDKS)) 6672 6674 TEMPLATE_VBoxR3StaticNoCrt_SDKS.$(KBUILD_TARGET_ARCH) = $(filter-out VBoxOpenSslStatic,$(TEMPLATE_VBoxR3Static_SDKS.$(KBUILD_TARGET_ARCH))) 6673 6675 TEMPLATE_VBoxR3StaticNoCrt_DEFS = $(TEMPLATE_VBoxR3Static_DEFS) \ … … 7053 7055 TEMPLATE_VBoxMainExe_TOOL.win.amd64 = $(VBOX_VCC_TOOL_STEM)AMD64 7054 7056 if "$(VBOX_VCC_TOOL_STEM)" >= "VCC140" 7055 TEMPLATE_VBoxMainExe_SDKS = ReorderCompilerIncs WINSDK10-UCRT $(VBOX_WINPSDK) $(VBOX_WINDDK)7057 TEMPLATE_VBoxMainExe_SDKS = ReorderCompilerIncs WINSDK10-UCRT$(VBOX_VCC_CRT_TYPE_UPPER) $(VBOX_WINPSDK) $(VBOX_WINDDK) 7056 7058 else 7057 7059 TEMPLATE_VBoxMainExe_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) … … 7632 7634 endif 7633 7635 7636 if "$(VBOX_QT_DBG)" != "" && "$(VBOX_QT_DBG)" != "$(VBOX_VCC_CRT_TYPE)" && "$(KBUILD_TARGET)" == "win" 7637 $(warning WARNING! VBOX_QT_DBG (=$(VBOX_QT_DBG)) and VBOX_VCC_CRT_TYPE (=$(VBOX_VCC_CRT_TYPE)) does not match!) 7638 $(warning WARNING! This may cause heap troubles in the GUI in places where something is) 7639 $(warning WARNING! allocated in the Qt DLLs freed in our code (or vice versa) because they) 7640 $(warning WARNING! will be using different allocators. See r156914 for more details.) 7641 $(warning WARNING! VBOX_WITH_DEBUG_VCC_CRT=1 in enabled debug CRT.) 7642 endif 7643 7634 7644 ifeq ($(KBUILD_TARGET),darwin) 7635 7645 VBOX_QT_MOD := QtCore QtGui QtWidgets QtPrintSupport … … 7713 7723 7714 7724 ifeq ($(KBUILD_TARGET),win) 7715 # Note! No use of VBOX_VCC_CRT_TYPE here yet as it requires a /MDd build of Qt as well.7725 # Note! Only use VBOX_VCC_CRT_TYPE when it matches VBOX_QT_DBG. 7716 7726 TEMPLATE_VBoxQtGuiExe_TOOL = $(VBOX_VCC_TOOL) 7717 7727 if "$(VBOX_VCC_TOOL_STEM)" >= "VCC140" 7718 TEMPLATE_VBoxQtGuiExe_SDKS = WINSDK10-UCRT 7728 TEMPLATE_VBoxQtGuiExe_SDKS = WINSDK10-UCRT$(VBOX_VCC_CRT_TYPE_UPPER) 7719 7729 endif 7720 7730 TEMPLATE_VBoxQtGuiExe_DEFS += \ … … 7722 7732 QT_DLL _CRT_SECURE_NO_DEPRECATE \ 7723 7733 $(QMAKE_PRL_DEFINES) 7724 TEMPLATE_VBoxQtGuiExe_CXXFLAGS = -nologo -Zm200 -MD -Zi -EHsc -Zc:wchar_t- $(VBOX_VCC_CC_GUARD_CF) $(VBOX_VCC_SANITIZER_FLAGS) $(VBOX_VCC_std) 7734 TEMPLATE_VBoxQtGuiExe_CXXFLAGS = -nologo -Zm200 -MD$(if-expr "$(VBOX_QT_DBG)" == "$(VBOX_VCC_CRT_TYPE)",$(VBOX_VCC_CRT_TYPE),) \ 7735 -Zi -EHsc -Zc:wchar_t- $(VBOX_VCC_CC_GUARD_CF) $(VBOX_VCC_SANITIZER_FLAGS) $(VBOX_VCC_std) 7725 7736 # -wd4481: nonstandard extension used: override specifier 'override' 7726 7737 # -wd4625: 'QRubberBand' : copy constructor could not be generated because a base class copy constructor is inaccessible … … 7787 7798 $(VBOX_LIBS_QT) \ 7788 7799 $(LIB_RUNTIME) \ 7789 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/vcruntime .lib \7790 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt .lib \7791 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt .lib \7800 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/vcruntime$(if-expr "$(VBOX_QT_DBG)" == "$(VBOX_VCC_CRT_TYPE)",$(VBOX_VCC_CRT_TYPE),).lib \ 7801 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt$(if-expr "$(VBOX_QT_DBG)" == "$(VBOX_VCC_CRT_TYPE)",$(VBOX_VCC_CRT_TYPE),).lib \ 7802 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt$(if-expr "$(VBOX_QT_DBG)" == "$(VBOX_VCC_CRT_TYPE)",$(VBOX_VCC_CRT_TYPE),).lib \ 7792 7803 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \ 7793 7804 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib … … 7801 7812 $(VBOX_LIBS_QT) \ 7802 7813 $(LIB_RUNTIME) \ 7803 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt .lib \7804 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt .lib \7814 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt$(if-expr "$(VBOX_QT_DBG)" == "$(VBOX_VCC_CRT_TYPE)",$(VBOX_VCC_CRT_TYPE),).lib \ 7815 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt$(if-expr "$(VBOX_QT_DBG)" == "$(VBOX_VCC_CRT_TYPE)",$(VBOX_VCC_CRT_TYPE),).lib \ 7805 7816 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \ 7806 7817 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib … … 7924 7935 # Add COM/XPCOM stuff 7925 7936 TEMPLATE_VBoxQtGuiExe_LIBS += \ 7926 $(PATH_STAGE_LIB)/VBoxCOM$(if-expr defined(VBOX_WITH_DEBUG_VCC_CRT)&& $(KBUILD_TARGET) == win,-GUI,)$(VBOX_SUFF_LIB)7937 $(PATH_STAGE_LIB)/VBoxCOM$(if-expr "$(VBOX_QT_DBG)" != "$(VBOX_VCC_CRT_TYPE)" && $(KBUILD_TARGET) == win,-GUI,)$(VBOX_SUFF_LIB) 7927 7938 ifdef VBOX_WITH_XPCOM 7928 7939 ## @todo may be worth creating the VBOX_XPCOM SDK def, or just a SDK_VBOXXPCOM. … … 8068 8079 TEMPLATE_VBoxBldProg_TOOL := $(VBOX_VCC_TOOL_STEM)$(toupper $(KBUILD_HOST_ARCH)) 8069 8080 if "$(VBOX_VCC_TOOL_STEM)" >= "VCC140" 8070 TEMPLATE_VBoxBldProg_SDKS := ReorderCompilerIncs WINSDK10-UCRT -STATIC $(VBOX_WINPSDK)8081 TEMPLATE_VBoxBldProg_SDKS := ReorderCompilerIncs WINSDK10-UCRT$(VBOX_VCC_CRT_TYPE_UPPER)-STATIC $(VBOX_WINPSDK) 8071 8082 else 8072 8083 TEMPLATE_VBoxBldProg_SDKS := ReorderCompilerIncs $(VBOX_WINPSDK) … … 8332 8343 TEMPLATE_VBoxGuestR3ExeBase_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK_GST) VBoxNtDll 8333 8344 else 8334 TEMPLATE_VBoxGuestR3ExeBase_SDKS = ReorderCompilerIncs WINSDK10-UCRT -STATIC $(VBOX_WINPSDK_GST) VBoxNtDll8345 TEMPLATE_VBoxGuestR3ExeBase_SDKS = ReorderCompilerIncs WINSDK10-UCRT$(VBOX_VCC_CRT_TYPE_UPPER)-STATIC $(VBOX_WINPSDK_GST) VBoxNtDll 8335 8346 endif 8336 8347 else … … 8607 8618 TEMPLATE_VBoxGuestR3NoCrtExe := ... 8608 8619 TEMPLATE_VBoxGuestR3NoCrtExe_EXTENDS := VBoxGuestR3Exe 8609 TEMPLATE_VBoxGuestR3NoCrtExe_SDKS = $(subst WINSDK10-UCRT -STATIC,WINSDK10-UCRT-INCS, $(TEMPLATE_VBoxGuestR3Exe_SDKS))8620 TEMPLATE_VBoxGuestR3NoCrtExe_SDKS = $(subst WINSDK10-UCRT$(VBOX_VCC_CRT_TYPE_UPPER)-STATIC,WINSDK10-UCRT-INCS, $(TEMPLATE_VBoxGuestR3Exe_SDKS)) 8610 8621 TEMPLATE_VBoxGuestR3NoCrtExe_SDKS.$(KBUILD_TARGET_ARCH) = $(filter-out VBoxOpenSslStatic,$(TEMPLATE_VBoxGuestR3Exe_SDKS.$(KBUILD_TARGET_ARCH))) 8611 8622 TEMPLATE_VBoxGuestR3NoCrtExe_DEFS = $(TEMPLATE_VBoxGuestR3Exe_DEFS) \ -
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r99447 r99458 2059 2059 2060 2060 2061 if 02062 #2063 # Testcase for the delete QPointer<> var issue.2064 #2065 PROGRAMS += tstQPointer2066 tstQPointer_TEMPLATE := VBoxQtGuiExe2067 tstQPointer_QT_MODULES := Core Widgets2068 tstQPointer_SOURCES := src/tstQPointer.cpp2069 endif2070 2071 2072 2061 # 2073 2062 # Doxygen documentation. -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r99448 r99458 2369 2369 2370 2370 /* Delete message-box: */ 2371 #if 1 /* With a debug Qt 5.15.2 (r175) build and paged heap on windows, the ~QPointer destructor will trigger heap corruption2372 (VERIFIER STOP 0000000000000010: pid 0x253C: corrupted start stamp). Clearing the QPointer prior to deletion works2373 around the issue (calling clear() after delete just triggers the problem a few lines earlier).2374 2375 Update: The issue is using different allocator and free heap routines. When using a debug Qt build on windows,2376 it is linked against the debug runtime DLL (ucrtbased.dll), while this code is still using the release2377 runtime DLL (ucrtbase.dll). The QtSharedPointer::ExternalRefCountData instance is allocated by2378 Qt5CoreVBoxd!QtSharedPointer::ExternalRefCountData::getAndRef() using the debug heap allocator, which adds2379 an additional 48 byte header on the object. When we delete and the clear/destroy the QPointer instance2380 here, we'll be doing the freeing, but since we don't link with ucrtbased.dll, we'll use the regular2381 heap routines that doesn't expect a 48 byte header and they probably think we're handing them a garbage2382 pointer.2383 2384 The workaround here, moves the deleting of the QtSharedPointer::ExternalRefCountData structure from2385 this module to the QObject destructor, which lives in the same module as where it was allocated and2386 will be using the same allocator. So, either we subclass the QPointer<> template and formalize this2387 pattern a bit better, so a workaround can be done in one place, or we do some build time / makefile2388 checks for this and forces the use of the debug CRT for the whole of VBox as well (not all that tempting)... */2389 QIMessageBox *pSafe = pMessageBox;2390 pMessageBox.clear();2391 if (pSafe)2392 delete pSafe;2393 #else2394 2371 delete pMessageBox; 2395 #endif2396 2372 2397 2373 /* Return result-code: */
Note:
See TracChangeset
for help on using the changeset viewer.