Closed josephcsible closed 1 year ago
Merged! Thank you!
I get strange behaviour now. Sometimes when I use stack run
I get the correct result, sometimes I get the error ...-exe: fd:56: hFlush: resource vanished (Broken pipe)
I am unsure if this is related
The underlying cause of both the Data.ByteString.Lazy.head: empty ByteString
error and your new error appear to be the same, namely that radare2 is exiting when your pipe code expects it to still be running. So it's not that this change caused that problem, but rather it fixed an earlier crash that allowed the second to become visible.
Uhm. Is r2 crashing?
I assume it must be, it only seems to happen when I call it through the Haskell r2-pipe code in a compiled binary. It does not happen if I call main
from the Haskell interpreter. My original stack overflow question was essentially "How come it's different through ghc compared to ghci", so perhaps there is some quirk I don't understand with how Haskell runs processes
Is this latest r2 from git? Do you have a backtrace/crashlog/reproducer? Maybe you can attach a debugger before the crash happens.
Afaik you are spawning r2 from haskell and then using pipes right?
Checklist
Description
See the Stack Overflow question Different behavior in GHCI and GHC (Running radare2 pipe) for context. When the real
takeWhile
runs out of elements, it stops gracefully the same as if it found an element that didn't match its predicate. This change makes us do the same thing, instead of crashing.