Skip to content

Log not lldbassert when the NSNumber summary formatter encounters a "preserved" number #2798

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

Merged
merged 4 commits into from
Apr 6, 2021

Conversation

jimingham
Copy link

There no reason to stop a test case just because we encountered an unsupported NSNumber formatter. Apparently the previous check wasn't reached (the preserved number was rejected before the assert). My previous patch to support negative NSNumbers moved this check earlier and started triggering the assert. That wasn't helpful, so I changed the lldbassert's to data formatter channel log messages.

jimingham and others added 3 commits April 6, 2021 10:13
The ObjC runtime offers both signed & unsigned tagged pointer value
accessors to tagged pointer providers, but lldb's tagged pointer
code only implemented the unsigned one.  This patch adds an
emulation of the signed one.

The motivation for doing this is that NSNumbers use the signed
accessor (they are always signed) and we need to follow that in our
summary provider or we will get incorrect values for negative
NSNumbers.

The data-formatter-objc test file had NSNumber examples (along with lots of other
goodies) but the NSNumber values weren't tested.  So I also added
checks for those values to the test.

I also did a quick audit of the other types in that main.m file, and
it looks like pretty much all the other values are either intermediates
or are tested.

Differential Revision: https://reviews.llvm.org/D99694

(cherry picked from commit 4d9039c)
This reverts commit 4d9039c.

This is causing the greendragon bots to fail most of the time when
running TestNSDictionarySynthetic.py.  Reverting until Jim has a chance
to look at this on Monday.  Running the commands from that test from
the command line, it fails 10-13% of the time on my desktop.

This is a revert of Jim's changes in https://reviews.llvm.org/D99694

(cherry picked from commit 602ab18)
…inters.""

This reverts commit 602ab18.

The patch replicated an lldbassert for a certain type of NSNumber for tagged
pointers.  This really shouldn't be an assert since we don't do anything wrong
with these numbers, we just don't print a summary.  So this patch changed the
lldbassert to a log message in reverting the revert.

(cherry picked from commit be0ced0)
@jimingham jimingham requested a review from JDevlieghere April 6, 2021 17:17
@JDevlieghere
Copy link

You might want to include bdfee7d as we have Windows bot for Swift.

@jimingham
Copy link
Author

You might want to include bdfee7d as we have Windows bot for Swift.

Done

Copy link

@JDevlieghere JDevlieghere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jimingham
Copy link
Author

@swift-ci please test

@jimingham jimingham merged commit b8334e8 into swiftlang:apple/stable/20210107 Apr 6, 2021
@jimingham jimingham deleted the log-not-assert branch April 6, 2021 22:46
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