Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,866
    • Issues 4,866
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 451
    • Merge requests 451
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2722
Closed
Open
Created Oct 22, 2008 by uwe@trac-uwe

<<loop> when compiling with -O option with ghc-6.10.0.20081019

When trying to compile HXT with ghc-6.10 rc1 all examples, even the simplest ones give the following result. Here is an example:

theo@brett:~/haskell/hxt-ghc10/examples/arrows/hparser> ./HXmlParser example1.xml
HXmlParser: <<loop>>

this only occurs, when compiling with -O (or -O2). When compiling whithout any optimizaions, the programs run as expected

Here is a more complete log of one example

The running example without -O

theo@brett:~/haskell/hxt-ghc10/examples/arrows/hparser> ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.10.0.20081019
theo@brett:~/haskell/hxt-ghc10/examples/arrows/hparser> ghc-pkg list
/home/theo/lib/ghc-6.10.0.20081019/./package.conf:
    Cabal-1.6.0.1, HUnit-1.2.0.2, QuickCheck-1.2.0.0, array-0.2.0.0,
    base-3.0.3.0, base-4.0.0.0, bytestring-0.9.1.4, containers-0.2.0.0,
    curl-1.3.2.1, directory-1.0.0.2, (dph-base-0.3), (dph-par-0.3),
    (dph-prim-interface-0.3), (dph-prim-par-0.3), (dph-prim-seq-0.3),
    (dph-seq-0.3), filepath-1.1.0.1, (ghc-6.10.0.20081019),
    ghc-prim-0.1.0.0, haddock-2.2.2, haskell-src-1.0.1.3,
    haskell98-1.0.1.0, hpc-0.5.0.2, html-1.0.1.2, hxt-8.2.0,
    integer-0.1.0.0, mtl-1.1.0.2, network-2.2.0.0, old-locale-1.0.0.1,
    old-time-1.0.0.1, packedstring-0.1.0.1, parallel-1.0.0.1,
    parsec-2.1.0.1, pretty-1.0.1.0, process-1.0.1.0, random-1.0.0.1,
    regex-base-0.72.0.2, regex-compat-0.71.0.1, regex-posix-0.72.0.3,
    rts-1.0, stm-2.1.1.1, syb-0.1.0.0, tagsoup-0.6,
    template-haskell-2.3.0.0, time-1.1.2.2, unix-2.3.1.0,
    xhtml-3000.2.0.1
theo@brett:~/haskell/hxt-ghc10/examples/arrows/hparser> find ../../../src -name '*.hi' | xargs rm -f
theo@brett:~/haskell/hxt-ghc10/examples/arrows/hparser> make local GHCFLAGS=-Wall
ghc --make -o ./HXmlParser -Wall -fglasgow-exts -ignore-package hxt -i../../../src ./HXmlParser.hs
[  1 of 112] Compiling Text.XML.HXT.XPath.XPathKeywords ( ../../../src/Text/XML/HXT/XPath/XPathKeywords.hs, ../../../src/Text/XML/HXT/XPath/XPathKeywords.o )
[  2 of 112] Compiling Text.XML.HXT.IO.GetFILE ( ../../../src/Text/XML/HXT/IO/GetFILE.hs, ../../../src/Text/XML/HXT/IO/GetFILE.o )
[  3 of 112] Compiling Text.XML.HXT.DTDValidation.RE ( ../../../src/Text/XML/HXT/DTDValidation/RE.hs, ../../../src/Text/XML/HXT/DTDValidation/RE.o )
...
[111 of 112] Compiling Text.XML.HXT.Arrow ( ../../../src/Text/XML/HXT/Arrow.hs, ../../../src/Text/XML/HXT/Arrow.o )
[112 of 112] Compiling Main             ( HXmlParser.hs, HXmlParser.o )
Linking ./HXmlParser ...
theo@brett:~/haskell/hxt-ghc10/examples/arrows/hparser> ./HXmlParser example1.xml
<?xml version="1.0" encoding="UTF-8"?>
<?pi  value="a processing instruction"?><a att1="test äöüß test" att2="root">
    <b btt2="b1" btt3="root"/>
    <cü>hello world äöüß test</cü>
</a>

The same with -O

theo@brett:~/haskell/hxt-ghc10/examples/arrows/hparser>
theo@brett:~/haskell/hxt-ghc10/examples/arrows/hparser> find ../../../src -name '*.hi' | xargs rm -f
theo@brett:~/haskell/hxt-ghc10/examples/arrows/hparser> make clean
rm -f ./HXmlParser *.o *.hi
theo@brett:~/haskell/hxt-ghc10/examples/arrows/hparser> make local GHCFLAGS="-Wall -O"
ghc --make -o ./HXmlParser -Wall -O -fglasgow-exts -ignore-package hxt -i../../../src ./HXmlParser.hs
[  1 of 112] Compiling Text.XML.HXT.XPath.XPathKeywords ( ../../../src/Text/XML/HXT/XPath/XPathKeywords.hs, ../../../src/Text/XML/HXT/XPath/XPathKeywords.o )
[  2 of 112] Compiling Text.XML.HXT.IO.GetFILE ( ../../../src/Text/XML/HXT/IO/GetFILE.hs, ../../../src/Text/XML/HXT/IO/GetFILE.o )
[  3 of 112] Compiling Text.XML.HXT.DTDValidation.RE ( ../../../src/Text/XML/HXT/DTDValidation/RE.hs, ../../../src/Text/XML/HXT/DTDValidation/RE.o )
[  4 of 112] Compiling Text.XML.HXT.RelaxNG.Unicode.Blocks ( ../../../src/Text/XML/HXT/RelaxNG/Unicode/Blocks.hs, ../../../src/Text/XML/HXT/RelaxNG/Unicode/Blocks.o )
...
[111 of 112] Compiling Text.XML.HXT.Arrow ( ../../../src/Text/XML/HXT/Arrow.hs, ../../../src/Text/XML/HXT/Arrow.o )
[112 of 112] Compiling Main             ( HXmlParser.hs, HXmlParser.o )
Linking ./HXmlParser ...
theo@brett:~/haskell/hxt-ghc10/examples/arrows/hparser> ./HXmlParser example1.xml
HXmlParser: <<loop>>

The only difference is the -O.

My guess is, that there could be problems with the overloaded version of id and . (function comp.). This is used in HXT because of various arrow types.

In the example going wrong, there is a list arrow involved, that manages a state and runs in the IO monad.

It's rather hard to strip down this test case to a smaller example, because I've no idea where to search for this loop.

If neccessary I can prepare a tar archive with all sources needed to reproduce this error.

Trac metadata
Trac field Value
Version 6.10.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture x86
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking