Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#1151 closed bug (fixed)

small program misbehaves with -fvia-C

Reported by: Stefan O'Rear <stefanor@…> Owned by: simonpj
Priority: normal Milestone: 6.8.1
Component: Compiler Version: 6.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo)

stefan@stefans:/tmp$ mkdir bug
stefan@stefans:/tmp$ cd bug
stefan@stefans:/tmp/bug$ echo 'main = interact $ (show :: Bool -> String) . read' > bug.hs
stefan@stefans:/tmp/bug$ ghc -fasm bug.hs
stefan@stefans:/tmp/bug$ echo -n False | ./a.out
Falsestefan@stefans:/tmp/bug$ rm *
stefan@stefans:/tmp/bug$ echo 'main = interact $ (show :: Bool -> String) . read' > bug.hs
stefan@stefans:/tmp/bug$ ghc -fvia-C bug.hs
/tmp/ghc12591_0/ghc12591_0.hc: In function 'rr5_entry':

/tmp/ghc12591_0/ghc12591_0.hc:33:0:
     warning: assignment makes integer from pointer without a cast

/tmp/ghc12591_0/ghc12591_0.hc:36:0:
     warning: assignment makes integer from pointer without a cast
/tmp/ghc12591_0/ghc12591_0.hc: In function 'srg_entry':

/tmp/ghc12591_0/ghc12591_0.hc:108:0:
     warning: assignment makes integer from pointer without a cast

/tmp/ghc12591_0/ghc12591_0.hc:111:0:
     warning: assignment makes integer from pointer without a cast

/tmp/ghc12591_0/ghc12591_0.hc:115:0:
     warning: assignment makes integer from pointer without a cast
/tmp/ghc12591_0/ghc12591_0.hc: In function 'Main_main_entry':

/tmp/ghc12591_0/ghc12591_0.hc:153:0:
     warning: assignment makes integer from pointer without a cast

/tmp/ghc12591_0/ghc12591_0.hc:156:0:
     warning: assignment makes integer from pointer without a cast
/tmp/ghc12591_0/ghc12591_0.hc: In function 'ZCMain_main_entry':

/tmp/ghc12591_0/ghc12591_0.hc:195:0:
     warning: assignment makes integer from pointer without a cast

/tmp/ghc12591_0/ghc12591_0.hc:198:0:
     warning: assignment makes integer from pointer without a cast
stefan@stefans:/tmp/bug$ echo -n False | ./a.out
a.out: internal error: stg_ap_p_ret
    (GHC version 6.7.20070213 for i386_unknown_linux)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Aborted
stefan@stefans:/tmp/bug$ 

The exact error seen depends in a not-yet-characterised way on the program;
in addition to the above, correct behavior, immediate silent exit, and
"Segmentation fault" have been seen.

Brandon S. Allbery on #haskell was able to reproduce using powerpc_apple_darwin (20070213)
Lennary Augustsson on #haskell was not, using 20070216 "i386, Mac OS X"

Stefan

Change History (7)

comment:1 Changed 7 years ago by igloo

  • Description modified (diff)

comment:2 Changed 7 years ago by igloo

  • Milestone set to 6.8

Stefan has confirmed that this isn't a problem with 6.6.

comment:3 Changed 7 years ago by simonmar

  • Owner set to simonpj

Simon PJ is looking into this. HEAD is currently miscompiling itself, leading to the observed behaviour.

comment:4 Changed 7 years ago by simonpj

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

Fixed. Sorry about this.

Simon

comment:5 Changed 6 years ago by igloo

  • Milestone changed from 6.8 branch to 6.8.1

comment:6 Changed 6 years ago by simonmar

  • Architecture changed from Multiple to Unknown/Multiple

comment:7 Changed 6 years ago by simonmar

  • Operating System changed from Multiple to Unknown/Multiple
Note: See TracTickets for help on using tickets.