Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[llvm] Fixed Demangle OutputBuffer #138564

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

Merged
merged 1 commit into from
May 5, 2025
Merged

Conversation

slydiman
Copy link
Contributor

@slydiman slydiman commented May 5, 2025

The llvm-clang-x86_64-expensive-checks-win buildbot has been broken by #133249.
DemangleTests causes the exception 0x80000003 inside CRT in case of the debug build on Windows.

The [llvm-clang-x86_64-expensive-checks-win](https://lab.llvm.org/buildbot/#/builders/14/builds/3075) buildbot has been broken by llvm#133249.
DemangleTests causes the exception 0x80000003 inside CRT in case of the debug build on Windows.
@slydiman slydiman added the llvm Umbrella label for LLVM issues label May 5, 2025
@slydiman slydiman requested review from Michael137 and zygoloid May 5, 2025 18:36
Copy link
Collaborator

@zygoloid zygoloid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. I guess the problem was that we were passing memcpy the pointer &*R.begin(), which might be null if the string_view is empty?

@slydiman
Copy link
Contributor Author

slydiman commented May 5, 2025

I guess the problem was that we were passing memcpy the pointer &*R.begin(), which might be null if the string_view is empty?

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xstring

template <class _Traits>
class _String_view_iterator {
public:
    _NODISCARD constexpr reference operator*() const noexcept {
#if _ITERATOR_DEBUG_LEVEL >= 1
        _STL_VERIFY(_Mydata, "cannot dereference value-initialized string_view iterator");
        _STL_VERIFY(_Myoff < _Mysize, "cannot dereference end string_view iterator");  // <<< EXCEPTION HERE
        return _Mydata[_Myoff];
#else // ^^^ _ITERATOR_DEBUG_LEVEL >= 1 / _ITERATOR_DEBUG_LEVEL == 0 vvv
        return *_Myptr;
#endif // ^^^ _ITERATOR_DEBUG_LEVEL == 0 ^^^
    }

@slydiman slydiman merged commit 46f5852 into llvm:main May 5, 2025
11 of 12 checks passed
@Michael137
Copy link
Member

Michael137 commented May 5, 2025

Ah this was failing in the new test I added. I guess we never previously called prepend with an empty string_view in our demangling test-suite. Are we sure we want to now support that use-case (as opposed to removing the problematic test)? . If so, we also need to make the change on the libcxxabi side

@slydiman
Copy link
Contributor Author

slydiman commented May 6, 2025

Ah this was failing in the new test I added. I guess we never previously called prepend with an empty string_view in our demangling test-suite. Are we sure we want to now support that use-case (as opposed to removing the problematic test)? . If so, we also need to make the change on the libcxxabi side

I think the size checking is useful. I will add it to libcxxabi.

slydiman added a commit to slydiman/llvm-project that referenced this pull request May 6, 2025
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this pull request May 7, 2025
The [llvm-clang-x86_64-expensive-checks-win](https://lab.llvm.org/buildbot/#/builders/14/builds/3075)
buildbot has been broken by llvm#133249.
DemangleTests causes the exception 0x80000003 inside CRT in case of the debug build on Windows.
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this pull request May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm Umbrella label for LLVM issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants