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

[DebugInfo] Fix debug info round tripping of types inside functions #78328

Merged
merged 2 commits into from
Dec 21, 2024

Conversation

augusto2112
Copy link
Contributor

Types with @_originallyDefinedIn cannot be round tripped,

Types declared inside functions have their mangling affected by the function signature. If the generic signature mentions an @_originallyDefinedIn type, the type inside the function cannot be round tripped either.

This commit disables round tripping for this scenario.

@augusto2112
Copy link
Contributor Author

@swift-ci test

@hjyamauchi
Copy link
Contributor

hjyamauchi commented Dec 20, 2024

@augusto2112 It seems like I still locally get a crash with this PR. I will double-check.

Failed to reconstruct type for $s11SwiftFormat24DocumentationCommentTextV13extractedFromACSg08CompilerA6Syntax6TriviaV_tcfc4LineL_VD
Original type:
(struct_type decl="SwiftFormat.(file).DocumentationCommentText.init(extractedFrom:).Line@S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\DocumentationCommentText.swift:56:12")
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Pass '-Xfrontend -disable-round-trip-debug-types' to disable this assertion.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.      Program arguments: C:\\Users\\hiroshi\\source\\b\\5\\bin\\swiftc.exe -frontend -c S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\API\\Configuration+Default.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\API\\Configuration.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\API\\DebugOptions.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\API\\Finding.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\API\\FindingCategorizing.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\API\\Indent.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\API\\Selection.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\API\\SwiftFormatError.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\API\\SwiftFormatter.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\API\\SwiftLinter.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\Context.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\DocumentationComment.swift -primary-file S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\DocumentationCommentText.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\Finding+Convenience.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\FindingEmitter.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\FormatPipeline.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\FunctionDeclSyntax+Convenience.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\ImportsXCTestVisitor.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\LazySplitSequence.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\LintPipeline.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\ModifierListSyntax+Convenience.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\Parsing.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\Pipelines+Generated.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\RememberingIterator.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\Rule.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\RuleBasedFindingCategory.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\RuleMask.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\RuleNameCache+Generated.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\RuleRegistry+Generated.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\RuleState.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\SyntaxFormatRule.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\SyntaxLintRule.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\SyntaxProtocol+Convenience.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\Trivia+Convenience.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\WithAttributesSyntax+Convenience.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Core\\WithSemicolonSyntax.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\PrettyPrint\\Comment.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\PrettyPrint\\Indent+Length.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\PrettyPrint\\PrettyPrint.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\PrettyPrint\\PrettyPrintBuffer.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\PrettyPrint\\PrettyPrintFindingCategory.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\PrettyPrint\\Token.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\PrettyPrint\\TokenStreamCreator.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\PrettyPrint\\Verbatim.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\PrettyPrint\\WhitespaceFindingCategory.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\PrettyPrint\\WhitespaceLinter.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\AllPublicDeclarationsHaveDocumentation.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\AlwaysUseLiteralForEmptyCollectionInit.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\AlwaysUseLowerCamelCase.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\AmbiguousTrailingClosureOverload.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\AvoidRetroactiveConformances.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\BeginDocumentationCommentWithOneLineSummary.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\DoNotUseSemicolons.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\DontRepeatTypeInStaticProperties.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\FileScopedDeclarationPrivacy.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\FullyIndirectEnum.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\GroupNumericLiterals.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\IdentifiersMustBeASCII.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NeverForceUnwrap.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NeverUseForceTry.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NeverUseImplicitlyUnwrappedOptionals.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NoAccessLevelOnExtensionDeclaration.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NoAssignmentInExpressions.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NoBlockComments.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NoCasesWithOnlyFallthrough.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NoEmptyLineOpeningClosingBraces.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NoEmptyTrailingClosureParentheses.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NoLabelsInCasePatterns.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NoLeadingUnderscores.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NoParensAroundConditions.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NoPlaygroundLiterals.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\NoVoidReturnOnFunctionSignature.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\OmitExplicitReturns.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\OneCasePerLine.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\OneVariableDeclarationPerLine.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\OnlyOneTrailingClosureArgument.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\OrderedImports.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\ReplaceForEachWithForLoop.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\ReturnVoidInsteadOfEmptyTuple.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\TypeNamesShouldBeCapitalized.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\UseEarlyExits.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\UseExplicitNilCheckInConditions.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\UseLetInEveryBoundCaseVariable.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\UseShorthandTypeNames.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\UseSingleLinePropertyGetter.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\UseSynthesizedInitializer.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\UseTripleSlashForDocumentationComments.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\UseWhereClausesInForLoops.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Rules\\ValidateDocumentationComments.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Utilities\\FileIterator.swift S:\\SourceCache\\swift-format\\Sources\\SwiftFormat\\Utilities\\URL+isRoot.swift -emit-module-path Sources\\SwiftFormat\\CMakeFiles\\SwiftFormat.dir\\Core\\DocumentationCommentText.swift.swiftmodule -emit-module-doc-path Sources\\SwiftFormat\\CMakeFiles\\SwiftFormat.dir\\Core\\DocumentationCommentText.swift.swiftdoc -emit-module-source-info-path Sources\\SwiftFormat\\CMakeFiles\\SwiftFormat.dir\\Core\\DocumentationCommentText.swift.swiftsourceinfo -emit-dependencies-path Sources\\SwiftFormat\\CMakeFiles\\SwiftFormat.dir\\Core\\DocumentationCommentText.swift.obj.d -target x86_64-unknown-windows-msvc -disable-objc-interop -sdk "S:/Program Files/Swift/Platforms/Windows.platform/Developer/SDKs/Windows.sdk" -I S:\\b\\23\\swift -I S:\\SourceCache\\swift-markdown\\Sources\\CAtomic\\include -I S:\\b\\5\\.\\lib\\swift\\host -I "S:\\Program Files\\Swift\\Toolchains\\0.0.0+Asserts\\usr\\include\\cmark_gfm" -I "S:\\Program Files\\Swift\\Toolchains\\0.0.0+Asserts\\usr\\include\\cmark_gfm_extensions" -g -module-link-name SwiftFormat -O -D SwiftFormat_EXPORTS -in-process-plugin-server-path C:\\Users\\hiroshi\\source\\b\\5\\bin\\SwiftInProcPluginServer.dll -plugin-path C:\\Users\\hiroshi\\source\\b\\5\\bin -autolink-library oldnames -autolink-library msvcrt -Xcc -D_MT -Xcc -D_DLL -parse-as-library -module-name SwiftFormat -num-threads 32 -o Sources\\SwiftFormat\\CMakeFiles\\SwiftFormat.dir\\Core\\DocumentationCommentText.swift.obj
1.      Swift version 6.2-dev (LLVM aed73c6d65289c8, Swift ae88aaca8f76c02)
2.      Compiling with effective version 5.10
3.      While evaluating request IRGenRequest(IR Generation for file "S:\SourceCache\swift-format\Sources\SwiftFormat\Core\DocumentationCommentText.swift")
4.      While emitting IR SIL function "@$s11SwiftFormat24DocumentationCommentTextV13extractedFromACSg08CompilerA6Syntax6TriviaV_tcfC".
 for 'init(extractedFrom:)' (at S:\SourceCache\swift-format\Sources\SwiftFormat\Core\DocumentationCommentText.swift:54:10)
Exception Code: 0x80000003
 #0 0x00007ff7a0f38e95 HandleAbort S:\SourceCache\llvm-project\llvm\lib\Support\Windows\Signals.inc:429:0
 #1 0x00007ffdae6ae6d5 (C:\Windows\System32\ucrtbase.dll+0x7e6d5)
 #2 0x00007ffdae6af6e1 (C:\Windows\System32\ucrtbase.dll+0x7f6e1)
 #3 0x00007ff799778f30 `anonymous namespace'::IRGenDebugInfoImpl::getMangledName S:\SourceCache\swift\lib\IRGen\IRGenDebugInfo.cpp:1055:0
 #4 0x00007ff79977b9d7 `anonymous namespace'::IRGenDebugInfoImpl::getOrCreateType S:\SourceCache\swift\lib\IRGen\IRGenDebugInfo.cpp:2462:0
 #5 0x00007ff79977a123 `anonymous namespace'::IRGenDebugInfoImpl::getOrCreateContext S:\SourceCache\swift\lib\IRGen\IRGenDebugInfo.cpp:757:0
 #6 0x00007ff799774c5f `anonymous namespace'::IRGenDebugInfoImpl::emitFunction S:\SourceCache\swift\lib\IRGen\IRGenDebugInfo.cpp:3052:0
 #7 0x00007ff79977490c `anonymous namespace'::IRGenDebugInfoImpl::emitFunction S:\SourceCache\swift\lib\IRGen\IRGenDebugInfo.cpp:2994:0
 #8 0x00007ff79977b5c7 `anonymous namespace'::IRGenDebugInfoImpl::getOrCreateScope S:\SourceCache\swift\lib\IRGen\IRGenDebugInfo.cpp:2957:0
 #9 0x00007ff79976d33f llvm::operator!= S:\SourceCache\llvm-project\llvm\include\llvm\ADT\PointerUnion.h:208:0
