[GHC] #8608: internal error: ARR_WORDS object entered!

#8608: internal error: ARR_WORDS object entered! ----------------------------+---------------------------------- Reporter: Rothiph | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Keywords: | Operating System: Windows Architecture: x86 | Type of failure: Runtime crash Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ----------------------------+---------------------------------- I'm using Windows 8.1 64-bit, the latest Windows SDK, and the latest Haskell Platform to rebuild a project. This project was previously building on Windows 7 64-bit with the same HP and a previous version of the Windows SDK. Source code for the project was unchanged, but my .cabal file was updated with different "extra-lib-dirs", "include-dirs", and "extra-libraries" fields. When running this program after a `cabal build` I see the following error: Segmentation fault/access violation in generated code Using print statements I was able to locate the error as occurring during a call to an external DLL function. I would assume this is a bug in my own code. Access violations are expected when misusing FFI, after all. However, I get a different error when compiling with profiling, and then executing with `Main.exe +RTS -xc`: Main.exe: internal error: ARR_WORDS object entered! (GHC version 7.6.3 for i386_unknown_mingw32) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Coming up with a minimal example would take time, but I can do that if someone thinks there is a possibility of this being a GHC bug. Is it possible for this message to appear under normal circumstances by programmer error? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8608 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8608: internal error: ARR_WORDS object entered! ----------------------------------+--------------------------- Reporter: Rothiph | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Windows | Architecture: x86 Type of failure: Runtime crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ----------------------------------+--------------------------- Comment (by Rothiph): I'm going to close this. The access violation must be caused by the way I am making the foreign call. I get the expected result when the project is loaded in ghci, but not when everything is compiled. Perhaps there is a linker problem I need to sort out. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8608#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: ----------------------------------+--------------------------- Changes (by Rothiph): * status: new => closed * resolution: => invalid -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8608#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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
participants (1)
-
GHC