Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#15142 closed defect (fixed)

ghc 6.8.2 fails to build Adjustor.o (bus error, segmentation fault) on PowerPC

Reported by: ryandesign (Ryan Schmidt) Owned by: gwright@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc: gabrielesvelto (Gabriele Svelto), JeNeSuisPasDave (Dave Hein), sonicth, dpkatz@…, yaseppochi (Stephen J. Turnbull), macports@…
Port: ghc

Description

I'm having trouble building ghc 6.8.2. I'm using MacPorts 1.6.0 and Xcode 2.5 on Mac OS X 10.4.11 on a Power Mac G4 and after some time the build stops with this:

------------------------------------------------------------------------
== make all -r;
 in /opt/local/var/macports/build/_Volumes_data_macports_ports_lang_ghc/work/ghc-6.8.2/rts
------------------------------------------------------------------------
../compiler/ghc-inplace -optc-O -optc-I/opt/local/include -optc-Wall -optc-W -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-I../includes -optc-I. -optc-Iparallel -optc-Ism -optc-DCOMPILING_RTS -optc-fomit-frame-pointer -optc-I/opt/local/include -optc-I../gmp/gmpbuild -optc-fno-strict-aliasing -H16m -O -I/opt/local/include -L/opt/local/lib -optc-O2 -package-name rts -static -I/opt/local/include -I../gmp/gmpbuild -I. -#include HCIncludes.h -dcmm-lint     -c Adjustor.c -o Adjustor.o
make[1]: *** [Adjustor.o] Bus error
make: *** [stage1] Error 1

Error: Status 1 encountered during processing.

Attachments (2)

dest.log.bz2 (32.5 KB) - added by sonicth 12 years ago.
2009-07-12_ghc_6.10.3_ppc_10.4.11_dest.log.bz2 (32.1 KB) - added by sonicth 12 years ago.

Download all attachments as: .zip

Change History (31)

comment:1 Changed 13 years ago by gabrielesvelto (Gabriele Svelto)

Cc: gabriele.svelto@… added

Cc Me!

comment:2 Changed 13 years ago by ryandesign (Ryan Schmidt)

Summary: ghc 6.8.2 build failure (bus error)ghc 6.8.2 fails to build Adjustor.o (bus error, segmentation fault)

Has duplicate #15923, in which it's pointed out that this has also been reported upstream in their ticket #2380.

ghc 6.8.2 and 6.8.3 fail to build Adjustor.o, crashing with a bus error or segmentation fault or similar, on many (all?) PowerPC Macs, but not on (any?) Intel Macs. As reported initially, I experience the problem on a Power Mac G4, but it builds fine on a MacBook Pro. Both systems are running Mac OS X 10.4.11 with Xcode 2.5. I have not yet tested Leopard.

comment:3 Changed 13 years ago by ryandesign (Ryan Schmidt)

Summary: ghc 6.8.2 fails to build Adjustor.o (bus error, segmentation fault)ghc 6.8.2 fails to build Adjustor.o (bus error, segmentation fault) on PowerPC

comment:4 Changed 13 years ago by JeNeSuisPasDave (Dave Hein)

Cc: dhein@… added

Cc Me!

comment:5 Changed 13 years ago by JeNeSuisPasDave (Dave Hein)

I get the same problem with 6.8.3 on a Powerbook (G4). Also OS X 10.4.11 with Xcode 2.5.

The haskell.org ticket http://hackage.haskell.org/trac/ghc/ticket/2380 seems to indicate that if I could install a binary version of 6.8.1 then the build would succeed (because it would use 6.8.1 in the bootstrapping compile step that is failing). But I don't have a binary port available to me. :-(

comment:6 Changed 12 years ago by blb@…

Cc: mike.vasiljevs@… added
Port: ghc added

Cc reporter of dup #16805.

comment:7 Changed 12 years ago by blb@…

Cc: dpkatz@… added

Cc reporter of dup #17006.

comment:8 Changed 12 years ago by ryandesign (Ryan Schmidt)

Cc: stephen@… added

comment:9 Changed 12 years ago by ryandesign (Ryan Schmidt)

Has duplicate #17184.

comment:10 Changed 12 years ago by gwright@…

Status: newassigned

comment:11 Changed 12 years ago by macports@…

Some success: I was able to compile ghc-6.10.1 from source on Mac OS X Leopard (10.5.5) on a powerpc G4 with XCode 3.1. I used a bootstrap ghc-6.10.1 from Christian Maeder's ppc/Tiger 6.10.1 binary.

comment:12 Changed 12 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:13 in reply to:  11 ; Changed 12 years ago by sonicth

Replying to macports@…:

