-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with some responses #5
Comments
I was able to prevent this crash by setting |
Can you paste a UTF-8 binary that doesn’t work for me to try out? I do use Rambo to print fancy characters daily without issues. |
Hi, I just tried to run the command with the same input again and couldn't reproduce it on MacOS. It happened in the production environment where we are running it as an Elixir Release (Version 1.10) and Alpine Linux. I'll try to reproduce it in that environment. |
I think I'm experiencing the same thing, the command I'm running prints some borders among other characters... While this hasn't been an issue using Given this example I lifted out of some tests I was messing with:
For the context of the command I'm running, I know that specific log line is too short... I've also managed to at least kinda prove this theory by jamming some {^port, {:data, @stdout <> stdout}} ->
IO.inspect(stdout, label: "stdout") <---
maybe_log(:stdout, stdout, log)
result = Map.update(result, :out, [], &[&1 | stdout])
receive_result(port, result, log)
So you can see above, in the lines that are 'complete' or convertable in one go print just fine - but the lines with characters that require more than one item in the binary. (But if you don't jam a label or some other output inbetween - everything looks fine) Long story short - I don't think this is actually a bug, as much as it is a painful reality of UTF-8 and buffers... |
Thanks for the detailed investigations! Here’s how I reproduced it. iex> Rambo.run("echo", [String.duplicate(".", 64) <> "💣"], log: :stdout)
................................................................💣
iex> Rambo.run("echo", [String.duplicate(".", 63) <> "💣"], log: :stdout)
** (ArgumentError) argument error
(stdlib 3.13.2) :io.put_chars(:standard_io, :unicode, <<46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, ...>>)
(rambo 0.3.3) lib/rambo.ex:250: Rambo.receive_result/3
(rambo 0.3.3) lib/rambo.ex:176: Rambo.run/3 So Rambo streams exactly what your program outputs, it’s not UTF-8 aware or anything. On my machine, In our app using Rambo, I do send logs off to a GenServer that buffers before display and we never had issues. Rambo’s default However |
@jayjun thats awesome! Thanks for confirming! I mean - the naive log implementation makes sense to me in this case. And like beefing it up is imo is out of scope for Rambo no (or at least the current Using a GenServer call is exactly what I'm doing as well. What would your advice for buffering these log line messages to in an attempt to make them readable? |
Hi, I found the following issue in my log. Any idea how this can be solved? After googling I think it has to do with my program returning some utf-8 chars?
The text was updated successfully, but these errors were encountered: