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

panic: Could not find CTypeId(10630) in TypedAstContext #1131

Open
ForsakenHarmony opened this issue Sep 20, 2024 · 0 comments
Open

panic: Could not find CTypeId(10630) in TypedAstContext #1131

ForsakenHarmony opened this issue Sep 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ForsakenHarmony
Copy link

Trying to transpile libfreefare on macOS.

Setup

autoreconf -vis
./configure
intercept-build --override-compiler make CC=intercept-cc CXX=intercept-c++ all
c2rust transpile --emit-build-files compile_commands.json --output-dir rust

Error Log

Transpiling felica-read-ndef.c
warning: Missing type 5445734081 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 229, begin_column: 38, end_line: 229, end_column: 38 }, type_id: Some(5445734081), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamPropertySOCKSPassword"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:229:38
 [-Wclang-ast]
warning: Missing type 5445734833 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 252, begin_column: 38, end_line: 252, end_column: 38 }, type_id: Some(5445734833), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamPropertySocketSecurityLevel"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:252:38
 [-Wclang-ast]
warning: Missing type 5445737025 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 307, begin_column: 38, end_line: 307, end_column: 38 }, type_id: Some(5445737025), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamSocketSecurityLevelNegotiatedSSL"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:307:38
 [-Wclang-ast]
warning: Missing type 5445732785 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 191, begin_column: 38, end_line: 191, end_column: 38 }, type_id: Some(5445732785), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamSocketSOCKSVersion4"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:191:38
 [-Wclang-ast]
warning: Missing type 5445732353 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 181, begin_column: 38, end_line: 181, end_column: 38 }, type_id: Some(5445732353), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamPropertySOCKSVersion"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:181:38
 [-Wclang-ast]
warning: Missing type 5445723281 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 155, begin_column: 38, end_line: 155, end_column: 38 }, type_id: Some(5445723281), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamPropertySOCKSProxyHost"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:155:38
 [-Wclang-ast]
warning: Missing type 5445723713 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 168, begin_column: 38, end_line: 168, end_column: 38 }, type_id: Some(5445723713), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamPropertySOCKSProxyPort"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:168:38
 [-Wclang-ast]
warning: Missing type 5445737457 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 325, begin_column: 38, end_line: 325, end_column: 38 }, type_id: Some(5445737457), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamPropertyShouldCloseNativeSocket"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:325:38
 [-Wclang-ast]
warning: Missing type 5445735713 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 274, begin_column: 38, end_line: 274, end_column: 38 }, type_id: Some(5445735713), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamSocketSecurityLevelSSLv2"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:274:38
 [-Wclang-ast]
warning: Missing type 5445735265 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 262, begin_column: 38, end_line: 262, end_column: 38 }, type_id: Some(5445735265), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamSocketSecurityLevelNone"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:262:38
 [-Wclang-ast]
warning: Missing type 5445736593 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 296, begin_column: 38, end_line: 296, end_column: 38 }, type_id: Some(5445736593), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamSocketSecurityLevelTLSv1"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:296:38
 [-Wclang-ast]
warning: Missing type 5445733217 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 201, begin_column: 38, end_line: 201, end_column: 38 }, type_id: Some(5445733217), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamSocketSOCKSVersion5"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:201:38
 [-Wclang-ast]
warning: Missing type 5445733649 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 215, begin_column: 38, end_line: 215, end_column: 38 }, type_id: Some(5445733649), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamPropertySOCKSUser"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:215:38
 [-Wclang-ast]
warning: Missing type 5445722849 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 143, begin_column: 38, end_line: 143, end_column: 38 }, type_id: Some(5445722849), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamPropertySOCKSProxy"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:143:38
 [-Wclang-ast]
warning: Missing type 5445736161 for node: AstNode { tag: TagVarDecl, children: [], loc: SrcSpan { fileid: 149, begin_line: 286, begin_column: 38, end_line: 286, end_column: 38 }, type_id: Some(5445736161), rvalue: LValue, macro_expansions: [], macro_expansion_text: None, extras: [Text("kCFStreamSocketSecurityLevelSSLv3"), Bool(true), Bool(false), Bool(true), Bool(false), Array([Text("availability")])] }
Exported Clang AST was invalid. Check warnings above for unimplemented features.
--> /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:286:38
 [-Wclang-ast]
thread 'main' panicked at c2rust-transpile/src/c_ast/mod.rs:265:30:
Could not find CTypeId(10630) in TypedAstContext
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <c2rust_transpile::c_ast::TypedAstContext as core::ops::index::Index<c2rust_transpile::c_ast::CTypeId>>::index
   3: c2rust_transpile::c_ast::TypedAstContext::get_src_loc
   4: <c2rust_transpile::translator::comments::CommentLocator as c2rust_transpile::c_ast::iterators::NodeVisitor>::pre
   5: c2rust_transpile::c_ast::iterators::NodeVisitor::visit_tree
   6: c2rust_transpile::translator::comments::<impl c2rust_transpile::translator::Translation>::locate_comments
   7: c2rust_transpile::translator::translate
   8: c2rust_transpile::transpile_single
   9: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
  10: c2rust_transpile::transpile
  11: c2rust_transpile::main
@kkysen kkysen added the bug Something isn't working label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants