-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
crash while using parse with non-utf-8 data from file #2476
Comments
It is fine on macOS as well :/ |
When checking the script, the difference between using data directly and from file is, that when using the file without Now just find out, why it crashes on OpenBSD and not elsewhere. (Will try it on Windows later) |
It's OK also on FreeBSD and Windows... so the crash is only on OpenBSD. |
OpenBSD could be very sensitive to bugs and lot of code is made to make the program crashes if it tries to do something it shouldn't. With your tip about The macro is defined as |
For testing purpose, the following diff should make any OS to abort(3) on array out-of-bound read.
I will continue to look at it tomorrow. |
You are right... the 65533 value is Btw... good tip is, that when compiled with |
Test can be simplified to just: parse to-string #{A032} [to ["2"]]
; or
parse to-string #{A032} [to [#"2"]]
; or
parse to-string #{A032} [thru ["2"]]
; and also
f: to-string #{A0} parse "a" [to [f]]
; and
parse to-string #{A0} [#"a"]
; or
c: to char! 65533 parse "a" [c]
; or
parse [#"a"][c]
; and also not parse related:
equal? [#"a"] reduce [c] Everywhere, where is used |
Question is, if such a conversion should be allowed. For example in Red it is not: >> to-string #{A032}
*** Access Error: invalid UTF-8 encoding: #{A0322D6E} Especially when it is possible to get correct chars using >> iconv #{31A032} 'iso-8859-1
== "1 2" |
Classic |
It should be fixed in the commit above. Better to have all the checks, because even in Red, one can construct such a strings using methods like: >> append "a" to-char 65533
== "a�" |
yes, the commit fix it. Personally, I would have change |
The following script makes rebol3 binary to crash on OpenBSD (it is fine on Linux where I also tested).
If I correctly isolated the problem, it is related to the input, which contains insecable space in number as mille separator (
1 917,00
) in iso-8859-1 (or some windows) encoding, and to the fact that afile!
is used (directly usingdata
doesn't make rebol3 crash).I made a self contained example with downloading of
csv-tools.r
script from rebol.org, andtest.csv
file creation on the fly.The output is the following:
The gdb backtrace is the following:
The text was updated successfully, but these errors were encountered: