Opened 10 years ago

Closed 5 years ago

#1605 closed bug (worksforme)

hppa port -- gmp handed misaligned memory

Reported by: guest Owned by:
Priority: lowest Milestone: 7.6.2
Component: Runtime System Version: 6.6.1
Keywords: GMP Cc:
Operating System: HPUX Architecture: hppa
Type of failure: Runtime crash Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

GMP compiled for hppa 2.0n uses 8 byte data by default. hppa *requires* that 8 byte data be aligned on an 8 byte boundary. However GHC only aligns allocated memory to a 4 byte boundary. This causes GHC to crash. Currently the workaround is to recompile GMP to use 32 bit data, but this is probably a performance hit.

Joe Buehler

Change History (17)

comment:1 Changed 10 years ago by igloo

Milestone: 6.8.2

comment:2 Changed 10 years ago by igloo

Milestone: 6.8.26.8.3

comment:3 Changed 9 years ago by igloo

I think that something like this might be the way to go:

diff -rN -u old-val/rts/PrimOps.cmm new-val/rts/PrimOps.cmm
--- old-val/rts/PrimOps.cmm     2008-05-24 02:20:52.000000000 +0100
+++ new-val/rts/PrimOps.cmm     2008-05-24 02:21:06.000000000 +0100
@@ -546,23 +546,33 @@
 
 /* ToDo: this is shockingly inefficient */
 
+#if defined(hpux_HOST_OS)
+#define MP_ALIGN align 8;
+#else
+#define MP_ALIGN
+#endif
+
 #ifndef THREADED_RTS
 section "bss" {
+  MP_ALIGN
   mp_tmp1:
     bits8 [SIZEOF_MP_INT];
 }
 
 section "bss" {
+  MP_ALIGN
   mp_tmp2:
     bits8 [SIZEOF_MP_INT];
 }
 
 section "bss" {
+  MP_ALIGN
   mp_result1:
     bits8 [SIZEOF_MP_INT];
 }
 
 section "bss" {
+  MP_ALIGN
   mp_result2:
     bits8 [SIZEOF_MP_INT];
 }
@@ -691,6 +701,7 @@
 
 #ifndef THREADED_RTS
 section "bss" {
+  MP_ALIGN
   mp_tmp_w:  W_; // NB. mp_tmp_w is really an here mp_limb_t
 }
 #endif

but (in the HEAD) having the align on amd64/Linux gives me:

../compiler/ghc-inplace -Werror -H64m -Onot -fasm -optc-O2 -I../includes -I. -Iparallel -Ism -DCOMPILING_RTS -package-name rts -fvia-C -static  -I../gmp/gmpbuild -I../libffi/build/include -I. -dcmm-lint     -c PrimOps.cmm -o PrimOps.o
ghc-6.9.20080523: panic! (the 'impossible' happened)
  (GHC version 6.9.20080523 for x86_64-unknown-linux):
        PprC.pprTop: can't handle this data

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

make[1]: *** [PrimOps.o] Error 1

comment:4 Changed 9 years ago by igloo

Milestone: 6.8.36.10.1

comment:5 Changed 9 years ago by igloo

Milestone: 6.10.16.10 branch

comment:6 Changed 9 years ago by igloo

Milestone: 6.10 branch6.12 branch

See also #2917.

comment:7 Changed 8 years ago by simonmar

difficulty: Easy (1 hr)Easy (less than 1 hour)

comment:8 Changed 8 years ago by simonmar

Type of failure: Runtime crash

comment:9 Changed 7 years ago by igloo

Milestone: 6.12 branch6.12.3

comment:10 Changed 7 years ago by igloo

Milestone: 6.12.36.14.1
Priority: normallow

comment:11 Changed 7 years ago by igloo

Milestone: 7.0.17.0.2

comment:12 Changed 7 years ago by igloo

Milestone: 7.0.27.2.1

comment:13 Changed 6 years ago by igloo

Milestone: 7.2.17.4.1

comment:14 Changed 6 years ago by igloo

Milestone: 7.4.17.6.1
Priority: lowlowest

comment:15 Changed 5 years ago by igloo

Milestone: 7.6.17.6.2

comment:16 Changed 5 years ago by morabbin

HPPA is currently ranked a Tier 2 platform, do we even know if this is still an issue? (HPPA hasn't had a binary release for at least four years, according to the GHC downloads page.)

comment:17 Changed 5 years ago by simonmar

Resolution: worksforme
Status: newclosed

Optimistically closing.

Note: See TracTickets for help on using tickets.