Comments (14)
I can reproduce the problem with a simple .c
source with deeply nested parentheses:
enum E { X = ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+
1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1) };
from castxml.
On Windows, running just castxml input.c
, where input.c
contains the deeply nested parentheses mentioned above, is enough to cause the problem.
On Linux, the same call fails with an error "fatal error: bracket nesting level exceeded maximum of 256", but it can be overcome with -fbracket-depth=500
. Adding that option on Windows makes no difference.
from castxml.
Please strip xbd_win.h
down to a minimal complete example input file that demonstrates the problem.
from castxml.
I do not see -fbracket-depth
option in help. As you mentioned, in windows it makes no difference using it or not.
Should I report to llvm as asked in the error message below?
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: castxml.exe --castxml-gccxml -o output.xml --castxml-cc-msvc-c cl .\\input.c -fbracket-depth=1000
1. .\input.c:1:194: current parser token '('
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: castxml.exe --castxml-gccxml -o output.xml --castxml-cc-msvc-c cl .\\input.c
1. .\input.c:1:194: current parser token '('
from castxml.
We need to try building CastXML with the latest LLVM version before reporting it there.
from castxml.
I already raised it (link) there, and they suggested:
Could you please try 15 or main branch? https://godbolt.org/ should be helpful.
I will build using the main and test again.
from castxml.
Thanks. I think CastXML may need some updates to compile against LLVM/Clang 14 and/or 15. I'll look at that.
from castxml.
I appreciate your support.
from castxml.
CastXML builds cleanly against LLVM/Clang 14.0. However, the LLVM/Clang release/15.x
branch currently has a regression that breaks CastXML. I've reported that as llvm/llvm-project#57483.
from castxml.
After hacking the LLVM/Clang 15.x install tree with this patch:
--- include/clang/Lex/Preprocessor.h.orig 2022-08-31 09:24:20.359922800 -0400
+++ include/clang/Lex/Preprocessor.h 2022-08-31 11:55:51.490578400 -0400
@@ -1353,6 +1353,8 @@
StringRef getLastMacroWithSpelling(SourceLocation Loc,
ArrayRef<TokenValue> Tokens) const;
+ const std::string &getPredefines() const { return Predefines; }
+
/// Set the predefines for this Preprocessor.
///
/// These predefines are automatically injected when parsing the main file.
then CastXML builds again and all tests pass.
However, the crash discussed here remains. I've got a Debug build, so I'll try to get a backtrace.
from castxml.
Clang's internal recursion overflows the stack before reaching the default -fbracket-depth=256
nesting level limit. I've posted more details in llvm/llvm-project#57456 (comment).
from castxml.
The problem doesn't occur in LLVM/Clang's own binaries because they are built with a larger stack: llvm/llvm-project#57456 (comment).
CastXML should be built with a larger stack too.
from castxml.
I've released CastXML 0.4.6 with this fix.
from castxml.
Thank you, I'll check it.
Much appreciated!
from castxml.
Related Issues (20)
- How to generate xml description for C++14 file HOT 1
- generate xml description for C++ header file HOT 1
- llvm/clang 14 reports using clauses separately HOT 8
- Trying to run CastXML on C++ project HOT 2
- arm64v8 rounding intrinsics not activated under --castxml-cc-gnu g++ HOT 1
- Help: Can I get access to default member initializer? HOT 5
- Wrapping ITK modules for ARM architecture fails at CastXML step HOT 3
- 0.5 release series for post-0.4 features HOT 7
- CastXML 0.5.0 tests fail on 32-bit architectures HOT 4
- Tests are failing with LLVM/CLANG-15 HOT 1
- CastXML tests fail with LLVM/Clang 16
- Skipping methods containing rvalue reference parameters HOT 2
- Generating unnecessary syntax HOT 1
- 0.6.0: Many tests fail HOT 2
- Different behaviour on linux and windows HOT 3
- gcc-13.2.0 unknown type name '_Float32' HOT 9
- Building against LLVM/Clang 18.x fails using MSVC
- arm64 ubuntu make failed. cannot find -ltinfo: No such file or directory HOT 2
- GCC 13 vector header include
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from castxml.