Fix segfault from null GetFunction() in DartDumper for Dart 3.10#190
Open
vichhka-git wants to merge 1 commit intoworawit:mainfrom
Open
Fix segfault from null GetFunction() in DartDumper for Dart 3.10#190vichhka-git wants to merge 1 commit intoworawit:mainfrom
vichhka-git wants to merge 1 commit intoworawit:mainfrom
Conversation
GetFunction() returns nullptr when an UnlinkedCall target address is not found in the functions or stubs maps. Three call sites in DartDumper.cpp dereferenced the result without null checks, causing SIGSEGV during Object Pool dump on Dart 3.10.7 snapshots. Added null guards with fallback representations at: - getPoolObjectDescription() UnlinkedCall kImmediate handler - DumpStructHeaderFile() UnlinkedCall kImmediate handler - ObjectToString() kFunctionCid handler Also fixed a pre-existing extra argument in std::format() call in DumpStructHeaderFile().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetFunction()returnsnullptrwhen an UnlinkedCall target address isn't found in the functions/stubs maps, but 3 call sites dereference the result without null checksProblem
When running blutter against a Dart 3.10.7
libapp.so, the binary crashes with a segmentation fault (signal 11) duringDumpObjectPool(). The crash occurs ingetPoolObjectDescription()when handlingUnlinkedCallentries whosekImmediatetarget address doesn't resolve to any known function.Related to issue #182 — commit a4d2100 added
kTaggedObjecthandling but missed null guards on thekImmediatepath.Changes (all in
blutter/src/DartDumper.cpp)getPoolObjectDescription()~L812GetFunction()return; fallback to[unknown]labelDumpStructHeaderFile()~L194std::format()ObjectToString()~L491AsFunction()call; fallback toFunction(addr)Testing
libapp.sothat previously crashed