Opened 6 years ago

Closed 15 months ago

#1870 closed bug (wontfix)

ghc-6.8.1 panics compiling regex-tdfa-0.93

Reported by: ChrisKuklewicz Owned by: simonpj
Priority: low Milestone:
Component: Compiler Version: 6.8.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by simonpj)

This was reported to me by thomas.hartman@…

Short summary: The file that dies indicated that use of "mdo" may be the problem, since the file is quite ordinary otherwise.

There is no cut down test case yet. The regex-base and regex-tdfa were pulled from
http://darcs.haskell.org/packages/regex-unstable/

> I darcs got the newest regex-tdfa (0.93 iirc) and made all the obvious changes involving LANGUAGE/OPTION_GHC pragmas to get this to work on ghc-6.8.1
> 
> prereq regex_base 0.93 installs ok
> regex-tdfa panics with

> hartthoma@linuxpt:~/installs/regexstuff/regex-newest/regex-tdfa>runghc Setup.hs build
> Preprocessing library regex-tdfa-0.93...
> Building regex-tdfa-0.93...
> [ 1 of 21] Compiling Data.IntMap.CharMap ( Data/IntMap/CharMap.hs, dist/build/Data/IntMap/CharMap.o )
> 
> Data/IntMap/CharMap.hs:9:27:
>     Warning: Imported from `Data.Char' but not used: `chr'
> [ 2 of 21] Compiling Data.IntSet.EnumSet ( Data/IntSet/EnumSet.hs, dist/build/Data/IntSet/EnumSet.o )
> [ 3 of 21] Compiling Data.IntMap.EnumMap ( Data/IntMap/EnumMap.hs, dist/build/Data/IntMap/EnumMap.o )
> [ 4 of 21] Compiling Text.Regex.TDFA.IntArrTrieSet ( Text/Regex/TDFA/IntArrTrieSet.hs, dist/build/Text/Regex/TDFA/IntArrTrieSet.o )
> [ 5 of 21] Compiling Text.Regex.TDFA.Common ( Text/Regex/TDFA/Common.hs, dist/build/Text/Regex/TDFA/Common.o )
> [ 6 of 21] Compiling Text.Regex.TDFA.Pattern ( Text/Regex/TDFA/Pattern.hs, dist/build/Text/Regex/TDFA/Pattern.o )
> [ 7 of 21] Compiling Text.Regex.TDFA.ReadRegex ( Text/Regex/TDFA/ReadRegex.hs, dist/build/Text/Regex/TDFA/ReadRegex.o )
> [ 8 of 21] Compiling Text.Regex.TDFA.CorePattern ( Text/Regex/TDFA/CorePattern.hs, dist/build/Text/Regex/TDFA/CorePattern.o )
> ghc-6.8.1: panic! (the 'impossible' happened)
>   (GHC version 6.8.1 for i386-unknown-linux):
>         splitFunTy
>     <nt>mtl-1.1.0.0:Control.Monad.RWS.Lazy.RWS{tc rsRo}
>       (base:Data.Maybe.Maybe{tc r6}
>          regex-tdfa-0.93:Text.Regex.TDFA.Common.GroupIndex{tc raaa})
>       [base:Data.Either.Either{tc 344}
>          regex-tdfa-0.93:Text.Regex.TDFA.Common.Tag{tc raai}
>          regex-tdfa-0.93:Text.Regex.TDFA.Common.GroupInfo{tc raa4}]
>       ([regex-tdfa-0.93:Text.Regex.TDFA.Common.OP{tc raae}]
>        -> [regex-tdfa-0.93:Text.Regex.TDFA.Common.OP{tc raae}],
>        regex-tdfa-0.93:Text.Regex.TDFA.Common.Tag{tc raai})
>       (base:GHC.Prim.Any{(w) tc 31N},
>        [regex-tdfa-0.93:Text.Regex.TDFA.Common.Tag{tc raai}])
> 
> Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Change History (12)

comment:1 Changed 6 years ago by simonpj

  • Description modified (diff)
  • Difficulty set to Unknown

I tried to reproduce this. I got the code from http://darcs.haskell.org/packages/regex-unstable/

After adjusting the Cabal files to depend on containers etc, I compiled regex-base ok. Then I tried regex-tdfa. First I got this:

