[tor-bugs] #33290 [Core Tor/Tor]: Add diagnostics for confusing corruption issue #32564 in ewma
Tor Bug Tracker & Wiki
blackhole at torproject.org
Thu Feb 13 14:02:41 UTC 2020
#33290: Add diagnostics for confusing corruption issue #32564 in ewma
----------------------------------+------------------------------------
Reporter: nickm | Owner: nickm
Type: defect | Status: needs_revision
Priority: Medium | Milestone: Tor: 0.4.3.x-final
Component: Core Tor/Tor | Version: Tor: 0.4.1.6
Severity: Normal | Resolution:
Keywords: 043-should backport? | Actual Points: .1
Parent ID: #32564 | Points:
Reviewer: dgoulet | Sponsor:
----------------------------------+------------------------------------
Changes (by dgoulet):
* status: needs_review => needs_revision
* reviewer: => dgoulet
Comment:
Replying to [comment:2 cypherpunks]:
> Replying to [comment:1 nickm]:
> > Branches are ticket33290_{041,042,043,master}. I am recommending that
we try this out in 043 first, so here is an 043 PR:
https://github.com/torproject/tor/pull/1729 .
>
> Is there a way to stop the compiler from optimizing away the dead store
to `pol->base_.magic = 0xDEAD901C;` right before it gets freed?
So yeah I think that is a very good point. And gcc uses `-O2` which will
likely optimize it out. I did a quick test case here and it does optimize
it out. And also looked at tor disassembled and it is not there in those
free function.
Maybe we could set the `magic` to `volatile` which in "theory", but not
enforced, should leave the variable alive on most compilers.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/33290#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list