ghc-stage2 —interactive segfaults on Mac OS X 10.11.6 (build flavour = prof)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ghc-stage2 —interactive segfaults on Mac OS X 10.11.6 (build flavour = prof)

Alfredo Di Napoli
Hey all,

I’m trying to compile GHC HEAD (cloning from master) with the `prof` build flavour on a Mac OS X 10.11.6 machine and I have noticed that, despite ghc-stage2 works as expected, when invoked with —interactive it starts before crashing with a segmentation fault:

```
☁  compiler [master] ⚡ ../inplace/bin/ghc-stage2 --interactive
GHCi, version 8.3.20170413: http://www.haskell.org/ghc/  :? for help
[1]    79176 segmentation fault  ../inplace/bin/ghc-stage2 --interactive
```

Did it happen to somebody else or it’s just me? Shall I try throwing gdb at it to try and see what’s going on?

Thanks,

Alfredo

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

Re: ghc-stage2 —interactive segfaults on Mac OS X 10.11.6 (build flavour = prof)

Ben Gamari-2
Alfredo Di Napoli <[hidden email]> writes:

> Hey all,
>
> I’m trying to compile GHC HEAD (cloning from master) with the `prof` build
> flavour on a Mac OS X 10.11.6 machine and I have noticed that, despite
> ghc-stage2 works as expected, when invoked with —interactive it starts
> before crashing with a segmentation fault:
>
> ```
> ☁  compiler [master] ⚡ ../inplace/bin/ghc-stage2 --interactive
> GHCi, version 8.3.20170413: http://www.haskell.org/ghc/  :? for help
> [1]    79176 segmentation fault  ../inplace/bin/ghc-stage2 --interactive
> ```
>
> Did it happen to somebody else or it’s just me? Shall I try throwing gdb at
> it to try and see what’s going on?
Hmm, interesting. I've not seen crashes like this locally nor in CI. It
would be great if you could try to get some insight. Is this crash
perfectly reproducible?

It may be worth adding -dcore-lint to GhcStage2HcOpts to ensure the code
we are producing is sane.

Cheers,

- Ben


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

