Opened 11 months ago

Last modified 6 weeks ago

#9297 new bug

Packages linked against certain Windows .dll files give warnings at runtime

Reported by: RyanGlScott Owned by: simonmar
Priority: normal Milestone:
Component: Runtime System Version: 7.8.2
Keywords: Cc: simonmar, YitzGale
Operating System: Windows Architecture: x86_64 (amd64)
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #2283, #9218 Differential Revisions:

Description

I am using GHC 7.8.3 on Windows 7, x86_64. When GHC loads certain packages at runtime, it gives some interesting warnings:

> ghci -package haskeline
GHCi, version 7.8.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bytestring-0.10.4.0 ... linking ... done.
Loading package Win32-2.3.0.2 ... linking ... done.
Loading package containers-0.5.5.1 ... linking ... done.
Loading package filepath-1.3.0.2 ... linking ... done.
Loading package old-locale-1.0.0.6 ... linking ... done.
Loading package time-1.4.2 ... linking ... done.
Loading package directory-1.2.1.0 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package haskeline-0.7.1.2 ... linking ... ghc.exe: warning: SetConsoleCursorPosition from kernel32 is linked instead of __imp_SetConsoleCursorPosition
ghc.exe: warning: FillConsoleOutputCharacterA from kernel32 is linked instead of __imp_FillConsoleOutputCharacterA
ghc.exe: warning: FillConsoleOutputAttribute from kernel32 is linked instead of __imp_FillConsoleOutputAttribute
done.
Prelude>

