Changeset 79695 in webkit for trunk/Source/JavaScriptCore


Ignore:
Timestamp:
Feb 25, 2011, 10:45:10 AM (14 years ago)
Author:
Adam Roben
Message:

Work around Cygwin's crash-suppression behavior

Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which any processes it launches will
inherit. This is bad for testing/debugging, as it causes the post-mortem debugger not to be
invoked. (Cygwin does this because it makes crashes more UNIX-y.) We reset the error mode
when our test apps launch to work around Cygwin's behavior.

Fixes <http://webkit.org/b/55222> Test apps crash silently (without invoking post-mortem
debugger) when launched from Cygwin 1.7

Reviewed by Darin Adler.

Source/JavaScriptCore:

  • API/tests/testapi.c: Added a now-needed #include.

(main):

  • jsc.cpp:

(main):
Call ::SetErrorMode(0) to undo Cygwin's folly.

  • JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Define NOMINMAX like many of our

other projects do so that windows.h won't define min/max macros that interfere with
std::numeric_limits<T>::min/max.

Tools:

  • DumpRenderTree/win/DumpRenderTree.cpp:

(main):

  • TestWebKitAPI/win/main.cpp:

(main):

  • WebKitAPITest/main.cpp:

(main):

  • WebKitTestRunner/win/TestControllerWin.cpp:

(WTR::TestController::platformInitialize):
Call ::SetErrorMode(0) to undo Cygwin's folly.

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/tests/testapi.c

    r67129 r79695  
    3333#include <wtf/UnusedParam.h>
    3434
     35#if OS(WINDOWS)
     36#include <windows.h>
     37#endif
     38
    3539#if COMPILER(MSVC)
    3640
     
    820824int main(int argc, char* argv[])
    821825{
     826#if OS(WINDOWS)
     827    // Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which we will inherit. This is bad for
     828    // testing/debugging, as it causes the post-mortem debugger not to be invoked. We reset the
     829    // error mode here to work around Cygwin's behavior. See <http://webkit.org/b/55222>.
     830    ::SetErrorMode(0);
     831#endif
     832
    822833    const char *scriptPath = "testapi.js";
    823834    if (argc > 1) {
  • trunk/Source/JavaScriptCore/ChangeLog

    r79646 r79695  
     12011-02-25  Adam Roben  <[email protected]>
     2
     3        Work around Cygwin's crash-suppression behavior
     4
     5        Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which any processes it launches will
     6        inherit. This is bad for testing/debugging, as it causes the post-mortem debugger not to be
     7        invoked. (Cygwin does this because it makes crashes more UNIX-y.) We reset the error mode
     8        when our test apps launch to work around Cygwin's behavior.
     9
     10        Fixes <http://webkit.org/b/55222> Test apps crash silently (without invoking post-mortem
     11        debugger) when launched from Cygwin 1.7
     12
     13        Reviewed by Darin Adler.
     14
     15        * API/tests/testapi.c: Added a now-needed #include.
     16        (main):
     17        * jsc.cpp:
     18        (main):
     19        Call ::SetErrorMode(0) to undo Cygwin's folly.
     20
     21        * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Define NOMINMAX like many of our
     22        other projects do so that windows.h won't define min/max macros that interfere with
     23        std::numeric_limits<T>::min/max.
     24
    1252011-02-24  Adam Barth  <[email protected]>
    226
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiCommon.vsprops

    r75138 r79695  
    88                Name="VCCLCompilerTool"
    99                AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\..\API&quot;;&quot;$(ConfigurationBuildDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(ConfigurationBuildDir)\include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\include\private\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\include&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;"
     10                PreprocessorDefinitions="NOMINMAX"
    1011                WarningLevel="4"
    1112                Detect64BitPortabilityProblems="true"
  • trunk/Source/JavaScriptCore/jsc.cpp

    r79177 r79695  
    325325int main(int argc, char** argv)
    326326{
    327 #if defined(_DEBUG) && OS(WINDOWS)
     327#if OS(WINDOWS)
     328    // Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which we will inherit. This is bad for
     329    // testing/debugging, as it causes the post-mortem debugger not to be invoked. We reset the
     330    // error mode here to work around Cygwin's behavior. See <http://webkit.org/b/55222>.
     331    ::SetErrorMode(0);
     332
     333#if defined(_DEBUG)
    328334    _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
    329335    _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
     
    332338    _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
    333339    _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
     340#endif
    334341#endif
    335342
Note: See TracChangeset for help on using the changeset viewer.