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

Fix ASAN warning in wallet.history #1887

Merged
merged 1 commit into from Apr 9, 2019

Conversation

2 participants
@wezrule
Copy link
Collaborator

commented Apr 9, 2019

Mac/Clang ASAN warning

[ RUN      ] rpc.wallet_history
SUMMARY: AddressSanitizer: stack-use-after-scope vector:639 in (anonymous namespace)::history_visitor::should_ignore_account(nano::uint256_union const&)

A default argument which is a temporary bound to const reference was assigned to a member variable and accessed later in another method should_ignore_account. However from the standard:

A temporary bound to a reference member in a constructor’s ctor-initializer (§12.6.2 [class.base.init]) persists until the constructor exits

I have removed the default argument and just pass an empty std::vector in the one place utilizing the default argument.

@wezrule wezrule added the bug label Apr 9, 2019

@wezrule wezrule added this to the V19.0 milestone Apr 9, 2019

@wezrule wezrule self-assigned this Apr 9, 2019

@wezrule wezrule requested a review from SergiySW Apr 9, 2019

@wezrule wezrule added this to CP3 (2019-04-10) in V19 Apr 9, 2019

@wezrule wezrule added sanitizers and removed bug labels Apr 9, 2019

@wezrule wezrule merged commit 3f11ed3 into nanocurrency:master Apr 9, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@wezrule wezrule deleted the wezrule:asan_warning_wallet_history branch Apr 9, 2019

guilhermelawless added a commit to guilhermelawless/nano-node that referenced this pull request Apr 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.