Besides haskeline, other packages with similar problems include unix-compat, network, and regex-posix. To see them all at once, you can run the [hermit-web https://github.com/ku-fpg/hermit-web] executable:

> hermit-web Last.hs
[starting HERMIT-Web v0.1.0.0 on Last.hs]
[starting HERMIT v0.5.0.0 on Last.hs]
% ghc Last.hs -fforce-recomp -O2 -dcore-lint -fsimple-list-literals -fexpose-all-unfoldings -fplugin=HERMIT.Web -fplugin-opt=HERMIT.Web:*:
[1 of 1] Compiling Main             ( Last.hs, Last.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bytestring-0.10.4.0 ... linking ... done.
Loading package containers-0.5.5.1 ... linking ... done.
Loading package Win32-2.3.0.2 ... linking ... done.
Loading package filepath-1.3.0.2 ... linking ... done.
Loading package old-locale-1.0.0.6 ... linking ... done.
Loading package time-1.4.2 ... linking ... done.
Loading package directory-1.2.1.0 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package process-1.2.0.0 ... linking ... done.
Loading package Cabal-1.18.1.3 ... linking ... done.
Loading package binary-0.7.1.0 ... linking ... done.
Loading package bin-package-db-0.0.0.0 ... linking ... done.
Loading package hoopl-3.10.0.1 ... linking ... done.
Loading package hpc-0.6.0.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package ghc-7.8.3 ... linking ... done.
Loading package haskeline-0.7.1.2 ... linking ... ghc: warning: SetConsoleCursorPosition from kernel32 is linked instead of __imp_SetConsoleCursorPosition
ghc: warning: FillConsoleOutputCharacterA from kernel32 is linked instead of __imp_FillConsoleOutputCharacterA
ghc: warning: FillConsoleOutputAttribute from kernel32 is linked instead of __imp_FillConsoleOutputAttribute
done.
Loading package text-1.1.1.3 ... linking ... done.
Loading package hashable-1.2.2.0 ... linking ... done.
Loading package scientific-0.3.2.2 ... linking ... done.
Loading package attoparsec-0.12.1.0 ... linking ... done.
Loading package dlist-0.7.1 ... linking ... done.
Loading package mtl-2.1.3.1 ... linking ... done.
Loading package syb-0.4.2 ... linking ... done.
Loading package unordered-containers-0.2.5.0 ... linking ... done.
Loading package primitive-0.5.3.0 ... linking ... done.
Loading package vector-0.10.11.0 ... linking ... done.
Loading package aeson-0.7.0.6 ... linking ... done.
Loading package blaze-builder-0.3.3.2 ... linking ... done.
Loading package data-default-class-0.0.1 ... linking ... done.
Loading package data-default-instances-base-0.0.1 ... linking ... done.
Loading package data-default-instances-containers-0.0.1 ... linking ... done.
Loading package data-default-instances-dlist-0.0.1 ... linking ... done.
Loading package data-default-instances-old-locale-0.0.1 ... linking ... done.
Loading package data-default-0.5.3 ... linking ... done.
Loading package ansi-terminal-0.6.1.1 ... linking ... done.
Loading package kure-2.16.2 ... linking ... done.
Loading package marked-pretty-0.1 ... linking ... done.
Loading package random-1.0.1.1 ... linking ... done.
Loading package operational-0.2.3.2 ... linking ... done.
Loading package stm-2.4.3 ... linking ... done.
Loading package exceptions-0.6.1 ... linking ... done.
Loading package temporary-1.2.0.3 ... linking ... done.
Loading package hermit-0.5.0.0 ... linking ... done.
Loading package case-insensitive-1.2.0.0 ... linking ... done.
Loading package http-types-0.8.5 ... linking ... done.
Loading package transformers-base-0.4.2 ... linking ... done.
Loading package monad-control-0.3.3.0 ... linking ... done.
Loading package lifted-base-0.2.3.0 ... linking ... done.
Loading package mmorph-1.0.3 ... linking ... done.
Loading package resourcet-1.1.2.2 ... linking ... done.
Loading package nats-0.2 ... linking ... done.
Loading package semigroups-0.15.1 ... linking ... done.
Loading package void-0.6.1 ... linking ... done.
Loading package conduit-1.1.6 ... linking ... done.
Loading package regex-base-0.93.2 ... linking ... done.
Loading package regex-posix-0.95.2 ... linking ... ghc: warning: isupper from msvcrt is linked instead of __imp_isupper
ghc: warning: toupper from msvcrt is linked instead of __imp_toupper
ghc: warning: tolower from msvcrt is linked instead of __imp_tolower
ghc: warning: isalpha from msvcrt is linked instead of __imp_isalpha
ghc: warning: isalpha from msvcrt is linked instead of __imp_isalpha
ghc: warning: isalpha from msvcrt is linked instead of __imp_isalpha
ghc: warning: iscntrl from msvcrt is linked instead of __imp_iscntrl
ghc: warning: isupper from msvcrt is linked instead of __imp_isupper
ghc: warning: isgraph from msvcrt is linked instead of __imp_isgraph
ghc: warning: isprint from msvcrt is linked instead of __imp_isprint
ghc: warning: ispunct from msvcrt is linked instead of __imp_ispunct
ghc: warning: isalnum from msvcrt is linked instead of __imp_isalnum
ghc: warning: isalpha from msvcrt is linked instead of __imp_isalpha
ghc: warning: isalnum from msvcrt is linked instead of __imp_isalnum
ghc: warning: isalnum from msvcrt is linked instead of __imp_isalnum
ghc: warning: isalnum from msvcrt is linked instead of __imp_isalnum
ghc: warning: isalnum from msvcrt is linked instead of __imp_isalnum
ghc: warning: isalnum from msvcrt is linked instead of __imp_isalnum
ghc: warning: isalnum from msvcrt is linked instead of __imp_isalnum
ghc: warning: isalnum from msvcrt is linked instead of __imp_isalnum
ghc: warning: isalnum from msvcrt is linked instead of __imp_isalnum
ghc: warning: isalnum from msvcrt is linked instead of __imp_isalnum
ghc: warning: isalnum from msvcrt is linked instead of __imp_isalnum
ghc: warning: isalnum from msvcrt is linked instead of __imp_isalnum
ghc: warning: isalnum from msvcrt is linked instead of __imp_isalnum
done.
Loading package regex-compat-0.95.1 ... linking ... done.
Loading package parsec-3.1.5 ... linking ... done.
Loading package network-2.5.0.0 ... linking ... ghc: warning: WSACleanup from ws2_32 is linked instead of __imp_WSACleanup
ghc: warning: WSAStartup from ws2_32 is linked instead of __imp_WSAStartup
ghc: warning: WSACleanup from ws2_32 is linked instead of __imp_WSACleanup
ghc: warning: accept from ws2_32 is linked instead of __imp_accept
ghc: warning: inet_ntoa from ws2_32 is linked instead of __imp_inet_ntoa
ghc: warning: getnameinfo from ws2_32 is linked instead of __imp_getnameinfo
ghc: warning: getaddrinfo from ws2_32 is linked instead of __imp_getaddrinfo
ghc: warning: freeaddrinfo from ws2_32 is linked instead of __imp_freeaddrinfo
done.
Loading package vault-0.3.0.3 ... linking ... done.
Loading package wai-3.0.0.2 ... linking ... done.
Loading package base64-bytestring-1.0.0.1 ... linking ... done.
Loading package fast-logger-2.1.5 ... linking ... done.
Loading package zlib-0.5.4.1 ... linking ... done.
Loading package streaming-commons-0.1.3.1 ... linking ... done.
Loading package stringsearch-0.3.6.5 ... linking ... done.
Loading package byteorder-1.0.4 ... linking ... done.
Loading package wai-logger-2.1.1 ... linking ... done.
Loading package word8-0.0.4 ... linking ... done.
Loading package wai-extra-3.0.1 ... linking ... done.
Loading package conduit-extra-1.1.1 ... linking ... done.
Loading package simple-sendfile-0.2.15 ... linking ... done.
Loading package unix-compat-0.4.1.3 ... linking ... ghc: warning: GetVersionExA from kernel32 is linked instead of __imp_GetVersionExA
ghc: warning: GetModuleHandleA from kernel32 is linked instead of __imp_GetModuleHandleA
ghc: warning: GetProcAddress from kernel32 is linked instead of __imp_GetProcAddress
ghc: warning: _snprintf from msvcrt is linked instead of __imp__snprintf
ghc: warning: GetSystemInfo from kernel32 is linked instead of __imp_GetSystemInfo
ghc: warning: GetSystemMetrics from user32 is linked instead of __imp_GetSystemMetrics
ghc: warning: GetVersionExA from kernel32 is linked instead of __imp_GetVersionExA
ghc: warning: _snprintf from msvcrt is linked instead of __imp__snprintf
ghc: warning: GetSystemInfo from kernel32 is linked instead of __imp_GetSystemInfo
ghc: warning: GetComputerNameA from kernel32 is linked instead of __imp_GetComputerNameA
ghc: warning: CryptAcquireContextA from advapi32 is linked instead of __imp_CryptAcquireContextA
ghc: warning: CryptGenRandom from advapi32 is linked instead of __imp_CryptGenRandom
ghc: warning: _stat64 from msvcrt is linked instead of __imp__stat64
ghc: warning: _open from msvcrt is linked instead of __imp__open
ghc: warning: _stat64 from msvcrt is linked instead of __imp__stat64
done.
Loading package warp-3.0.0.4 ... linking ... done.
Loading package scotty-0.8.1 ... linking ... done.
Loading package hermit-web-0.1.0.0 ... linking ... done.
Setting phasers to stun... (port 3000) (ctrl-c to quit)

These warnings seem to be related to Windows-specific .dll files, including kernel32.dll, user32.dll, msvcrt.dll, advapi32.dll, and ws2_32.dll. As far as I can tell, there are no problems other than the warnings themselves, but I can't be sure.

Change History (6)

comment:1 Changed 9 months ago by bananu7

I'm getting this under Lens too (pretty much the same errors, so no point copying the whole thing).

I have 7.8.3 / x86_64 on Windows 8.

Last edited 9 months ago by bananu7 (previous) (diff)

comment:2 Changed 7 months ago by hvr

Fwiw, the code emitting that warning is in rts/Linker.c, and has the following comment attached:

/* Ticket #2283.
   Long description: http://support.microsoft.com/kb/132044
   tl;dr:
     If C/C++ compiler sees __declspec(dllimport) ... foo ...
     it generates call *__imp_foo, and __imp_foo here has exactly
     the same semantics as in __imp_foo = GetProcAddress(..., "foo")
*/

comment:3 Changed 7 months ago by Herbert Valerio Riedel <hvr@…>

In c375de0193f66df55fa765a7562f2c1a3d2dba93/ghc:

Update `time` submodule to address linker issue

See also https://github.com/haskell/time/issues/2

However, while the `time-1.5` package now loads successful in GHCi,
the linker warnings as reported in #9297 occur (which let the
testsuite fail for a dozen of testcases due to this additional
output)

comment:4 Changed 7 months ago by gintas

comment:5 Changed 5 months ago by YitzGale

  • Cc YitzGale added

comment:6 Changed 6 weeks ago by Jedai

Same here with Gloss or rather OpenGL :

<interactive>: warning: wglGetProcAddress from opengl32 is linked instead of __imp_wglGetProcAddress
<interactive>: warning: GetProcAddress from kernel32 is linked instead of __imp_GetProcAddress
<interactive>: warning: LoadLibraryA from kernel32 is linked instead of __imp_LoadLibraryA
<interactive>: warning: GetProcAddress from kernel32 is linked instead of __imp_GetProcAddress
<interactive>: warning: LoadLibraryA from kernel32 is linked instead of __imp_LoadLibraryA
<interactive>: internal error: checkProddableBlock: invalid fixup in runtime linker: 000000000f5c00e8
    (GHC version 7.10.1 for x86_64_unknown_mingw32)

To reproduce : compile gloss with minghc-7.10.1 then in ghci ask to display something.

I note that this ends up with an error "checkProddableBlock: invalid fixup in runtime linker"... should I reopen #8237 ?

Last edited 6 weeks ago by Jedai (previous) (diff)
Note: See TracTickets for help on using tickets.