gchp / iota

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

Illegal instruction (core dumped) #93

Closed yeahnoob closed 9 years ago

yeahnoob commented 9 years ago

After $cargo build, run & get this error. How deal with it?

$ ./target/iota
Illegal instruction (core dumped)

PS. Ubuntu 14.04 LTS x64; Nightly Build's rustc and cargo.

utkarshkukreti commented 9 years ago

Same here on OSX 10.9.5.

$ target/iota
[1]    97292 illegal hardware instruction  target/iota
gchp commented 9 years ago

Yeah, same for me. Investigating now

gchp commented 9 years ago

Seems to be coming from this https://github.com/gchp/iota/blob/master/src/main.rs#L53-L56

I wonder if this has to do with some changes in http://github.com/nsf/termbox that landed yesterday. Rustbox relies on this, so it could be that some of those changes have messed things up for us.

utkarshkukreti commented 9 years ago

Two fields were added tb_event struct.. maybe that?

suhr commented 9 years ago

Calling tb_select_input_mode before tb_init. tb_select_input_mode calls bytebuffer_puts and bytebuffer_flush, but buffers are not initialized before tb_init is called.

PS: use rust-gdb, it rocks.

pythonesque commented 9 years ago

Heh, I had actually pointed this out earlier after your commit, but at the time it wasn't causing any issues so it wasn't urgent.

https://github.com/gchp/rustbox/commit/7707700389af9d522833b3068dd2260930d89cdf

In the future we should probably be more proactive about potential future incompatibilities like that. It's kinda hard to know which ones are going to end up being important.

crespyl commented 9 years ago

I was having trouble replicating the problem until I updated the rustc nightly. It was only ~1 day old, but with the compiler update I now get the illegal instruction. It looks like this is one of those cases where it probably should never have worked in the first place.

gchp commented 9 years ago

Yup, @suhr and @pythonesque were right!

I've update released rustbox 0.2.14 which fixed this. Should be good to go!