Opened 3 years ago

Closed 16 months ago

#8830 closed bug (invalid)

internal error: Misaligned section: 18206e5b on Windows

Reported by: joeyhess Owned by:
Priority: lowest Milestone:
Component: Compiler Version: 7.6.3
Keywords: Cc:
Operating System: Windows Architecture: x86
Type of failure: GHCi crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Loading package gnutls-0.1.5 ... ghc.exe: internal error: Misaligned section: 18206e5b

(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.

Only occurs when loading the module in as part of a build involving TH. A non-TH-using program using this library links successfully.

I have installed a gnutls built for Windows, from http://josefsson.org/gnutls4win/. Different versions have different section offsets, but all the versions I've tried fail like this.

I've also gotten the same error linking gnuidn, instead of gnutls, with gnuidn from ftp://ftp.gnu.org/gnu/libidn/libidn-1.28-win32.zip This makes me think this may be a general ghci on windows bug, rather than a misbuilt library.

Change History (5)

comment:1 Changed 3 years ago by gintas

Status: newinfoneeded

Could you provide more detailed instructions to reproduce the issue?

comment:2 Changed 3 years ago by gintas

Priority: normallowest

comment:3 Changed 2 years ago by mtolly

This appears to specifically happen when you link in static C libraries during TH on Windows. MinGW's linker will automatically prefer static libraries over dynamic ones if it finds them, so you can work around it by only using dynamic libraries. Here's what I did:

I have an executable that uses libsndfile, and its Haskell binding hsndfile, and also uses TH. On Windows XP with MinGW/MSYS, I compiled and installed libsndfile and its dependencies, and installed hsndfile, but when it got to the module that needs TH, I got:

Loading package hsndfile-0.7.1 ... ghc.exe: internal error: Misaligned section .eh_frame: 0d035673
    (GHC version 7.8.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.

So, I went into the lib/ folder I had installed the C libraries into, and deleted all the static libraries (like libsndfile.a), leaving only e.g. libsndfile.dll.a and libsndfile.la, plus libsndfile-1.dll in my bin/ folder. Then I recompiled all the Haskell packages that used C libs (hsndfile and everything on top of it). Tried to compile the executable again, and it complained of not being able to find "sndfile.dll". So I just copied libsndfile-1.dll to sndfile.dll, and then it compiled and ran fine.

comment:4 Changed 21 months ago by Phyx-

@joeyhess Do you have a reproducible case for this?

comment:5 Changed 16 months ago by thomie

Resolution: invalid
Status: infoneededclosed

Closing, as no response from submitter. Without a reproducible test case we can't do anything. GHC on Windows is much better than it was one year ago, so hopefully this is fixed as well.

Note: See TracTickets for help on using tickets.