Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ramosian-glider opened this issue Aug 31, 2015 · 14 comments
Closed

Comments

@ramosian-glider
Copy link
Member

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
Copy link
Member Author

We use our own Printf, should be fine. 

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

  • Status changed: WontFix

@ramosian-glider
Copy link
Member Author

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

  • Status changed: Accepted

@ramosian-glider
Copy link
Member Author

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
Copy link
Member Author

For short term mitigation, I suggest we replace all % with @.

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

@ramosian-glider
Copy link
Member Author

I hope you are kidding. 

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

  • Status changed: WontFix

@ramosian-glider
Copy link
Member Author

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
Copy link
Member Author

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

  • Status changed: Started

@ramosian-glider
Copy link
Member Author

can this be closed? (or fixed and closed?)

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

@ramosian-glider
Copy link
Member Author

First fixed, then closed.

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

@ramosian-glider
Copy link
Member Author

Ping. Please either fix or close. 

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

@ramosian-glider
Copy link
Member Author

http://codereview.appspot.com/5856044/

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

@ramosian-glider
Copy link
Member Author

Can this be marked as fixed already?

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

@ramosian-glider
Copy link
Member Author

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

  • Status changed: Fixed

@ramosian-glider
Copy link
Member Author

Adding Project:AddressSanitizer as part of GitHub migration.

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

  • Labels added: ProjectAddressSanitizer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant