viralcode / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
1 stars 0 forks source link

Use portable macros for printing sizes, offsets, and addresses #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We (asan runtime) often print size_t, uintptr_t and friends as %lx, %lu, and 
sometimes even %ld.

ERROR: AddressSanitizer failed to allocate 0xa4001000 (-1543499776) bytes of 
MmapNewPagesAndPoisonShadow

AFAIK, this will break horribly on Windows.
We should switch to PRI* macros or invent a set of our own.

Original issue reported on code.google.com by euge...@google.com on 13 Feb 2012 at 1:02

GoogleCodeExporter commented 9 years ago
We use our own Printf, should be fine. 

Original comment by konstant...@gmail.com on 13 Feb 2012 at 3:48

GoogleCodeExporter commented 9 years ago
Still, this is very misleading and error prone. Using %lx, etc syntax makes 
people think there is a printf() underneath.

I suggest we invent a new syntax for Printf format lines, so that no one will 
ever confuse it with printf(). It can also have a specifier for decimal 
intptr_t/uintptr_t, that normal printf() is lacking.

Original comment by euge...@google.com on 15 Feb 2012 at 6:52

GoogleCodeExporter commented 9 years ago
Really, I see no problem. at all. And we have much more important things to 
care about. 

Original comment by konstant...@gmail.com on 15 Feb 2012 at 6:55

GoogleCodeExporter commented 9 years ago
For short term mitigation, I suggest we replace all % with @.

Original comment by euge...@google.com on 15 Feb 2012 at 6:57

GoogleCodeExporter commented 9 years ago
I hope you are kidding. 

Original comment by konstant...@gmail.com on 15 Feb 2012 at 7:05

GoogleCodeExporter commented 9 years ago
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=64-bit_Po
rtability#64-bit_Portability

Original comment by gli...@chromium.org on 15 Feb 2012 at 7:08

GoogleCodeExporter commented 9 years ago
I kind of was :)
Per online discussion, I'm adding %zu/%zd to Printf.

Original comment by euge...@google.com on 15 Feb 2012 at 7:16

GoogleCodeExporter commented 9 years ago
can this be closed? (or fixed and closed?)

Original comment by konstant...@gmail.com on 24 Feb 2012 at 10:59

GoogleCodeExporter commented 9 years ago
First fixed, then closed.

Original comment by euge...@google.com on 27 Feb 2012 at 10:23

GoogleCodeExporter commented 9 years ago
Ping. Please either fix or close. 

Original comment by konstant...@gmail.com on 16 Mar 2012 at 4:54

GoogleCodeExporter commented 9 years ago
http://codereview.appspot.com/5856044/

Original comment by euge...@google.com on 20 Mar 2012 at 11:00

GoogleCodeExporter commented 9 years ago
Can this be marked as fixed already?

Original comment by ramosian.glider@gmail.com on 18 Apr 2012 at 10:23

GoogleCodeExporter commented 9 years ago

Original comment by euge...@google.com on 18 Apr 2012 at 10:46