Re: Frame-based exception handling problem on Server 2008



Vista SP1 and WinSrv2008 are build from the same code, and,
the only SKU difference is the exception validation behavior that
is triggered by the NX boot and CPU options
(among other things: there are specific
appcompt shims to skip exception handlers validation for binaries
known to have issues).

That said, the safe exception handler table has nothing to do with C++.
It's a structure referenced in the debug-directory of the PE, and it is
used for exception handler validation.
Using the MS toolset, if you do
`link -dump -all <binary> | findstr /c:"Safe Exception Handler Table"`
you should see that yourself.

To debug debug the issue, start from KeUserExceptionDispatcher.
That's the first function you can set a breakpoint on in user mode.
Then, with good symbols, observer the code that walks the frame-handler
list,
and, check if some Rtl*Validate* function is called.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Corinna Vinschen" <corinna@xxxxxxxxxxxxxxxx> wrote in message
news:fpn0nk$cvt$2@xxxxxxxxxxxxxxxxxx
Hi Ivan,

Ivan Brugiolo [MSFT] wrote:
Can you elaborate on the NX options of the bcdedit configuration ?

Per the output of bcdedit, the NX option is set to OptOut.

My take is that the server SKU has NX enabled by default, that implies
strict validation of the SEH-Handler against the table generated by the
compiler,
while the client SKU has a looser validation, and your code gets by.

The compiler (GCC) does not generate SEH handlers, except if you use c++
exception handling. This is not the case here. The code is plain C.

The second problem is that our approach works as expected on 2003
Server, as well as on earlier Server versions, so it shouldn't have
anything to do with server vs. client.

Anyway, I switched the 2008 Server to OptIn as in Vista and rebooted.
I verified that the setting was still OptIn after the reboot. The
problem that 2008 Server hangs persists even wit NX=OptIn.

Then, could you use a ntsd/cdb/windbg based debugger to report the stack
?
Those debuggers have the ability to use public PDBs to give meaningful
stack
traces.

I haven't windbg installed. If it's necessary, I can do that, but I
never used it so I'd need some instructions. For the time being, I have
pasted the backtrace from ProcessExplorer in the hanging example code
from my reply to Jeffrey on a 2008 Server:

0 ntdll.dll!RtlTimeToElapsedTimeFields+0x12225
1 ntdll.dll!KiUserExceptionDispatcher+0xf
2 exceptionhandler_example.exe+0x13e9
3 exceptionhandler_example.exe+0x124b
4 exceptionhandler_example.exe+0x1298
5 kernel32.dll!BaseThreadInitThunk+0x12
6 ntdll.dll!RtlInitializeExceptionChain+0x63
7 ntdll.dll!RtlInitializeExceptionChain+0x36

Does that help?


Corinna

--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


.



Relevant Pages

  • Re: Frame-based exception handling problem on Server 2008
    ... appcompt shims to skip exception handlers validation for binaries ... the safe exception handler table has nothing to do with C++. ... of view something is broken specificially in 2008 Server. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Can I use one of the new MMs?
    ... >> found under extra validation) on of the required ones.. ... >> always pick among the ones passing it (unless the performance difference ... If we're talking server software I'm pretty sure people ... request/action generated an exception.. ...
    (borland.public.delphi.language.basm)
  • Re: Date validation
    ... > and server side ... There's no point in catching the exception if you're just going to ... TryParse avoids it without you having to write any custom validation ...
    (microsoft.public.dotnet.languages.csharp)
  • RPC_E_SERVERFAULT exception
    ... I got the following exception when I'm calling a COM method from C#. ... The exception was caught by C# exception handler. ... Exception Message: The server threw an exception. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: Backup & Monitoring not working!
    ... Error message in Windows Small Business Server 2003: ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ... An unhandled exception occurred during the execution of the ...
    (microsoft.public.windows.server.sbs)