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 specifying invalid yaml as -style input crashes the yaml parser #16595

Closed
llvmbot opened this issue Jun 4, 2013 · 1 comment
Closed
Labels
bugzilla Issues migrated from bugzilla clang-format

Comments

@llvmbot
Copy link
Member

llvmbot commented Jun 4, 2013

Bugzilla Link 16221
Resolution FIXED
Resolved on Nov 18, 2013 09:51
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor

Extended Description

Built from svn revision 183220.

Reproduce + info:

[ola@ellen build]$ gdb ./Debug+Asserts/bin/clang-format
run -style="{BasedOnStyle:llvm}" ../tools/clang/tools/clang-format/ClangFormat.cpp
Starting program: /home/ola/src/llvm-trunk/build/Debug+Asserts/bin/clang-format -style="{BasedOnStyle:llvm}" ../tools/clang/tools/clang-format/ClangFormat.cpp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
YAML:1:14: error: Found unexpected ':' while scanning a plain scalar
{BasedOnStyle:llvm}
^
clang-format: /home/ola/src/llvm-trunk/include/llvm/Support/Casting.h:97: static bool llvm::isa_impl_cl<llvm::yaml::NullNode, const llvm::yaml::Node *>::doit(const From *) [To = llvm::yaml::NullNode, From = const llvm::yaml::Node *]: Assertion `Val && "isa<> used on a null pointer"' failed.

Program received signal SIGABRT, Aborted.
0x0000003b1c2328a5 in raise () from /lib64/libc.so.6
(gdb) bt
#​0 0x0000003b1c2328a5 in raise () from /lib64/libc.so.6
#​1 0x0000003b1c234085 in abort () from /lib64/libc.so.6
#​2 0x0000003b1c22ba1e in __assert_fail_base () from /lib64/libc.so.6
#​3 0x0000003b1c22bae0 in __assert_fail () from /lib64/libc.so.6
#​4 0x00000000011e6a3e in llvm::isa_impl_cl<llvm::yaml::NullNode, llvm::yaml::Node const*>::doit (Val=0x0) at /home/ola/src/llvm-trunk/include/llvm/Support/Casting.h:97
#​5 0x00000000011e69e8 in llvm::isa_impl_wrap<llvm::yaml::NullNode, llvm::yaml::Node const*, llvm::yaml::Node const*>::doit (Val=@0x7fffffffc840: 0x0) at /home/ola/src/llvm-trunk/include/llvm/Support/Casting.h:124
#​6 0x00000000011e69c2 in llvm::isa_impl_wrap<llvm::yaml::NullNode, llvm::yaml::Node* const, llvm::yaml::Node const*>::doit (Val=@0x7fffffffc8a0: 0x0) at /home/ola/src/llvm-trunk/include/llvm/Support/Casting.h:116
#​7 0x00000000011e2d55 in llvm::isa<llvm::yaml::NullNode, llvm::yaml::Node*> (Val=@0x7fffffffc8a0: 0x0) at /home/ola/src/llvm-trunk/include/llvm/Support/Casting.h:135
#​8 0x00000000011df568 in llvm::yaml::Input::setCurrentDocument (this=0x7fffffffc940) at /home/ola/src/llvm-trunk/lib/Support/YAMLTraits.cpp:69
#​9 0x00000000004128f9 in llvm::yaml::operator>>clang::format::FormatStyle (yin=..., docMap=...) at /home/ola/src/llvm-trunk/include/llvm/Support/YAMLTraits.h:959
#​10 0x0000000000411fee in clang::format::parseConfiguration (Text=..., Style=0x7fffffffd1a8) at /home/ola/src/llvm-trunk/tools/clang/lib/Format/Format.cpp:214
#​11 0x0000000000406389 in clang::format::getStyle (StyleName=..., FileName=...) at /home/ola/src/llvm-trunk/tools/clang/tools/clang-format/ClangFormat.cpp:107
Python Exception <class 'gdb.error'> No type named std::basic_string::_Rep.:
#​12 0x0000000000407926 in clang::format::format (FileName=) at /home/ola/src/llvm-trunk/tools/clang/tools/clang-format/ClangFormat.cpp:199
#​13 0x0000000000406f94 in main (argc=3, argv=0x7fffffffdea8) at /home/ola/src/llvm-trunk/tools/clang/tools/clang-format/ClangFormat.cpp:279

@llvmbot
Copy link
Member Author

llvmbot commented Nov 18, 2013

Fixed in r195016.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 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

1 participant