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

clang-format 13 crash with AlignArrayOfStructures: left #51268

Closed
AMDG2 opened this issue Sep 21, 2021 · 7 comments
Closed

clang-format 13 crash with AlignArrayOfStructures: left #51268

AMDG2 opened this issue Sep 21, 2021 · 7 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla clang-format

Comments

@AMDG2
Copy link

AMDG2 commented Sep 21, 2021

Bugzilla Link 51926
Resolution FIXED
Resolved on Oct 27, 2021 08:38
Version unspecified
OS Windows NT
Blocks #50580 #51489
CC @slacka,@tstellar
Fixed by commit(s) a36227c ec4829e

Extended Description

While checking out in advance clang-format 13 we found a crash when using the new AlignArrayOfStructures option.

Here is the minimal case to reproduce it:

AlignArrayOfStructures: Left
auto foo = Items{ Section{ 0, bar(), } };

And the backtrace:

Assertion failed: idx < size(), file C:\src\llvm_package_1300-rc3\llvm-project\llvm\include\llvm/ADT/SmallVector.h, line 281
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.      Program arguments: D:\\llvm\\13.0.0-rc3\\bin\\clang-format.exe clang-format-13-crash.cpp
 #&#8203;0 0x00007ff78fd924d6 (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0x324d6)
 #&#8203;1 0x00007ffcf3d61881 (C:\WINDOWS\System32\ucrtbase.dll+0x71881)
 #&#8203;2 0x00007ffcf3d62851 (C:\WINDOWS\System32\ucrtbase.dll+0x72851)
 #&#8203;3 0x00007ffcf3d6426e (C:\WINDOWS\System32\ucrtbase.dll+0x7426e)
 #&#8203;4 0x00007ffcf3d64165 (C:\WINDOWS\System32\ucrtbase.dll+0x74165)
 #&#8203;5 0x00007ffcf3d644f1 (C:\WINDOWS\System32\ucrtbase.dll+0x744f1)
 #&#8203;6 0x00007ff78fe39d6c (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0xd9d6c)
 #&#8203;7 0x00007ff78fe399c7 (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0xd99c7)
 #&#8203;8 0x00007ff78fe384b9 (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0xd84b9)
 #&#8203;9 0x00007ff78fe37b7e (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0xd7b7e)
#&#8203;10 0x00007ff78fe33c46 (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0xd3c46)
#&#8203;11 0x00007ff78fdf6ffe (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0x96ffe)
#&#8203;12 0x00007ff78fe0cf4c (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0xacf4c)
#&#8203;13 0x00007ff78fe030e4 (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0xa30e4)
#&#8203;14 0x00007ff78fdedd8f (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0x8dd8f)
#&#8203;15 0x00007ff78fdee6b9 (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0x8e6b9)
#&#8203;16 0x00007ff78fd636b2 (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0x36b2)
#&#8203;17 0x00007ff78fd62056 (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0x2056)
#&#8203;18 0x00007ff78ff10d34 (D:\llvm\13.0.0-rc3\bin\clang-format.exe+0x1b0d34)
#&#8203;19 0x00007ffcf5907034 (C:\WINDOWS\System32\KERNEL32.DLL+0x17034)
#&#8203;20 0x00007ffcf6622651 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x52651)
@AMDG2
Copy link
Author

AMDG2 commented Sep 21, 2021

assigned to @mydeveloperday

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 25, 2021

I have a review up that fixes this here

https://reviews.llvm.org/D110481

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 28, 2021

This should be resolved in the minimal case here but as the review makes clear there is still a bit of work here because it doesn't format all cases correctly. But at least the crash is resolved

@tstellar
Copy link
Collaborator

Hi MyDeveloperDay,

What is your opinion on backporting this?

https://reviews.llvm.org/rGa36227cb2b6a14fc30bfd303328d1d1abb632010

@mydeveloperday
Copy link
Contributor

Oh! that's an excellent idea, I hadn't seen the fix go by.

@tstellar
Copy link
Collaborator

Merged: ec4829e

@tstellar
Copy link
Collaborator

mentioned in issue #51489

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-format
Projects
None yet
Development

No branches or pull requests

4 participants