Text/Regex/TDFA/MutRunBS.hs:12:17:
    Could not find module `Data.ByteString.Base':

OK, so I changed the import to Data.ByteString.Unsafe. Then I get

bash-3.1$ runhaskell Setup.hs  build
Preprocessing library regex-tdfa-0.93...
Building regex-tdfa-0.93...
[ 1 of 21] Compiling Data.IntMap.CharMap ( Data/IntMap/CharMap.hs, dist/build/Data/IntMap/CharMap.o )
[ 2 of 21] Compiling Data.IntSet.EnumSet ( Data/IntSet/EnumSet.hs, dist/build/Data/IntSet/EnumSet.o )
[ 3 of 21] Compiling Data.IntMap.EnumMap ( Data/IntMap/EnumMap.hs, dist/build/Data/IntMap/EnumMap.o )
[ 4 of 21] Compiling Text.Regex.TDFA.IntArrTrieSet ( Text/Regex/TDFA/IntArrTrieSet.hs, dist/build/Text/Regex/TDFA/IntArrTrieSet.o )
[ 5 of 21] Compiling Text.Regex.TDFA.Common ( Text/Regex/TDFA/Common.hs, dist/build/Text/Regex/TDFA/Common.o )
[ 6 of 21] Compiling Text.Regex.TDFA.Pattern ( Text/Regex/TDFA/Pattern.hs, dist/build/Text/Regex/TDFA/Pattern.o )
[ 7 of 21] Compiling Text.Regex.TDFA.ReadRegex ( Text/Regex/TDFA/ReadRegex.hs, dist/build/Text/Regex/TDFA/ReadRegex.o )
[ 8 of 21] Compiling Text.Regex.TDFA.CorePattern ( Text/Regex/TDFA/CorePattern.hs, dist/build/Text/Regex/TDFA/CorePattern.o )
[ 9 of 21] Compiling Text.Regex.TDFA.TNFA ( Text/Regex/TDFA/TNFA.hs, dist/build/Text/Regex/TDFA/TNFA.o )
[10 of 21] Compiling Text.Regex.TDFA.RunMutState ( Text/Regex/TDFA/RunMutState.hs, dist/build/Text/Regex/TDFA/RunMutState.o )

Text/Regex/TDFA/RunMutState.hs:608:9:
    Constructor `STUArray' should have 4 arguments, but has been given 3
    In the pattern: STUArray _ _ msource
    In the definition of `copySTU':
	copySTU (STUArray _ _ msource) (STUArray _ _ mdest)
		  = ST $ \ s1# -> case sizeofMutableByteArray# msource of n# -> ...

Notice it compiled CorePattern just fine. At this point I stopped. This is all with GHC 6.8.1.

If you can give further info on how to reproduce I'll happily look further. Also trying compiling with -dcore-lint. Did you make clean to start with?

Simon

comment:2 Changed 6 years ago by igloo

  • Milestone set to 6.8.2
  • Priority changed from normal to low

We'll close this as worksforme shortly unless someone can confirm the problem.

comment:3 Changed 6 years ago by simonpj

  • Owner set to simonpj

No, no! I managed to reproduce it. The key thing is not to use -fglasgow-exts, but to turn on language extensions selectively. In particular, the combination of not having -XRelaxedPolyRec but having -XMonoPatBinds triggers the bug.

Simon

comment:4 Changed 6 years ago by igloo

  • Milestone changed from 6.8.2 to 6.8.3

comment:5 Changed 6 years ago by igloo

  • Milestone changed from 6.8.3 to 6.10.1
  • Priority changed from low to normal

comment:6 Changed 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:7 Changed 6 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple

comment:8 Changed 6 years ago by igloo

  • Milestone changed from 6.10.1 to 6.10.2

comment:9 Changed 5 years ago by simonpj

  • Milestone changed from 6.10.2 to _|_
  • Priority changed from normal to low

I think I'm going to make this low-priority for now, and remove it from the 6.10.2 milestone. Reason: there's an easy workaround, and it's in territory that is going to be upheaved (again) when we implement the Haskell Prime spec for bindings #2357. As a result, it's hard to motivate myself to invest in fixing this one.

If it's important to anyone, then sing out.

Simon

comment:10 Changed 5 years ago by simonpj

PS: I remembered another reason: it's relatively laborious to reproduce!

comment:11 Changed 15 months ago by morabbin

  • Type of failure set to None/Unknown

As #2357 is closed as fixed, and is cited above to cause upheaval in this h'yar territory, close as wontfix?

comment:12 Changed 15 months ago by simonpj

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

Yes let's close it. I don't think anyone else has complained that regex-tdfa doesn't compile.

Note: See TracTickets for help on using tickets.