#10 0x00007ff79976d33f llvm::ValueIsPresent<llvm::PointerUnion<swift::SILDebugScope const *,swift::SILFunction *>,void>::isPresent S:\SourceCache\llvm-project\llvm\include\llvm\Support\Casting.h:622:0
#11 0x00007ff79976d33f llvm::detail::isPresent S:\SourceCache\llvm-project\llvm\include\llvm\Support\Casting.h:630:0
#12 0x00007ff79976d33f llvm::dyn_cast_if_present S:\SourceCache\llvm-project\llvm\include\llvm\Support\Casting.h:739:0
#13 0x00007ff79976d33f llvm::PointerUnion<swift::SILDebugScope const *,swift::SILFunction *>::dyn_cast S:\SourceCache\llvm-project\llvm\include\llvm\ADT\PointerUnion.h:163:0
#14 0x00007ff79976d33f `anonymous namespace'::IRGenDebugInfoImpl::createInlinedAt S:\SourceCache\swift\lib\IRGen\IRGenDebugInfo.cpp:513:0
#15 0x00007ff79976d3c1 `anonymous namespace'::IRGenDebugInfoImpl::createInlinedAt S:\SourceCache\swift\lib\IRGen\IRGenDebugInfo.cpp:518:0
#16 0x00007ff79976d3c1 `anonymous namespace'::IRGenDebugInfoImpl::createInlinedAt S:\SourceCache\swift\lib\IRGen\IRGenDebugInfo.cpp:518:0
#17 0x00007ff79977f464 `anonymous namespace'::IRGenDebugInfoImpl::setCurrentLoc S:\SourceCache\swift\lib\IRGen\IRGenDebugInfo.cpp:2797:0
#18 0x00007ff79977f257 swift::irgen::IRGenDebugInfo::setCurrentLoc(class swift::irgen::IRBuilder &, class swift::SILDebugScope const *, class swift::SILLocation) S:\SourceCache\swift\lib\IRGen\IRGenDebugInfo.cpp:3807:0
#19 0x00007ff7998b5d60 swift::SILBasicBlock::args_end S:\SourceCache\swift\include\swift\SIL\SILBasicBlock.h:326:0
#20 0x00007ff7998b5d60 emitPHINodesForBBArgs S:\SourceCache\swift\lib\IRGen\IRGenSIL.cpp:2012:0
#21 0x00007ff7998b8464 `anonymous namespace'::IRGenSILFunction::emitSILFunction S:\SourceCache\swift\lib\IRGen\IRGenSIL.cpp:2661:0
#22 0x00007ff7998b7bbd swift::irgen::IRGenModule::emitSILFunction(class swift::SILFunction *) S:\SourceCache\swift\lib\IRGen\IRGenSIL.cpp:2573:0
#23 0x00007ff7996b9acc swift::irgen::CurrentIGMPtr::{dtor} S:\SourceCache\swift\lib\IRGen\IRGenModule.h:2019:0
#24 0x00007ff7996b9acc swift::irgen::IRGenerator::emitGlobalTopLevel(class std::vector<class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char>>, class std::allocator<class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char>>>> const &) S:\SourceCache\swift\lib\IRGen\GenDecl.cpp:1223:0
#25 0x00007ff799601f14 std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::{dtor} C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\include\vector:765:0
#26 0x00007ff799601f14 swift::IRGenRequest::evaluate(class swift::Evaluator &, struct swift::IRGenDescriptor) const S:\SourceCache\swift\lib\IRGen\IRGen.cpp:1259:0
#27 0x00007ff79960ca56 swift::SimpleRequest<class swift::IRGenRequest, (struct swift::IRGenDescriptor), 17>::evaluateRequest(class swift::IRGenRequest const &, class swift::Evaluator &) S:\SourceCache\swift\include\swift\AST\SimpleRequest.h:313:0
#28 0x00007ff7995f6ecb swift::Evaluator::getResultUncached<class swift::IRGenRequest, class `class swift::GeneratedModule __cdecl swift::evaluateOrFatal<class swift::IRGenRequest>(class swift::Evaluator &, class swift::IRGenRequest)'::`2'::<lambda_1>>(class swift::IRGenRequest const &, class `class swift::GeneratedModule __cdecl swift::evaluateOrFatal<class swift::IRGenRequest>(class swift::Evaluator &, class swift::IRGenRequest)'::`2'::<lambda_1>) S:\SourceCache\swift\include\swift\AST\Evaluator.h:349:0
#29 0x00007ff79960669d swift::evaluateOrFatal S:\SourceCache\swift\include\swift\AST\Evaluator.h:448:0
#30 0x00007ff79960669d swift::performIRGeneration(class swift::FileUnit *, class swift::IRGenOptions const &, struct swift::TBDGenOptions const &, class std::unique_ptr<class swift::SILModule, struct std::default_delete<class swift::SILModule>>, class llvm::StringRef, class swift::PrimarySpecificPaths const &, class llvm::StringRef, class llvm::GlobalVariable **) S:\SourceCache\swift\lib\IRGen\IRGen.cpp:1690:0
#31 0x00007ff799167c40 performCompileStepsPostSILGen S:\SourceCache\swift\lib\FrontendTool\FrontendTool.cpp:1781:0
#32 0x00007ff79916840f std::unique_ptr<swift::SILModule,std::default_delete<swift::SILModule> >::{dtor} C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\include\memory:3279:0
#33 0x00007ff79916840f swift::performCompileStepsPostSema(class swift::CompilerInstance &, int &, class swift::FrontendObserver *) S:\SourceCache\swift\lib\FrontendTool\FrontendTool.cpp:750:0
#34 0x00007ff799167028 performAction S:\SourceCache\swift\lib\FrontendTool\FrontendTool.cpp:1302:0
#35 0x00007ff7991675ab std::unique_ptr<swift::ASTContext,std::default_delete<swift::ASTContext> >::operator bool C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\include\memory:3305:0
#36 0x00007ff7991675ab std::operator== C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\include\memory:3550:0
#37 0x00007ff7991675ab std::operator!= C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.38.33130\include\memory:3561:0
#38 0x00007ff7991675ab swift::CompilerInstance::hasASTContext S:\SourceCache\swift\include\swift\Frontend\Frontend.h:604:0
#39 0x00007ff7991675ab performCompile S:\SourceCache\swift\lib\FrontendTool\FrontendTool.cpp:1376:0
#40 0x00007ff79916939b swift::performFrontend(class llvm::ArrayRef<char const *>, char const *, void *, class swift::FrontendObserver *) S:\SourceCache\swift\lib\FrontendTool\FrontendTool.cpp:2080:0
#41 0x00007ff798f9d356 run_driver S:\SourceCache\swift\lib\DriverTool\driver.cpp:443:0
#42 0x00007ff798f9cd6c swift::mainEntry(int, char const **) S:\SourceCache\swift\lib\DriverTool\driver.cpp:530:0
#43 0x00007ff7a0fb5d84 invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78:0
#44 0x00007ff7a0fb5d84 __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0
#45 0x00007ffdaf6a259d (C:\Windows\System32\KERNEL32.DLL+0x1259d)
#46 0x00007ffdb124af38 (C:\Windows\SYSTEM32\ntdll.dll+0x5af38)
<unknown>:0: error: compile command failed due to signal -2147483645 (use -v to see invocation)

