[GHC] #1151: small program misbehaves with -fvia-C

GHC trac at galois.com
Sat Feb 17 14:24:55 EST 2007


#1151: small program misbehaves with -fvia-C
----------------------------------------------+-----------------------------
 Reporter:  Stefan O'Rear <stefanor at cox.net>  |          Owner:          
     Type:  bug                               |         Status:  new     
 Priority:  normal                            |      Milestone:          
Component:  Compiler                          |        Version:  6.7     
 Severity:  normal                            |     Resolution:          
 Keywords:                                    |     Difficulty:  Unknown 
 Testcase:                                    |   Architecture:  Multiple
       Os:  Multiple                          |  
----------------------------------------------+-----------------------------
Old description:

> stefan at stefans:/tmp$ mkdir bug
> stefan at stefans:/tmp$ cd bug
> stefan at stefans:/tmp/bug$ echo 'main = interact $ (show :: Bool -> String)
> . read' > bug.hs
> stefan at stefans:/tmp/bug$ ghc -fasm bug.hs
> stefan at stefans:/tmp/bug$ echo -n False | ./a.out
> Falsestefan at stefans:/tmp/bug$ rm *
> stefan at stefans:/tmp/bug$ echo 'main = interact $ (show :: Bool -> String)
> . read' > bug.hs
> stefan at 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 at 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 at 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

New description:

 {{{
 stefan at stefans:/tmp$ mkdir bug
 stefan at stefans:/tmp$ cd bug
 stefan at stefans:/tmp/bug$ echo 'main = interact $ (show :: Bool -> String)
 . read' > bug.hs
 stefan at stefans:/tmp/bug$ ghc -fasm bug.hs
 stefan at stefans:/tmp/bug$ echo -n False | ./a.out
 Falsestefan at stefans:/tmp/bug$ rm *
 stefan at stefans:/tmp/bug$ echo 'main = interact $ (show :: Bool -> String)
 . read' > bug.hs
 stefan at 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 at 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 at 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

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1151>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list