Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when decoding long and chunked input #2

Closed
msakai opened this issue May 7, 2021 · 1 comment · Fixed by #3
Closed

Segmentation fault when decoding long and chunked input #2

msakai opened this issue May 7, 2021 · 1 comment · Fixed by #3

Comments

@msakai
Copy link
Owner

msakai commented May 7, 2021

I'm investigating msakai/toysolver#60 and found that the following program causes Segmentation fault:

import Control.DeepSeq
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.Lazy.Encoding as Enc

main :: IO ()
main = do
  let ls = [32752, 32752, 32752, 32752, 32752, 32752, 32752, 32752, 32752, 18193]
      bs = BL.fromChunks [B.pack (replicate l (fromIntegral (fromEnum 'a'))) | l <- ls]
  let t = Enc.decode Enc.utf8 bs
  deepseq t $ return ()
@msakai
Copy link
Owner Author

msakai commented May 8, 2021

I uploaded version 0.1.1.0 with this fix to Hackage.

msakai added a commit to msakai/toysolver that referenced this issue May 8, 2021
Becasue bytestring-encoding-0.1.0.0 has a memory corruption bug.
msakai/bytestring-encoding#2
msakai/bytestring-encoding#3
msakai added a commit to msakai/toysolver that referenced this issue May 8, 2021
Because bytestring-encoding-0.1.0.0 has a memory corruption bug.
msakai/bytestring-encoding#2
msakai/bytestring-encoding#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant