Hi,

At Mon, 23 Feb 2009 12:44:32 +0900,
Charlie Savage wrote in [ruby-core:22345]:
> >It is a compile time flag and irrelevant to debug built msvcrt.
> 
> Not sure what you mean.  VC2008 (and earlier versions) set
> the -RTC1 flag by default when creating debug builds of C/C++
> projects.  The -RTC1 flag causes the binary to use a debug
> version of the C runtime libraries.  These libraries are
> helpful in diagnosing memory problems or other incorrect
> usages of the C runtime library.

You are wrong about -RTC1.  It does emit checking code but
doesn't imply to link with msvcrtd.lib.  -MDd flag directs it.
You can compile with -RTC1 and no -MDd.

กก> Well commit calls FlushFileBuffers, so its seems that
> documentation is applicable.  And when you look at the
> documentation for _commit it says
> http://msdn.microsoft.com/en-us/library/17618685(VS.80).aspx

That page describes nothing about the assertion.

> r22337 does not fix the problem.  Try it with a debug build
> using VC2008 using the standard values set by VC2008 (/Od /D
> "WIN32" /D "_DEBUG" /Gm /EHsc /RTC1 /MDd /W3 /c /ZI /TP).  It
> will crash.

/EHsc and /TP are specific for C++.  I could compile fine with
RUNTIMEFLAG=-MDd OPTFLAGS="-Od -RTC1" DEBUGFLAGS="-D_DEBUG
-DWIN32", and no assertion dialog.  The dialog appeared by
commenting out the line _CrtSetReportMode(_CRT_ASSERT, 0) in
win32/win32.c:rb_w32_sysinit().

> Once again the fix is simple and only affects windows:

Your ``fix'' simply doesn't work with other IOs.  Try:

  open("CONOUT$", "w").flush

-- 
Nobu Nakada