Opened 7 years ago

Closed 15 months 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 Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

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 6 years ago by igloo

  • Milestone set to 6.8.2

comment:2 Changed 6 years ago by igloo

  • Milestone changed from 6.8.2 to 6.8.3

comment:3 Changed 6 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 6 years ago by igloo

  • Milestone changed from 6.8.3 to 6.10.1

comment:5 Changed 6 years ago by igloo

  • Milestone changed from 6.10.1 to 6.10 branch

comment:6 Changed 5 years ago by igloo

  • Milestone changed from 6.10 branch to 6.12 branch

See also #2917.

comment:7 Changed 4 years ago by simonmar

  • Difficulty changed from Easy (1 hr) to Easy (less than 1 hour)

comment:8 Changed 4 years ago by simonmar

  • Type of failure set to Runtime crash

comment:9 Changed 4 years ago by igloo

  • Milestone changed from 6.12 branch to 6.12.3

comment:10 Changed 4 years ago by igloo

  • Milestone changed from 6.12.3 to 6.14.1
  • Priority changed from normal to low

comment:11 Changed 3 years ago by igloo

  • Milestone changed from 7.0.1 to 7.0.2

comment:12 Changed 3 years ago by igloo

  • Milestone changed from 7.0.2 to 7.2.1

comment:13 Changed 3 years ago by igloo

  • Milestone changed from 7.2.1 to 7.4.1

comment:14 Changed 2 years ago by igloo

  • Milestone changed from 7.4.1 to 7.6.1
  • Priority changed from low to lowest

comment:15 Changed 20 months ago by igloo

  • Milestone changed from 7.6.1 to 7.6.2

comment:16 Changed 15 months 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 15 months ago by simonmar

  • Resolution set to worksforme
  • Status changed from new to closed

Optimistically closing.

Note: See TracTickets for help on using tickets.