Ticket #116 (closed defect: fixed)

Opened 19 months ago

Last modified 19 months ago

control characters in prompt lead to deadlock on 64 bit system

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

Description

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.

Attachments

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

Change History

Changed 19 months ago by phercek

the fix of the bug

Changed 19 months ago by judah

Thanks for the patch! I've applied it to the repo at http://code.haskell.org/haskeline and released haskeline-0.6.4.5 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 19 months ago by judah

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