[GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
30 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
--------------------------------------+---------------------------------
           Reporter:  awson           |             Owner:
               Type:  bug             |            Status:  new
           Priority:  normal          |         Milestone:
          Component:  Compiler        |           Version:  8.1
           Keywords:                  |  Operating System:  Windows
       Architecture:  x86_64 (amd64)  |   Type of failure:  None/Unknown
          Test Case:                  |        Blocked By:
           Blocking:                  |   Related Tickets:
Differential Rev(s):                  |         Wiki Page:
--------------------------------------+---------------------------------
 Currently GHC HEAD segfaults on Windows 64-bit when compiling
 `language-c-quote-0.11.7.1` package.

 It spits something like `Access violation in generated code when executing
 data at 0000000102fbcf40` (I'm using my #13108 patch here).

 After repeated run, when GHC hasn't recompile all files, but only part of
 them, it succeeds.

 If I delete intermediate files and repeat clean compilation, it segfaults
 again.

 Haddock always segfaults (since it always recompile all files), more
 details here: https://github.com/haskell/haddock/pull/568.

 Since these access violations consistently happen on executable data at
 virtual addresses above 4GB mark, this very much smells as a GHC bytecode
 generator/linker issue.

 I believe, GHC and Haddock succeed exactly when all executable addresses
 stay below 4GB mark.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by awson):

 Well, I've slightly changed internals or runtime linker and managed to
 catch this segfault at address `00000000940c6da0` which is below 4GB but
 clearly above 2GB mark. This clarifies things somewhat, I believe, because
 "small" memory model code executable addresses should lie below this mark.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by awson):

 Sorry for the noise, I've deleted my previous comment since it was quite
 misleading.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by awson):

 My previous comment was, in fact, correct.

 After thorough investigations I've discovered that the crash happens when
 runtime linker starts to load object code into addresses higher than 2GB,
 thus violating small code model requirement.

 I see no easy ways to fix this, so, for the time being the only workaround
 I see is to use `-fexternal-interpreter` (thank you, people, it now works
 on Windows).

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by awson):

 I've managed to create quick and dirty solution to make GHC work properly
 (basically we have to add `MEM_TOP_DOWN` flag to `VirtualAlloc` in our
 main `allocNew` allocation routine (see `OSMem.c`).

 In such a way we allocate all memory except executable (which uses
 `allocateExec` and `allocateImageAndTrampolines` allocation routines) from
 top to down leaving enough room for executable memory in low address area.

 OTOH, while this solves the problem for GHC itself, it can create problems
 for programs linked against such modified RTS:
 1. MS warns that allocation from top to down may be slower;
 2. If a client makes its own dynamic data execution using these data, its
 code will likely crash.

 Thus if we ever would go this way, we should modify the build system,
 using different allocation strategies for GHC itself and for RTS libraries
 distributed along with GHC.

 I have another couple of patches, which may or may not improve Windows
 allocation matters in RTS. E.g. `HeapAlloc` works well for
 `allocateImageAndTrampolines` saving quite a lot of memory comparing to
 the quite wasteful `VirtualAlloc`.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------
Changes (by RyanGlScott):

 * cc: Phyx- (added)


Comment:

 Thanks for looking into this awson! I'm afraid this stuff flies far over
 my head, but Tamar might have some input.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by rwbarton):

 Is it possible on Windows to allocate a pool of memory addresses, below
 2GB and of size, say, 1GB, without actually committing pages? I see
 comments in the two-step allocator about "VirtualAlloc
 MEM_RESERVE/MEM_COMMIT" and why it doesn't work for reserving 1TB worth of
 address space, but perhaps for 1GB it would be okay.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by awson):

 Replying to [comment:6 rwbarton]:
 > Is it possible on Windows to allocate a pool of memory addresses, below
 2GB and of size, say, 1GB, without actually committing pages? I see
 comments in the two-step allocator about "VirtualAlloc
 MEM_RESERVE/MEM_COMMIT" and why it doesn't work for reserving 1TB worth of
 address space, but perhaps for 1GB it would be okay.

 Yeah, I thought about this also. It's '''definitely''' possible, but this
 way we need to write a custom allocator which would commit/decommit pages
 inside this reserved space. This is surely doable, but not so much easily.

 I've also looked further down into things and found that using
 `MEM_TOP_DOWN` is not recommended to use for anything other than testing
 because of potential huge performance penalty.

 The good news is that `USE_LARGE_ADDRESS_SPACE` should, in fact,
 [http://blogs.microsoft.co.il/sasha/2016/01/05/windows-process-memory-
 usage-demystified/ work for latest Windows 10 versions]. `Memory.exe
 reserve 1000000` from the article works fine on my W10 1607. I believe W10
 1511 should work either.

 Thus happy users of latest versions of W10 should, in theory, be able to
 build GHC with `USE_LARGE_ADDRESS_SPACE` enabled and run it with
 `heapBase` flag set to the value above, say 1GB.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by awson):

 Replying to [comment:7 awson]:
 > Yeah, I thought about this also. It's '''definitely''' possible, but
 this way we need to write a custom allocator which would commit/decommit
 pages inside this reserved space. This is surely doable, but not so much
 easily.

 Ah, we, perhaps, could reuse parts of `USE_LARGE_ADDRESS_SPACE` code for
 this (not using any large address space in fact).

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by awson):

 FYI, I've built (slightly patched) GHC HEAD (170118) with
 `USE_LARGE_ADDRESS_SPACE` enabled.

 Now it automatically allocates main heap at 2GB mark (no need to give any
 extra options, since Windows already can't find 1TB or contiguous address
 space starting below 2GB mark) and things work '''perfectly'''.

 Apparently, also there are no problems with `USE_LARGE_ADDRESS_SPACE` on
 W10 1607. Woohoo!

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by quyse):

 Replying to [comment:9 awson]:
 > FYI, I've built (slightly patched) GHC HEAD (170118) with
 `USE_LARGE_ADDRESS_SPACE` enabled.
 >
 > Now it automatically allocates main heap at 2GB mark (no need to give
 any extra options, since Windows already can't find 1TB or contiguous
 address space starting below 2GB mark) and things work '''perfectly'''.
 >
 > Apparently, also there are no problems with `USE_LARGE_ADDRESS_SPACE` on
 W10 1607. Woohoo!
 Hi, I'm seeing these segfaults on Windows too with GHC 8.0.2 building my
 own code using TH. Is there a GHC patch I can apply to fix this? I tried
 using `-fexternal-interpreter`, it works on development machine, but
 frequently hangs indefinitely on CI machine.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by RyanGlScott):

 For some reason, I'm unable to reproduce this on 64-bit Windows 10. I
 tried building `language-c-quote-0.11.7.1` with GHC 8.0.2, and
 `language-c-quote-0.12.1` with GHC 8.0.2 and 8.2.1, but neither of them
 segfaulted. Can you still trigger this segfault, awson?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by awson):

 I can't. No segfault on 8.2.1 (and never was on 8.0.2).

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by RyanGlScott):

 OK. The reason I ask is that another user recently reported experiencing a
 segfault on 64-bit Windows (#14089), and while I haven't tried reproducing
 the exact issue myself due to the sheer number of dependencies, the heavy
 use of Template Haskell in their project makes me wonder if this issue is
 the underlying culprit.

 Unfortunately, GHC 8.2.1 seems to have made it more difficult to trigger
 the particular case of `language-c-quote` giving a segfault. It seems
 doubtful that the issue just magically cured itself in the meantime, since
 the discussion above strongly suggests that we'll need to change the way
 GHC allocates memory on Windows to properly fix this. It would be nice if
 there were a minimal, dependency-less way of reproducing this so that we
 could continue investigating.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by jbetz):

 I can reproduce it on 64-bit Windows, with or without TH. The bindings to
 PostreSQL are completely broken because of it, presumably do to C code
 generated in postgresql-libpq.

 It's been identified in multiple database projects:

 * https://github.com/yesodweb/persistent/issues/697
 * https://github.com/tomjaguarpaw/haskell-opaleye/issues/338

 Probably not much help in narrowing it down, but this really needs to be
 looked into. Especially since WSL still isn't a viable alternative at this
 point. It's unbearably slow.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by awson):

 Replying to [comment:14 jbetz]:
 > * https://github.com/tomjaguarpaw/haskell-opaleye/issues/338
 Is it possible to make [https://github.com/tomjaguarpaw/haskell-
 opaleye/issues/338#issuecomment-335511777 your example] slightly more
 self-contained? Particularly I don't want to deal with postgresql-related
 packages. I have a lot of packages installed in my main package database,
 and I've even added `product-profunctors` package to it, but still get
 several {{{Not in scope: type constructor or class `CellRecord'}}} errors.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:15>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by RyanGlScott):

 I'm aware of the `persistent` issue, see
 https://ghc.haskell.org/trac/ghc/ticket/14089#comment:8. But alas, as I've
 documented at that link, I can no longer reliably reproduce the segfault
 on GHC 8.2.1!

 Coming up with a minimal example (with preferably no external
 dependencies) would go a long way in diagnosing this issue.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:16>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by jbetz):

 Replying to [comment:15 awson]:
 > Is it possible to make [https://github.com/tomjaguarpaw/haskell-
 opaleye/issues/338#issuecomment-335511777 your example] slightly more
 self-contained?

 I've updated the original issue to remove some dependencies, and I'll try
 to get it all into one Main module this weekend. If that doesn't help, I
 guess we'll have to dig deeper into the postgres libraries.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:17>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:  (none)
            Type:  bug           |               Status:  new
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by RyanGlScott):

 jbetz, which code are you referring to? This is the code snippet at the
 top of https://github.com/tomjaguarpaw/haskell-opaleye/issues/338 at the
 time of writing:

 {{{#!hs
 module Main where

 import           Data.Int
 import           Data.Profunctor.Product    (p1)
 import           Database.PostgreSQL.Simple (Connection, connect,
                                              connectDatabase,
 connectPassword,
                                              defaultConnectInfo)
 import           Opaleye                    (Column, PGText, Query,
                                              Table (Table), queryTable,
                                              required, runInsertMany,
 runQuery)
 import qualified Opaleye.PGTypes            as P

 main :: IO ()
 main = do
   connection <- connect $ defaultConnectInfo { connectDatabase =
 "postgres", connectPassword = "changeme"}
   r1 <- doTestInsertQuery connection
   print r1
   r2 <- doTestSelectQuery connection
   print r2

 doTestInsertQuery :: Connection -> IO Int64
 doTestInsertQuery connection =
   runInsertMany connection testTable [P.pgString "ok"]

 doTestSelectQuery :: Connection -> IO [String]
 doTestSelectQuery connection =
   runQuery connection testQuery

 testQuery :: Query (Column PGText)
 testQuery =
   queryTable testTable

 testTable :: Table (Column PGText) (Column PGText)
 testTable =
   Table "test" (p1 (required "message"))
 }}}

 But compiling this with GHC 8.2.1 on my 64-bit Windows machine seems to
 work!

 {{{
 $ ghc -fforce-recomp Bug.hs
 [1 of 1] Compiling Main             ( Bug.hs, Bug.o )
 Linking Bug.exe ...

 $ ./Bug.exe
 Bug.exe: SqlError {sqlState = "", sqlExecStatus = FatalError, sqlErrorMsg
 = "could not connect to server: Connection refused
 (0x0000274D/10061)\n\tIs the server running on host \"127.0.0.1\" and
 accepting\n\tTCP/IP connections on port 5432?\n", sqlErrorDetail = "",
 sqlErrorHint = ""}
 }}}

 The same thing happens if I compile with `-O2`.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:18>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
Reply | Threaded
Open this post in threaded view
|

Re: [GHC] #13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.

GHC - devs mailing list
In reply to this post by GHC - devs mailing list
#13112: Windows 64-bit GHC HEAD segfaults on the code with a lot of TH stuff.
---------------------------------+--------------------------------------
        Reporter:  awson         |                Owner:  (none)
            Type:  bug           |               Status:  infoneeded
        Priority:  normal        |            Milestone:
       Component:  Compiler      |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Windows       |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------
Changes (by RyanGlScott):

 * status:  new => infoneeded


--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13112#comment:19>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
ghc-tickets mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets
12