Changeset 79695 in webkit


Ignore:
Timestamp:
Feb 25, 2011 10:45:10 AM (13 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
Files:
9 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  <aroben@apple.com>
     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  <abarth@webkit.org>
    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
  • trunk/Tools/ChangeLog

    r79668 r79695  
     12011-02-25  Adam Roben  <aroben@apple.com>
     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        * DumpRenderTree/win/DumpRenderTree.cpp:
     16        (main):
     17        * TestWebKitAPI/win/main.cpp:
     18        (main):
     19        * WebKitAPITest/main.cpp:
     20        (main):
     21        * WebKitTestRunner/win/TestControllerWin.cpp:
     22        (WTR::TestController::platformInitialize):
     23        Call ::SetErrorMode(0) to undo Cygwin's folly.
     24
    1252011-02-24  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
    226
  • trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp

    r79586 r79695  
    12591259int main(int argc, char* argv[])
    12601260{
     1261    // Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which we will inherit. This is bad for
     1262    // testing/debugging, as it causes the post-mortem debugger not to be invoked. We reset the
     1263    // error mode here to work around Cygwin's behavior. See <http://webkit.org/b/55222>.
     1264    ::SetErrorMode(0);
     1265
    12611266    ::SetUnhandledExceptionFilter(exceptionFilter);
    12621267
  • trunk/Tools/TestWebKitAPI/win/main.cpp

    r69656 r79695  
    2828int main(int argc, const char* argv[])
    2929{
     30    // Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which we will inherit. This is bad for
     31    // testing/debugging, as it causes the post-mortem debugger not to be invoked. We reset the
     32    // error mode here to work around Cygwin's behavior. See <http://webkit.org/b/55222>.
     33    ::SetErrorMode(0);
     34
    3035    bool passed = true;
    3136
  • trunk/Tools/WebKitAPITest/main.cpp

    r52753 r79695  
    2929int main(int, char*[])
    3030{
     31    // Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which we will inherit. This is bad for
     32    // testing/debugging, as it causes the post-mortem debugger not to be invoked. We reset the
     33    // error mode here to work around Cygwin's behavior. See <http://webkit.org/b/55222>.
     34    ::SetErrorMode(0);
     35
    3136    // FIXME: Remove this line once <http://webkit.org/b/32867> is fixed.
    3237    OleInitialize(0);
  • trunk/Tools/WebKitTestRunner/win/TestControllerWin.cpp

    r76559 r79695  
    9797void TestController::platformInitialize()
    9898{
     99    // Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which we will inherit. This is bad for
     100    // testing/debugging, as it causes the post-mortem debugger not to be invoked. We reset the
     101    // error mode here to work around Cygwin's behavior. See <http://webkit.org/b/55222>.
     102    ::SetErrorMode(0);
     103
    99104    ::SetUnhandledExceptionFilter(exceptionFilter);
    100105
Note: See TracChangeset for help on using the changeset viewer.