@augusto2112
Copy link
Contributor Author

@swift-ci test

@augusto2112 augusto2112 force-pushed the fix-orig-def-type-in-func branch from a3bad1a to 3bb29ca Compare December 20, 2024 21:42
@augusto2112
Copy link
Contributor Author

@swift-ci test

@augusto2112
Copy link
Contributor Author

@hjyamauchi thanks for testing, could you try again with the latest commit?

Types with @_originallyDefinedIn cannot be round tripped,

Types declared inside functions have their mangling affected by the
function signature. If the generic signature mentions an
@_originallyDefinedIn type, the type inside the function cannot be round
tripped either.

This commit disables round tripping for this scenario.
@augusto2112 augusto2112 force-pushed the fix-orig-def-type-in-func branch from 3bb29ca to d75bde3 Compare December 20, 2024 22:13
@augusto2112
Copy link
Contributor Author

@swift-ci smoke test

@hjyamauchi
Copy link
Contributor

@hjyamauchi thanks for testing, could you try again with the latest commit?

@augusto2112 Will do. I also added a reduced test here: #78326 (comment)

@hjyamauchi
Copy link
Contributor

@hjyamauchi thanks for testing, could you try again with the latest commit?

@augusto2112 Will do. I also added a reduced test here: #78326 (comment)

@augusto2112 The updated PR doesn't seem to fix the issue for me.

@augusto2112
Copy link
Contributor Author

That's surprising, let me check again if I'm missing some other case...

@hjyamauchi
Copy link
Contributor

@augusto2112 It might be useful to use the reduced test from here: #78326 (comment)

@augusto2112
Copy link
Contributor Author

@hjyamauchi thanks, I was able to use your reproducer. It actually was not related to @_originallyDefinedIn as I thought, but something else entirely. I'm running the test suite locally and hopefully this will be the last iteration of the fix.

Now that mangling for the debugger respects originally defined in, this
is not needed anymore.
@augusto2112 augusto2112 force-pushed the fix-orig-def-type-in-func branch from f1d3bc8 to 398ded5 Compare December 21, 2024 00:59
@augusto2112
Copy link
Contributor Author

@swift-ci test

@augusto2112
Copy link
Contributor Author

@hjyamauchi if you're around this should work with your test case now :)

@augusto2112
Copy link
Contributor Author

@swift-ci smoke test

@hjyamauchi
Copy link
Contributor

@hjyamauchi if you're around this should work with your test case now :)

Testing

@hjyamauchi
Copy link
Contributor

It looks good!

@augusto2112 augusto2112 merged commit 7057842 into swiftlang:main Dec 21, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants