Opened 2 years ago

Closed 2 years ago

#10745 closed bug (fixed)

Error in fusion when compiling Data.Yaml

Reported by: nclarke Owned by:
Priority: normal Milestone: 7.10.3
Component: Compiler Version: 7.10.2
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

[2 of 7] Compiling Data.Yaml.Internal ( Data/Yaml/Internal.hs, dist/dist-sandbox-b22ce51e/build/Data/Yaml/Internal.o )

Data/Yaml/Internal.hs:28:1: Warning:
    The import of ‘Control.Applicative’ is redundant
      except perhaps to import instances from ‘Control.Applicative’
    To import instances alone, use: import Control.Applicative()
ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.2 for x86_64-unknown-linux):
        Tick in rule
  unstream
    @ a34_ayco
    @ Void
    @ m_aycm
    @ b_aycn
    (ConduitWithStream
       @ a34_ayco
       @ Void
       @ m_aycm
       @ b_aycn
       (let {
          $dApplicative_aycu :: Applicative (ConduitM a34_ayco Void m_aycm)
          [LclId, Str=DmdType]
          $dApplicative_aycu =
            $fApplicativeConduitM
              @ a34_ayco
              @ Void
              @ m_aycm
              ($fFunctorConduitM @ a34_ayco @ Void @ m_aycm) } in
        letrec {
          loop_aycv :: b_aycn -> ConduitM a34_ayco Void m_aycm b_aycn
          [LclId, Arity=1, Str=DmdType]
          loop_aycv =
            \ (accum_aycw :: b_aycn) ->
              $fMonadConduitM_$c>>=
                @ a34_ayco
                @ Void
                @ m_aycm
                $dApplicative_aycu
                @ (Maybe a34_ayco)
                @ b_aycn
                ((await @ a34_ayco @ m_aycm $dMonad1_aycq) @ Void)
                (maybe
                   @ (ConduitM a34_ayco Void m_aycm b_aycn)
                   @ a34_ayco
                   ($fMonadConduitM_$creturn
                      @ a34_ayco @ Void @ m_aycm $dApplicative_aycu @ b_aycn accum_aycw)
                   (\ (a35_aycx :: a34_ayco) ->
                      $fMonadConduitM_$c>>=
                        @ a34_ayco
                        @ Void
                        @ m_aycm
                        $dApplicative_aycu
                        @ b_aycn
                        @ b_aycn
                        ($ @ (m_aycm b_aycn)
                           @ (ConduitM a34_ayco Void m_aycm b_aycn)
                           ($fMonadBasebaseConduitM_$clift
                              @ a34_ayco @ Void @ m_aycm @ b_aycn $dMonad1_aycq)
                           (f_aycs accum_aycw a35_aycx))
                        (\ (accum'_aycy :: b_aycn) ->
                           case accum'_aycy of wild_aycz { __DEFAULT ->
                           loop_aycv wild_aycz
                           }))); } in
        loop_aycv b1_ayct)
       (foldMS
          @ b_aycn @ a34_ayco @ m_aycm $dMonad1_aycq f_aycs b1_ayct @ Void))

Change History (8)

comment:1 Changed 2 years ago by thomie

Status: newinfoneeded

I can't reproduce this.

I am assuming you are trying to run cabal install yaml with ghc-7.10.2. This worked for me, but I might have different versions of dependencies installed than you.

Can you give the exact command(s) you are running that will fail when run in a cabal sandbox, after temporarily renaming your .cabal/config file to something else.

Thanks.

comment:2 Changed 2 years ago by bgamari

Interesting but I have been unable to reproduce this locally. What version of yaml is this? Perhaps you could paste the output of cabal install -n -v3 yaml so we can document which dependencies are being pulled in here?

comment:3 Changed 2 years ago by simonpj

Milestone: 7.10.3
Status: infoneededmerge

I believe this is fixed by

commit bc4b64ca5b99bff6b3d5051b57cb2bc52bd4c841
Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Mon Jul 27 13:56:31 2015 +0100

    Do not inline or apply rules on LHS of rules
    
    This is the right thing to do anyway, and fixes Trac #10528

Trac #10665 is probably another example.

Perhaps merge to 7.10.3.

Meanwhile, can you confirm fixed in HEAD?

Simon

comment:4 Changed 2 years ago by nclarke

Milestone: 7.10.3

I got this on both 0.8.11 and 0.8.12, but I likewise have been unable to reproduce in a fresh sandbox. It happened consistently when building in one particular sandbox, and I'm surprised that the compiler was doing was being affected by this, but apparently it was.

comment:5 Changed 2 years ago by nclarke