signature.asc (497 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ghc-stage2 —interactive segfaults on Mac OS X 10.11.6 (build flavour = prof)

Alfredo Di Napoli
Hey Ben,

yes, it’s consistently reproducible. I have tried compiling GHC from scratch by adding `-dcore-lint` and `-debug` to GhcStage2HcOpts in my mk/build.mk, but eventually the build process failed with:

ld: library not found for -lHSrts_thr_debug_p

Any idea what am I doing wrong? Next I’m going to try enabling `-DDEBUG` only as described here:


To see if I get any further.

Thanks!

A.


On 13 April 2017 at 19:01, Ben Gamari <[hidden email]> wrote:
Alfredo Di Napoli <[hidden email]> writes:

> Hey all,
>
> I’m trying to compile GHC HEAD (cloning from master) with the `prof` build
> flavour on a Mac OS X 10.11.6 machine and I have noticed that, despite
> ghc-stage2 works as expected, when invoked with —interactive it starts
> before crashing with a segmentation fault:
>
> ```
> ☁  compiler [master] ⚡ ../inplace/bin/ghc-stage2 --interactive
> GHCi, version 8.3.20170413: http://www.haskell.org/ghc/  :? for help
> [1]    79176 segmentation fault  ../inplace/bin/ghc-stage2 --interactive
> ```
>
> Did it happen to somebody else or it’s just me? Shall I try throwing gdb at
> it to try and see what’s going on?

Hmm, interesting. I've not seen crashes like this locally nor in CI. It
would be great if you could try to get some insight. Is this crash
perfectly reproducible?

It may be worth adding -dcore-lint to GhcStage2HcOpts to ensure the code
we are producing is sane.

Cheers,

- Ben



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

Re: ghc-stage2 —interactive segfaults on Mac OS X 10.11.6 (build flavour = prof)

Alfredo Di Napoli
Ok, I had success by removing “-debug” in favour of “-DDEBUG”. After compiling GHC I fired GDB and this is the output:

Starting program: /Users/adinapoli/programming/haskell/ghc/inplace/lib/bin/ghc-stage2 -B/Users/adinapoli/programming/haskell/ghc/inplace/lib --interactive
GHCi, version 8.3.20170413: http://www.haskell.org/ghc/  :? for help
[New Thread 0x120f of process 19786]
[New Thread 0x1403 of process 19786]
[New Thread 0x1503 of process 19786]
[New Thread 0x1603 of process 19786]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000000104cdd81a in ocInit_MachO () at rts/linker/MachO.c:141
141         if(NULL != oc->info->nlist) {

Maybe it does ring a bell to any of you. In case not, I’m happy to continue digging.

A.

On 14 April 2017 at 21:19, Alfredo Di Napoli <[hidden email]> wrote:
Hey Ben,

yes, it’s consistently reproducible. I have tried compiling GHC from scratch by adding `-dcore-lint` and `-debug` to GhcStage2HcOpts in my mk/build.mk, but eventually the build process failed with:

ld: library not found for -lHSrts_thr_debug_p

Any idea what am I doing wrong? Next I’m going to try enabling `-DDEBUG` only as described here:


To see if I get any further.

Thanks!

A.


On 13 April 2017 at 19:01, Ben Gamari <[hidden email]> wrote:
Alfredo Di Napoli <[hidden email]> writes:

> Hey all,
>
> I’m trying to compile GHC HEAD (cloning from master) with the `prof` build
> flavour on a Mac OS X 10.11.6 machine and I have noticed that, despite
> ghc-stage2 works as expected, when invoked with —interactive it starts
> before crashing with a segmentation fault:
>
> ```
> ☁  compiler [master] ⚡ ../inplace/bin/ghc-stage2 --interactive
> GHCi, version 8.3.20170413: http://www.haskell.org/ghc/  :? for help
> [1]    79176 segmentation fault  ../inplace/bin/ghc-stage2 --interactive
> ```
>
> Did it happen to somebody else or it’s just me? Shall I try throwing gdb at
> it to try and see what’s going on?

Hmm, interesting. I've not seen crashes like this locally nor in CI. It
would be great if you could try to get some insight. Is this crash
perfectly reproducible?

It may be worth adding -dcore-lint to GhcStage2HcOpts to ensure the code
we are producing is sane.

Cheers,

- Ben




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

Re: ghc-stage2 —interactive segfaults on Mac OS X 10.11.6 (build flavour = prof)

Ben Gamari-2
On April 14, 2017 3:33:21 PM EDT, Alfredo Di Napoli <[hidden email]> wrote:

>Ok, I had success by removing “-debug” in favour of “-DDEBUG”. After
>compiling GHC I fired GDB and this is the output:
>
>Starting program:
>/Users/adinapoli/programming/haskell/ghc/inplace/lib/bin/ghc-stage2
>-B/Users/adinapoli/programming/haskell/ghc/inplace/lib --interactive
>GHCi, version 8.3.20170413: http://www.haskell.org/ghc/  :? for help
>[New Thread 0x120f of process 19786]
>[New Thread 0x1403 of process 19786]
>[New Thread 0x1503 of process 19786]
>[New Thread 0x1603 of process 19786]
>
>Thread 1 received signal SIGSEGV, Segmentation fault.
>0x0000000104cdd81a in ocInit_MachO () at rts/linker/MachO.c:141
>141         if(NULL != oc->info->nlist) {
>
>Maybe it does ring a bell to any of you. In case not, I’m happy to
>continue
>digging.
>
It doesn't ring a bell and I'm not near a computer at the moment, but it sounds like you are hot on the trail; that is a far more tractable error.

I'll have a look at the code to see if I can see any obvious things to check when I get back home.


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

Re: ghc-stage2 —interactive segfaults on Mac OS X 10.11.6 (build flavour = prof)

Moritz Angermann-2
In reply to this post by Alfredo Di Napoli
Hi,

that looks pretty much like I broke that :-(
Do you have a backtrace? The info structs should be filled properly by ocInit_MachO when loading object code.

The nlist would point to the symbol names list. However I believe that either oc is already NULL, in which case you should have never reached that point, or info is NULL, in which case ocInit seems to not have been called.

I'll try to reproduce this today.

Cheers,
 Moritz

Sent from my iPhone

On 15 Apr 2017, at 3:33 AM, Alfredo Di Napoli <[hidden email]> wrote:

Ok, I had success by removing “-debug” in favour of “-DDEBUG”. After compiling GHC I fired GDB and this is the output:

Starting program: /Users/adinapoli/programming/haskell/ghc/inplace/lib/bin/ghc-stage2 -B/Users/adinapoli/programming/haskell/ghc/inplace/lib --interactive
GHCi, version 8.3.20170413: http://www.haskell.org/ghc/  :? for help
[New Thread 0x120f of process 19786]
[New Thread 0x1403 of process 19786]
[New Thread 0x1503 of process 19786]
[New Thread 0x1603 of process 19786]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x0000000104cdd81a in ocInit_MachO () at rts/linker/MachO.c:141
141         if(NULL != oc->info->nlist) {

Maybe it does ring a bell to any of you. In case not, I’m happy to continue digging.

A.

On 14 April 2017 at 21:19, Alfredo Di Napoli <[hidden email]> wrote:
Hey Ben,

yes, it’s consistently reproducible. I have tried compiling GHC from scratch by adding `-dcore-lint` and `-debug` to GhcStage2HcOpts in my mk/build.mk, but eventually the build process failed with:

ld: library not found for -lHSrts_thr_debug_p

Any idea what am I doing wrong? Next I’m going to try enabling `-DDEBUG` only as described here:


To see if I get any further.

Thanks!

A.


On 13 April 2017 at 19:01, Ben Gamari <[hidden email]> wrote:
Alfredo Di Napoli <[hidden email]> writes:

> Hey all,
>
> I’m trying to compile GHC HEAD (cloning from master) with the `prof` build
> flavour on a Mac OS X 10.11.6 machine and I have noticed that, despite
> ghc-stage2 works as expected, when invoked with —interactive it starts
> before crashing with a segmentation fault:
>
> ```
> ☁  compiler [master] ⚡ ../inplace/bin/ghc-stage2 --interactive
> GHCi, version 8.3.20170413: http://www.haskell.org/ghc/  :? for help
> [1]    79176 segmentation fault  ../inplace/bin/ghc-stage2 --interactive
> ```
>
> Did it happen to somebody else or it’s just me? Shall I try throwing gdb at
> it to try and see what’s going on?

Hmm, interesting. I've not seen crashes like this locally nor in CI. It
would be great if you could try to get some insight. Is this crash
perfectly reproducible?

It may be worth adding -dcore-lint to GhcStage2HcOpts to ensure the code
we are producing is sane.

Cheers,

- Ben



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

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