Skip to content

segfault in generated file when using NOINLINE

Compiling and running the attached file produces a segmentation fault. The file was originally generated by happy (1.15), but using happy 1.16 does not help. Removing the {-# NOINLINE happySpecReduce_1 #-} right before main solves the problem.

uname -a:
Linux femtosec 2.6.18-4-486 #1 Wed May 9 22:23:40 UTC 2007 i686 GNU/Linux

gcc -v: gcc version 4.1.2

ctr@femtosec:~/shared/kep/Misc/esotools/temp$ ghc -v
Glasgow Haskell Compiler, Version 6.6.1, for Haskell 98, compiled by GHC version 6.6.1
Using package config file: /home/ctr/tools/lib/ghc-6.6.1/package.conf
wired-in package base mapped to base-2.1.1
wired-in package rts mapped to rts-1.0
wired-in package haskell98 mapped to haskell98-1.0
wired-in package template-haskell mapped to template-haskell-2.1
Hsc static flags: -static
*** Deleting temp files:
Deleting:
*** Deleting temp dirs:
Deleting:
ghc-6.6.1: no input files
Usage: For basic information, try the `--help' option.


=== The compilation-run ===
ghc -O2 -dcore-lint -fvia-C -fglasgow-exts -fwarn-missing-signatures --make T -o esoT
[1 of 1] Compiling Main             ( T.hs, T.o )

GenericTemplate.hs:174:0:
    Warning: Definition but no type signature for `happyShift'

GenericTemplate.hs:184:0:
    Warning: Definition but no type signature for `happySpecReduce_0'

GenericTemplate.hs:189:0:
    Warning: Definition but no type signature for `happySpecReduce_1'

GenericTemplate.hs:195:0:
    Warning: Definition but no type signature for `happySpecReduce_2'

GenericTemplate.hs:201:0:
    Warning: Definition but no type signature for `happySpecReduce_3'

GenericTemplate.hs:207:0:
    Warning: Definition but no type signature for `happyReduce'

GenericTemplate.hs:215:0:
    Warning: Definition but no type signature for `happyMonadReduce'

GenericTemplate.hs:222:0:
    Warning: Definition but no type signature for `happyDrop'

GenericTemplate.hs:225:0:
    Warning: Definition but no type signature for `happyDropStk'

GenericTemplate.hs:239:0:
    Warning: Definition but no type signature for `happyGoto'

GenericTemplate.hs:246:0:
    Warning: Definition but no type signature for `happyFail'

GenericTemplate.hs:258:0:
    Warning: Definition but no type signature for `notHappyAtAll'

T.hs:92:0:
    Warning: Definition but no type signature for `happyReduction_1'

T.hs:98:0:
    Warning: Definition but no type signature for `happyReduction_2'

T.hs:107:0:
    Warning: Definition but no type signature for `happyReduction_3'

T.hs:115:0:
    Warning: Definition but no type signature for `happyNewToken'

T.hs:126:0:
    Warning: Definition but no type signature for `happyError_'

T.hs:129:0:
    Warning: Definition but no type signature for `happyIdentity'

T.hs:130:0:
    Warning: Definition but no type signature for `happyRunIdentity'

T.hs:140:0:
    Warning: Definition but no type signature for `happyThen1'

T.hs:146:0: Warning: Definition but no type signature for `parse'

T.hs:149:0:
    Warning: Definition but no type signature for `happySeq'

T.hs:163:0:
    Warning: Definition but no type signature for `happyParse'

T.hs:171:0:
    Warning: Definition but no type signature for `happyAccept'

T.hs:120:1:
    Warning: Pattern match(es) are overlapped
             In a case alternative: _ -> ...
Linking esoT ...

ctr@femtosec:~/shared/kep/Misc/esotools/temp$ ./esoT
Segmentation fault
Edited by Ian Lynagh -
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information