logo       

[GHC] #942: Windows programs throw uncaught Invalid HANDLE exception on exi: msg#00109

lang.haskell.glasgow.bugs

Subject: [GHC] #942: Windows programs throw uncaught Invalid HANDLE exception on exit

#942: Windows programs throw uncaught Invalid HANDLE exception on exit
----------------------------------+-----------------------------------------
Reporter: brianh@xxxxxxxxxxxx | Owner:

Type: bug | Status: new

Priority: normal | Milestone:

Component: Runtime System | Version: 6.6

Severity: normal | Keywords: uncaught exception HANDLE
exit
Difficulty: Unknown | Architecture: x86

Os: Windows |
----------------------------------+-----------------------------------------
If I compile the following program
{{{
module Main where

main = return ()
}}}
on Windows XP with the command line
{{{
ghc --make Main.hs
}}}
and then run the program inside Microsoft Visual Studio 2003 (by right
clicking main.exe and selecting Debug -> MS VS 2003 from the context menu)
I get the following output in the Visual Studio output pane (full path to
main.exe elided for clarity):
{{{
'main.exe': Loaded 'C:\...\main.exe', No symbols loaded.
'main.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'main.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'main.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'main.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'main.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'main.exe': Loaded 'C:\WINDOWS\system32\wsock32.dll', No symbols loaded.
'main.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll', No symbols loaded.
'main.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll', No symbols loaded.
'main.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'main.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
The thread 'Win32 Thread' (0x630) has exited with code 0 (0x0).
First-chance exception at 0x7c90eb74 in main.exe: 0xC0000008: An invalid
HANDLE was specified.
Unhandled exception at 0x7c90eb74 in main.exe: 0xC0000008: An invalid
HANDLE was specified.
The program '[1540] main.exe: Native' has exited with code 0 (0x0).
}}}
If the program is run outside Visual Studio no problems are visible (ie
the program exits silently as expected) but presumably the same behaviour
is happening internally.
My first guess is that perhaps the RTS exit code is trying to use a handle
to the thread that has already exited, but this is only a wild guess.

--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/942>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@xxxxxxxxxxx
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise