[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:15:46 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:
----------------------------------+------------------------------------
Comment (by dgoulet):
Quick C test I did. With `objdump -d` you'll notice it is not there.
Compile with `gcc -O2`:
{{{
#include <stdio.h>
#include <stdlib.h>
struct a {
int val;
};
int main(int argc, char **argv)
{
struct a *A = malloc(sizeof(struct a));
A->val = 0xCAFE;
fprintf(stderr, "a: %d\n", A->val);
A->val = 0xDEAD;
free(A);
return 0;
}
}}}
With `gcc` without anything, you will find `CAFE` and `DEAD` but with
`-O2`, it is optimized out.
I've confirmed it by compiling your PR and looking at the disassemble
code.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/33290#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list