Some success: I was able to compile ghc-6.10.1 from source on Mac OS X Leopard (10.5.5) on a powerpc G4 with XCode 3.1. I used a bootstrap ghc-6.10.1 from Christian Maeder's ppc/Tiger 6.10.1 binary.

sound great...

hm, i also used the bootstrap from fink (v 0.24.23) package ghc (v 6.4.1-1002) - so i made a link ghc-inplace -> /sw/bin/ghc-6.4.1 (in directory /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_ghc/work/ghc-6.8.3/compiler if it will help anyone).

This way i can compile few more files in ghc-6.8.3/rts directory, until the missing Cmm.h problem:

make ../compiler/ghc-inplace -H16m -O -I/opt/local/include -L/opt/local/lib -optc-O2 -package-name rts -static -I/opt/local/include -I../gmp/gmpbuild -I. -#include HCIncludes.h -dcmm-lint -c Apply.cmm -o Apply.o Apply.cmm:13:17: error: Cmm.h: No such file or directory

If i include ../includes/Cmm.h (for C--) it will give me parse error (Apply.cmm:61:42: parse error on input `never'), and i tried to fix some macros and defines (something to do with stack mechanism in haskell) but without end result as thats beyond my knowledge of the language implementation.

If you are an implementation hacker, this is the right time to help out!

comment:14 in reply to:  13 ; Changed 12 years ago by yaseppochi (Stephen J. Turnbull)

Replying to mike.vasiljevs@…:

Replying to macports@…:

Some success: I was able to compile ghc-6.10.1

FWIW, I was able to "port upgrade" ghc 6.8.2_0, got blocked on ghc 6.8.3_*, and now have built like 5 ghcs in a row (not sure exactly, but I've gotten in the habit of upgrading ghc nightly with all the recent commits to the port; I've built at least 3 in the 6.10.1 series).

PPC 10.4.11 (iBook G4, 1.33MHz, 1.25GB RAM)
MacPorts 1.7 (most recent "svn up; ./configure; make; sudo make install" done yesterday, previous was in May or June---successful port upgrade of 6.10.1 with both versions of port).

Haven't tried on Leopard yet, but that box is Intel anyway so the comments above suggest it won't be affected.

comment:15 in reply to:  14 Changed 12 years ago by sonicth

Replying to stephen@…:

Replying to mike.vasiljevs@…:

Replying to macports@…:

Some success: I was able to compile ghc-6.10.1

FWIW, I was able to "port upgrade" ghc 6.8.2_0, got blocked on ghc 6.8.3_*, and now have built like 5 ghcs in a row (not sure exactly, but I've gotten in the habit of upgrading ghc nightly with all the recent commits to the port; I've built at least 3 in the 6.10.1 series).

oops :/ ok, i thought getting mac would make things easier ;)

after "port selfupdate" building the x.10.x version, which will probably take all night ;)

comment:16 in reply to:  14 Changed 12 years ago by sonicth

Replying to stephen@…:

Replying to mike.vasiljevs@…:

Replying to macports@…:

Some success: I was able to compile ghc-6.10.1

FWIW, I was able to "port upgrade" ghc 6.8.2_0, got blocked on ghc 6.8.3_*, and now have built like 5 ghcs in a row (not sure exactly, but I've gotten in the habit of upgrading ghc nightly with all the recent commits to the port; I've built at least 3 in the 6.10.1 series).

PPC 10.4.11 (iBook G4, 1.33MHz, 1.25GB RAM)

actually the 6.10.1 has failed for me too:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_ghc/work/ghc-6.10.1/rts root# make
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_ghc/work/ghc-6.10.1/ghc/stage1-inplace/ghc  -H32m -O -I/opt/local/include -L/opt/local/lib -optc-O2 -I../includes -I. -Iparallel -Ism -DCOMPILING_RTS -package-name rts -static  -I/opt/local/include -I../gmp/gmpbuild -I../libffi/build/include -I. -dcmm-lint     -c Apply.cmm -o Apply.o
ghc: internal error: ARR_WORDS object entered!
    (GHC version 6.10.1 for powerpc_apple_darwin)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
make: *** [Apply.o] Abort trap

i have also PPC 10.4.11, (iBook G4, 1.33MHz, 1.0GB RAM)

comment:17 Changed 12 years ago by gwright@…

I was able to compile 6.10.1 on ppc/Leopard using the 6.10.1 bootstrap compiler I built for the port. This procedure should be identical to that used by revision 8 of the ghc port. (I was not able to run the port itself as I don't have root privileges on the machine I am using and don't want to install a second MacPorts.)

I wonder if some of the problems people are seeing might be Xcode related. I had success with Xcode 3.1 on OS X 10.5.5 (xnu-1228.7.58~1). The "machine" command reported "ppc7450".

If someone could try building revision 8 of the ghc port and sending the output, I would greatly appreciate it. Do

$ sudo port selfupdate
$ port info ghc

(Make sure you have revision 8.)

$ sudo port clean --all ghc
$ sudo port -dv destroot ghc > dest.log 2>&1

If the build fails, you can attach a compressed version of the "dest.log" file to this ticket.

comment:18 Changed 12 years ago by gwright@…

I can't emphasize enough the need for complete build logs, including the configuration phase, to make progress on this issue. Please always run the port command with the "-dv" flags and attach all output to this ticket.

comment:19 Changed 12 years ago by gwright@…

One other piece of information I need is the gmp version. I had success with

gandalf:~ gwright$ port installed gmp
The following ports are currently installed:
  gmp @4.2.4_0
gandalf:~ gwright$   

Please include the gmp version with any new reports. Thanks.

comment:20 in reply to:  17 ; Changed 12 years ago by ryandesign (Ryan Schmidt)

Replying to gwright@…:

I was able to compile 6.10.1 on ppc/Leopard using the 6.10.1 bootstrap compiler I built for the port. This procedure should be identical to that used by revision 8 of the ghc port. (I was not able to run the port itself as I don't have root privileges on the machine I am using and don't want to install a second MacPorts.)

Yes! With gmp @4.2.4_0, ghc @6.10.1_8 builds for me on Mac OS X 10.5.5 on my Power Mac. I haven't tried Tiger PPC yet.

I wonder if some of the problems people are seeing might be Xcode related. I had success with Xcode 3.1 on OS X 10.5.5 (xnu-1228.7.58~1). The "machine" command reported "ppc7450".

I'm using Xcode 3.1.1 and "machine" here says "ppc7400". It's a Power Mac G4 (Digital Audio) 466 MHz.

comment:21 in reply to:  20 Changed 12 years ago by gwright@…

Replying to ryandesign@…:

Replying to gwright@…:

I was able to compile 6.10.1 on ppc/Leopard using the 6.10.1 bootstrap compiler I built for the port. This procedure should be identical to that used by revision 8 of the ghc port. (I was not able to run the port itself as I don't have root privileges on the machine I am using and don't want to install a second MacPorts.)

Yes! With gmp @4.2.4_0, ghc @6.10.1_8 builds for me on Mac OS X 10.5.5 on my Power Mac. I haven't tried Tiger PPC yet.

I wonder if some of the problems people are seeing might be Xcode related. I had success with Xcode 3.1 on OS X 10.5.5 (xnu-1228.7.58~1). The "machine" command reported "ppc7450".

I'm using Xcode 3.1.1 and "machine" here says "ppc7400". It's a Power Mac G4 (Digital Audio) 466 MHz.

Excellent news. I was able to test revision 8 on my ppc/Tiger PowerBook and it worked. So we may have working builds now on all platforms: the cartesian product of (i386, ppc) and (Tiger, Leopard).

It's hard to know what the underlying bug really was. It may have been in earlier versions of ghc itself, or in libgmp.

If I don't hear any more reports of failure in the next few days, I will declare victory and send an announcement on the ghc user's list reminding people to update libgmp before building ghc 6.10.1.

Changed 12 years ago by sonicth

Attachment: dest.log.bz2 added

comment:22 Changed 12 years ago by sonicth

Replying to gwright@…:

One other piece of information I need is the gmp version. I had success with

ok, as posted before, just port build on my system, no boostraps compiled separately (because it takes too much time to get started ;/)

regards

$ port installed gmp
The following ports are currently installed:
  gmp @4.2.2_1
  gmp @4.2.3_0
  gmp @4.2.4_0 (active)

including rather detailed info

$ machine
 ppc7450
$ system_profiler
...
      Machine Name: iBook G4
      Machine Model: PowerBook6,7
      CPU Type: PowerPC G4 (1.5)
...      
System Version: Mac OS X 10.4.11 (8S165)
      Kernel Version: Darwin 8.11.0
...
    DIMM0/BUILT-IN:

      Size: 512 MB
      Type: Built-in
      Speed: Built-in
      Status: OK

    DIMM1/J7:

      Size: 512 MB
      Type: DDR SDRAM
      Speed: PC2700U-25330
      Status: OK
...

I have followed all the commands from answer 17,

comment:23 Changed 12 years ago by gwright@…

OK, so now we have a report of failure on 10.4.11. I am not able to reproduce this on my 10.4.11 PowerBook G4 (ppc7450).

One interesting thing is that the latest report has the build failing with a segfault while compiling Apply.cmm, not Adjustor.c, as in the original report.

I will probably announce the new port to the ghc users list; perhaps some more people with ppc hardware will be able to reproduce the problem.

comment:24 Changed 12 years ago by ryandesign (Ryan Schmidt)

ghc @6.10.1_8 also builds for me on Mac OS X 10.4.11. Same Power Mac G4 466 MHz for which I reported success on Leopard above, gmp @4.2.4_0, Xcode 2.5.

comment:25 Changed 12 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

comment:26 Changed 12 years ago by gwright@…

Resolution: fixed
Status: assignedclosed

This was apparently a bug in the gcc provided by certain versions of Xcode. AFAIK, the latest versions for Tiger/ppc and Leopard/ppc work.

comment:27 in reply to:  26 ; Changed 12 years ago by sonicth

Replying to gwright@…:

This was apparently a bug in the gcc provided by certain versions of Xcode. AFAIK, the latest versions for Tiger/ppc and Leopard/ppc work.

Hi,

I have just did the following:

$ sudo port selfupdate
$ sudo port clean --all ghc
$ sudo port -dv destroot ghc > dest.log 2>&1

and i still get "make[1]: * [Apply.o] Bus error"

I have checked for the latest XCode/gcc on developer.apple.com and I seem to have the latest, it has not been update for a while :/.

If a newer version for Tiger/ppc is required than that available on apple's site, would that imply buiding it myself?

Or would you recommend filing another report?

Greets m

Mac Ports Version: 1.710

$ gcc --version
powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5370)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make --version
GNU Make 3.80
Copyright (C) 2002  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
$ uname -a
Darwin mikes-ibook 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh powerpc
$ port info ghc
ghc @6.10.3, Revision 4 (lang, haskell)
Variants:    cabal_configure_debug, darwin_6, darwin_7, darwin_8_i386, darwin_8_powerpc, darwin_9_i386, darwin_9_powerpc

The Glasgow Haskell Compiler is a robust, fully-featured, optimising compiler and interactive environment for Haskell 98, GHC compiles Haskell to either
native code or C. It implements numerous experimental language extensions to Haskell 98, for example: concurrency, a foreign language interface,
multi-parameter type classes, scoped type variables, existential and universal quantification, unboxed types, exceptions, weak pointers, and so on. GHC comes
with a generational garbage collector, and a space and time profiler.
Homepage:    http://haskell.org/ghc

Library Dependencies: libedit, gmp, perl5.8
Platforms:            darwin
Maintainers:          gwright@macports.org

comment:28 in reply to:  27 ; Changed 12 years ago by blb@…

Replying to mike.vasiljevs@…:

I have checked for the latest XCode/gcc on developer.apple.com and I seem to have the latest, it has not been update for a while :/.

What is the actual Xcode version you have? Yes, Apple hasn't updated it in some time, but do make sure you have 2.5. You can check by doing a Get Info in Finder on Xcode.app (in /Developer/Applications) or by simply launching it and checking Xcode->About Xcode.

comment:29 in reply to:  28 Changed 12 years ago by sonicth

Replying to blb@…:

Replying to mike.vasiljevs@…:

I have checked for the latest XCode/gcc on developer.apple.com and I seem to have the latest, it has not been update for a while :/.

What is the actual Xcode version you have? Yes, Apple hasn't updated it in some time, but do make sure you have 2.5. You can check by doing a Get Info in Finder on Xcode.app (in /Developer/Applications) or by simply launching it and checking Xcode->About Xcode.

it's 2.5, of course ;)

i've attached the log in 2009-07-12_ghc_6.10.3_ppc_10.4.11_dest.log.bz2

however because ghc base has died maybe it's the problem with the binary base?

debugging it, it dies at s6Yw_info(), but the file that is searched, libffi/build/src/powerpc/ffi_darwin.c, does not contain this function, nevertheless. Can somebody explain where to get sources with s6Yw_info()?

greets

(gdb) run -B/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_ghc/work/ghc-6.10.3/inplace-datadir/. -dynload wrapped rts/Apply.cmm
Starting program: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_ghc/work/ghc-6.10.3/ghc/stage1-inplace/libexec/ghc -B/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_ghc/work/ghc-6.10.3/inplace-datadir/. -dynload wrapped rts/Apply.cmm

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x02e5598a
0x007bb810 in s6Yw_info ()
(gdb) bt
#0  0x007bb810 in s6Yw_info ()
#1  0x007b8f64 in rYk_info ()
#2  0x00d6e624 in scheduleWaitThread ()
#3  0x00d1cd14 in real_main ()
#4  0x00d1ce1c in main ()
(gdb) 
Note: See TracTickets for help on using tickets.