Repository navigation
Conversation
fml::Status stored the message as a std::string_view, so a status built from a runtime string pointed into that string's buffer. CommandQueueVK returns such a status from a lambda whose local string is gone by the time the caller reads message(). The message is now a std::string; message() still returns a std::string_view, so callers do not change.
Member
|
Let's replace usages of fml::Status with absl::Status instead. |
Contributor
|
An existing Git SHA, To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with |
gaaclarke
requested changes
Oct 12, 2026
gaaclarke
left a comment
Member
There was a problem hiding this comment.
oops meant to "request changes", not close the issue. we want absl::Status
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.
fml::Statusstores its message as astd::string_view, and its constructor takes one, so passing astd::stringcompiles without a word and the status points into that string's buffer.CommandQueueVK::Submitdoes exactly that after a failed Vulkan submit: it builds the status from a localsubmit_errorstring inside the fence callback and returns it after the string is gone, so anyone who readsmessage()reads freed memory. Every other caller passes a literal, which is why it hasn't shown up.Status::message_is now astd::string. The constructor still takes astd::string_viewandmessage()still returns one, so no caller changes, and the doc comment says how long that view stays valid. OK statuses have an empty message and don't allocate. I'd rather fix the type than the one caller, because the next caller that formats a message would fall into the same trap.Where it was verified. macOS arm64,
host_debug_unopt_arm64, rebased on current main. The newfml/status_unittests.cccovers a literal message, a runtime message changed or destroyed after the status is built, and a copied status. Without the change two of those fail every time (message()returnsseconforsecond), and the one that reads freed memory fails reliably only under ASan; with itfml_unittests --gtest_filter='StatusTest.*'is 5/5 and the whole offml_unittests208/208. Becausestatus.his included widely I also builtimpeller_unittests,gpu_unittests,flow_unittestsandflutter_tester, and ran theflow_unittestsframe timing tests that check status messages (15/15); CI covers the rest of the tree.Fixes #194151
Pre-launch Checklist
///).