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

[libiconv]: return values in debug builds broken - errno is not set #44698

Open
GitMensch opened this issue Mar 30, 2025 · 3 comments
Open

[libiconv]: return values in debug builds broken - errno is not set #44698

GitMensch opened this issue Mar 30, 2025 · 3 comments
Assignees
Labels
category:question This issue is a question

Comments

@GitMensch
Copy link
Contributor

Describe the bug
As seen in this CI build https://github.com/OCamlPro/gnucobol/actions/runs/14155403038/job/39653980903 the first call to iconv with something that cannot be converted after a series of "valid" conversions returns -1, which is fine.
But really bad is that errno is not set (it is zero).
According to both the posix specification and the Linux manpage, errno is always set if the return value is -1.

Environment

  • OS: [e.g. Windows/Linux etc...] Windows (GitHub CI " windows-latest")
  • Compiler: revision MSVC 14.43.34808

To Reproduce
Steps to reproduce the behavior:
Follow the workflow at https://github.com/OCamlPro/gnucobol/actions/runs/14155403038/workflow.
Or just call iconv_open("IBM500","ASCII"), then iconv()` with a source size of 1 and source of 0x00 0x01 0x02 0x03 0x04 - as expected the last one gets a return value of -1, but errno is not set.

Expected behavior
Debug and Release should both behave according to docs and set the same error into errno.

@LilyWangLL
Copy link
Contributor

This is an upstream issue. vcpkg is a package management platform, and issues related to the actual behavior of the code need to be resolved upstream.

@GitMensch
Copy link
Contributor Author

... but that happens only with the vcpkg configured debug build for MSVC ?!?

@GitMensch
Copy link
Contributor Author

https://stackoverflow.com/questions/22708605/libiconv-on-windows-linux-issue assumes this is related to a mixture of debug and release dll's - but "libiconv:x64-windows" when building a debug target should pick up the debug dll as well, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

2 participants