kaitai-io / kaitai_struct_visualizer

Kaitai Struct: visualizer and hex viewer tool
https://rubygems.org/gems/kaitai-struct-visualizer
GNU General Public License v3.0
284 stars 25 forks source link

Open3.popen3 deadlocks in case of too much output to std*. #27

Closed ams-tschoening closed 5 years ago

ams-tschoening commented 5 years ago

In the past, "ksv" didn't start properly and hanged sometimes, making it necessary to restart the app a few times to get things working. Now this didn't help anymore and the reason was too many debugging output generated by "ksc" because of some forgotten "println"-statements. The official docs suggest that on too many data especially on STDERR things deadlock unless pipes are read in parallel and that capture3 should be used instead.

As the former implementation simply blocked as well, there shouldn't be any downside to switching to capture3. This solved the hanging app for me and printed a JSON parse error, which made me recognize the forgotten "println".

https://www.rubydoc.info/stdlib/open3/Open3#popen3-class_method

GreyCat commented 5 years ago

Yet again — thanks for in-depth explanation and this investigation!