Skip to content
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

Catch OSX sonoma iconv issue #218

Merged
merged 4 commits into from
Feb 12, 2024

Conversation

Flamefire
Copy link
Collaborator

@Flamefire Flamefire commented Feb 8, 2024

E2BIG shall be returned if the output buffer is too small.
We pass a 64 byte buffer which should be enough to do something

However it is observed on MacOS Sonoma that iconv returns E2BIG without
doing any progress leading to an infinite loop as the same inputs will
be passed over and over.
Instead raise an exception when this case is detected.

Closes #206

E2BIG shall be returned if the output buffer is too small.
We pass a 64 byte buffer which should be enough to do *something*

However it is observed on MacOS Sonoma that iconv returns E2BIG without
doing any progress leading to an infinite loop as the same inputs will
be passed over and over.
See boostorg#206.
Instead raise an exception when this case is detected.
@boostorg boostorg deleted a comment from codecov bot Feb 11, 2024
Copy link

codecov bot commented Feb 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7da8ce3) 95.72% compared to head (5f2a828) 95.72%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #218   +/-   ##
========================================
  Coverage    95.72%   95.72%           
========================================
  Files          116      116           
  Lines         9930     9937    +7     
========================================
+ Hits          9505     9512    +7     
  Misses         425      425           
Files Coverage Δ
src/boost/locale/encoding/iconv_converter.hpp 94.64% <100.00%> (ø)
test/test_encoding.cpp 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7da8ce3...5f2a828. Read the comment docs.

Iconv still fails to behave correctly:

- Testing correct invalid bytes skipping
-- UTF-8
--- At start single
----- [IConv]
--- At start multiple
----- [IConv]
--- At middle single
Error in line 167: to_utf<Char>(source, encoding) == target
---- [g] != [grU+00FCU+00DFen]
Error in line 77: conv(source) == target
---- [g] != [grU+00FCU+00DFen]
----- [IConv]
Error in line 85: convPtr->convert(source) == target
---- [g] != [grU+00FCU+00DFen]

and:

-- Error for decoding to UTF-8
Error in line 188: from_utf<Char>(source, encoding) == target
---- [gr�����üßen] != [grüßen]
@Flamefire Flamefire merged commit 299381b into boostorg:develop Feb 12, 2024
48 checks passed
@Flamefire Flamefire deleted the catch_osx-sonoma-iconv-issue branch February 12, 2024 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

locale::conv::from_utf freezing on macOS14 and iOS17 because iconv library
1 participant