Milestone: 7.10.3

comment:6 Changed 2 years ago by rwbarton

Do you still have the failing sandbox? If so can you try cabal build --ghc-option=-dppr-ticks? There are a few different kinds of ticks and knowing which kind it is might reveal what is special about your sandbox (e.g. profiling or HPC or debugging information is turned on).

comment:7 Changed 2 years ago by nclarke

I didn't have the sandbox, but this issue has reappeared, so I've been able to build with -dppr-ticks:

ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.2 for x86_64-unknown-linux):
        Tick in rule
  hpc<Data.Conduit.Internal.Fusion,76>
  hpc<Data.Conduit.Internal.Fusion,75>
  unstream
    @ a34_ay7l
    @ Void
    @ m_ay7j
    @ b_ay7k
    (ConduitWithStream
       @ a34_ay7l
       @ Void
       @ m_ay7j
       @ b_ay7k
       (let {
          $dApplicative_ay7r :: Applicative (ConduitM a34_ay7l Void m_ay7j)
          [LclId, Str=DmdType]
          $dApplicative_ay7r =
            $fApplicativeConduitM
              @ a34_ay7l
              @ Void
              @ m_ay7j
              ($fFunctorConduitM @ a34_ay7l @ Void @ m_ay7j) } in
        letrec {
          loop_ay7s :: b_ay7k -> ConduitM a34_ay7l Void m_ay7j b_ay7k
          [LclId, Arity=1, Str=DmdType]
          loop_ay7s =
            \ (accum_ay7t :: b_ay7k) ->
              hpc<Data.Conduit.List,584>
              hpc<Data.Conduit.List,583>
              hpc<Data.Conduit.List,582>
              $fMonadConduitM_$c>>=
                @ a34_ay7l
                @ Void
                @ m_ay7j
                $dApplicative_ay7r
                @ (Maybe a34_ay7l)
                @ b_ay7k
                ((hpc<Data.Conduit.List,577>
                  await @ a34_ay7l @ m_ay7j $dMonad1_ay7n)
                   @ Void)
                (hpc<Data.Conduit.List,581>
                 maybe
                   @ (ConduitM a34_ay7l Void m_ay7j b_ay7k)
                   @ a34_ay7l
                   (hpc<Data.Conduit.List,579>
                    $fMonadConduitM_$creturn
                      @ a34_ay7l
                      @ Void
                      @ m_ay7j
                      $dApplicative_ay7r
                      @ b_ay7k
                      (hpc<Data.Conduit.List,578> accum_ay7t))
                   (hpc<Data.Conduit.List,580>
                    \ (a35_ay7u :: a34_ay7l) ->
                      hpc<Data.Conduit.List,576>
                      hpc<Data.Conduit.List,575>
                      $fMonadConduitM_$c>>=
                        @ a34_ay7l
                        @ Void
                        @ m_ay7j
                        $dApplicative_ay7r
                        @ b_ay7k
                        @ b_ay7k
                        (hpc<Data.Conduit.List,570>
                         $ @ (m_ay7j b_ay7k)
                           @ (ConduitM a34_ay7l Void m_ay7j b_ay7k)
                           (hpc<Data.Conduit.List,566>
                            $fMonadBasebaseConduitM_$clift
                              @ a34_ay7l @ Void @ m_ay7j @ b_ay7k $dMonad1_ay7n)
                           (hpc<Data.Conduit.List,569>
                            f_ay7p
                              (hpc<Data.Conduit.List,567> accum_ay7t)
                              (hpc<Data.Conduit.List,568> a35_ay7u)))
                        (\ (accum'_ay7v :: b_ay7k) ->
                           hpc<Data.Conduit.List,574>
                           hpc<Data.Conduit.List,571>
                           case accum'_ay7v of wild_ay7w { __DEFAULT ->
                           hpc<Data.Conduit.List,573>
                           loop_ay7s (hpc<Data.Conduit.List,572> wild_ay7w)
                           }))); } in
        hpc<Data.Conduit.List,586>
        hpc<Data.Conduit.List,585> loop_ay7s b1_ay7q)
       (foldMS
          @ b_ay7k @ a34_ay7l @ m_ay7j $dMonad1_ay7n f_ay7p b1_ay7q @ Void))

comment:8 Changed 2 years ago by bgamari

Resolution: fixed
Status: mergeclosed

The patch referenced by simonpj in comment:3 has been merged to ghc-7.10 as db85cbc689b50b52b08ae6326b51ff5d6f50932e. Closing. Reopen if you find this still occurs with the to-be-released 7.10.3.

Note: See TracTickets for help on using tickets.