Closed Bug 1055675 Opened 7 years ago Closed 7 years ago

Build fixes for trace-malloc on Windows

Categories

(Core :: XPCOM, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: gcp, Assigned: gcp)

Details

Attachments

(1 file, 1 obsolete file)

Windows debug builds with trace-malloc fail on MSVC 2010 as follows:

 4:09.29 nsTypeInfo.cpp
 4:09.29 C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\typeinfo
(157) : error C2504: 'exception' : base class undefined
 4:09.29 C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\typeinfo
(161) : error C2614: 'std::bad_cast' : illegal member initialization: 'exception
' is not a base or member
 4:09.29 C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\typeinfo
(178) : error C2504: 'exception' : base class undefined
 4:09.29 C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\typeinfo
(182) : error C2614: 'std::bad_typeid' : illegal member initialization: 'excepti
on' is not a base or member
 4:09.30

trace-malloc is needed for deadlock detection (see bug 939231) and because that bug stalled, it doesn't look like bug 1014341 is happening soon. So it's still useful to fix.

From some analysis, this appears to be a bug in the Windows headers that occurs when compiling with exceptions disabled.
This works around the MSVC2010 bug and shouldn't affect other platforms negatively.
Attachment #8475299 - Flags: review?(benjamin)
I'll bet you the problem is that we aren't using the CRT wrapper http://mxr.mozilla.org/mozilla-central/source/config/msvc-stl-wrapper.template.h for <typeinfo>

Does it work to add typeinfo to http://mxr.mozilla.org/mozilla-central/source/config/stl-headers?

Otherwise please include a brief comment about why we're including <exception> in this context.
Nope. I do think it's an actual bug in that header: if HAS_EXCEPTIONS is not defined, it won't include <exception> but then try to derive a class from exception a few lines later.
Attachment #8475299 - Attachment is obsolete: true
Attachment #8475299 - Flags: review?(benjamin)
Attachment #8475415 - Flags: review?(benjamin)
Comment on attachment 8475415 [details] [diff] [review]
Patch 1. v2 fix-windows-trace-malloc

ah ok
Attachment #8475415 - Flags: review?(benjamin) → review+
https://hg.mozilla.org/mozilla-central/rev/436085b283b4
Assignee: nobody → gpascutto
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.