haskell / haddock

Haskell Documentation Tool
www.haskell.org/haddock/
BSD 2-Clause "Simplified" License
361 stars 241 forks source link

Ill-formed tables cause haddock to crash #1187

Open thufschmitt opened 4 years ago

thufschmitt commented 4 years ago

Some ill-formed tables in haddock markup cause haddock to crash with

Haddock coverage:
haddock: internal error: Data.Text.Internal.Fusion.Common.index: Index too large
CallStack (from HasCallStack):
  error, called at libraries/text/Data/Text/Internal/Fusion/Common.hs:943:24 in text-1.2.4.0:Data.Text.Internal.Fusion.Common

For example, the following file cause this crash:

module Test where

-- |
-- +-------+-----+
-- | a     | b   |
-- +=======+====+
foo :: Int
foo = 1

I can exhibit this with haddock 2.23.0 (ghc 8.8.3). haddock 2.22.0 (with ghc 8.6.5) doesn't crash but outputs garbage instead of the table

harpocrates commented 4 years ago

Thank you for the bug report. This is pretty serious!