gchp / iota

A terminal-based text editor written in Rust
MIT License
1.63k stars 81 forks source link

illegal hardware instruction on text input #94

Closed suhr closed 9 years ago

suhr commented 9 years ago

OS: Linux x86_64

Looks like it's caused by termbox::tb_poll_event() call in RustBox::poll_event() method (crate rustbox), but I have no idea why.

gchp commented 9 years ago

Can you give a little more info on how to reproduce this? I'm able to insert text in Linux without issue. Also what version of rustc?

suhr commented 9 years ago

rustc 1.0.0-dev (b6d91a2bd 2015-02-15 07:53:07 +0000)

Can you give a little more info on how to reproduce this?

  1. Run iota
  2. Press any key

Appears on a release version, a debug one works fine.

gchp commented 9 years ago

@suhr, ok, I'm seeing the problem now with the release version. Will look into it!

gchp commented 9 years ago

So this was caused from an update to termbox which added two extra fields to its event struct. rustbox uses a wrapper around the termbox API called termbox-sys which has a struct called RawEvent which is a mapping to the termbox event struct. RawEvent was missing the two new fields which were added to termbox, and it seems like adding them has fixed this.

Not sure why this was only showing in release builds, though.

Let me know if this has resolved it for you!

suhr commented 9 years ago

Yes, this have fixed an issue.