
#8608: internal error: ARR_WORDS object entered! ----------------------------------+--------------------------- Reporter: Rothiph | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: invalid | Keywords: Operating System: Windows | Architecture: x86 Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ----------------------------------+--------------------------- Comment (by Rothiph): I think I understand what was going on, and will explain in case anyone else has trouble calling into .dll files. Note that some of this may be inaccurate. The Win32 DLL I'm trying to load is dhcpsapi.dll. I can access functions using run-time dynamic loading (by calling LoadLibrary), but if I attempt to call them using load-time dynamic loading an access violation is triggered. GHC on windows relies on mingw. When you specify a dll to load using the "extra-libraries" option in the cabal file, the standard Windows search mechanism is not used. Each common system dll has a corresponding .a file under "C:\Program Files (x86)\Haskell Platform\2013.2.0.0\mingw\lib". My problem was that mingw does not include an .a file for dhcpsapi. Trying to load it natively worked in the sense that the project was able to compile and link, but something went wrong at runtime. I suspect this has something to do with the fact that dhcpsapi.dll depends on other system dlls which mingw has already linked in. My previous computer must have already had mingw-w64 installed, which does include dhcpsapi.a. Being earlier in my PATH, this variant of mingw was being used by ghc. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8608#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler