Ticket #116 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

control characters in prompt lead to deadlock on 64 bit system

Reported by: phercek Owned by:
Priority: critical Milestone:
Version: 0.6 Keywords:


The problem seems to be in wcwidth foreign call where the result type was Int instead of CInt. This led to Int32/Int64 mismatch which later caused a deadlock or something like that.

I'm attaching a patch.


wcwidth.patch (3.6 kB) - added by phercek 6 years ago.
the fix of the bug

Change History

Changed 6 years ago by phercek

the fix of the bug

Changed 6 years ago by judah

Thanks for the patch! I've applied it to the repo at http://code.haskell.org/haskeline and released haskeline- which contains the fix for it.

For my future record: wcwidth is supposed to return -1 for the width of escape characters, which we handle as a separate case. But due to the 32/64-bit mismatch, it returned a very large size for their width. This caused an infinite loop in the line-breaking algorithm for wide characters.

Changed 6 years ago by judah

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.