[tor-bugs] #29537 [Core Tor/Tor]: verify intptr_t round-trip through void *
Tor Bug Tracker & Wiki
blackhole at torproject.org
Mon Mar 18 02:41:43 UTC 2019
#29537: verify intptr_t round-trip through void *
----------------------------------------+----------------------------------
Reporter: catalyst | Owner: (none)
Type: defect | Status: needs_revision
Priority: Medium | Milestone: Tor:
| 0.4.1.x-final
Component: Core Tor/Tor | Version:
Severity: Normal | Resolution:
Keywords: portability technical-debt | Actual Points:
Parent ID: | Points:
Reviewer: catalyst, teor | Sponsor:
----------------------------------------+----------------------------------
Comment (by teor):
Replying to [comment:17 rl1987]:
> Are we doing the right thing here though? Intuitively, if we're writing
code that a compiler might very reasonably optimize away, aren't we on a
wrong path?
Some of our existing code relies on behaviour that's not guaranteed by the
standard. This ticket is about writing tests to make sure that our
supported architectures do what we expect with this existing code. (Rather
than changing pointer values in other ways.)
See the ticket description for details.
But these tests won't be any good to us if the casts are optimised away by
the compiler. Much of our existing code avoids this optimisation by doing
the casts in different functions in different modules. So the tests need
to do the casts in different functions in a different module.
> Perhaps we should create tickets to fix parts of tor codebase that rely
on putting integers into `void *` one by one?
We already have #23714 to fix these issues. But we want to add a test now,
and do the fixes later.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/29537#comment:18>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list