ramosian-glider / sanitizer-issues

test
0 stars 0 forks source link

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

Open ramosian-glider opened 9 years ago

ramosian-glider commented 9 years ago

Originally reported on Google Code with ID 40

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.

Reported by eugenis@google.com on 2012-02-13 13:02:45

ramosian-glider commented 9 years ago
We use our own Printf, should be fine. 

Reported by konstantin.s.serebryany on 2012-02-13 15:48:49

ramosian-glider 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.

Reported by eugenis@google.com on 2012-02-15 06:52:51

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

Reported by konstantin.s.serebryany on 2012-02-15 06:55:36

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

Reported by eugenis@google.com on 2012-02-15 06:57:14

ramosian-glider commented 9 years ago
I hope you are kidding. 

Reported by konstantin.s.serebryany on 2012-02-15 07:05:21

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

Reported by glider@chromium.org on 2012-02-15 07:08:36

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

Reported by eugenis@google.com on 2012-02-15 07:16:09

ramosian-glider commented 9 years ago
can this be closed? (or fixed and closed?)

Reported by konstantin.s.serebryany on 2012-02-24 22:59:32

ramosian-glider commented 9 years ago
First fixed, then closed.

Reported by eugenis@google.com on 2012-02-27 10:23:53

ramosian-glider commented 9 years ago
Ping. Please either fix or close. 

Reported by konstantin.s.serebryany on 2012-03-16 16:54:19

ramosian-glider commented 9 years ago
http://codereview.appspot.com/5856044/

Reported by eugenis@google.com on 2012-03-20 11:00:26

ramosian-glider commented 9 years ago
Can this be marked as fixed already?

Reported by ramosian.glider on 2012-04-18 10:23:52

ramosian-glider commented 9 years ago

Reported by eugenis@google.com on 2012-04-18 10:46:16

ramosian-glider commented 9 years ago
Adding Project:AddressSanitizer as part of GitHub migration.

Reported by ramosian.glider on 2015-07-30 09:12:58