Travis Vitek wrote:
Travis Vitek wrote:


Scott Zhong wrote:

the default page size can vary depending on the OS and can be changed
with chatr.  Currently the test assumes the page size is 16kb which is
not the case on this platform thus causes the assertions to
occur.  For
the short term, we can adjust the multiplier to 64 instead of 16.  For
the long term, we need a better method to create a bad address.


Index: 0.printf.cpp
===================================================================
--- 0.printf.cpp        (revision 616446)
+++ 0.printf.cpp        (working copy)
@@ -171,7 +171,7 @@
        addr = (char*)32;
#else
        // the first page on HP-UX is readable, this might work
-        addr = (char*)(void*)bad_address + 1024 * 1024 * 16;
+        addr = (char*)(void*)bad_address + 1024 * 1024 * 64;
#endif   // _RWSTD_OS_HP_UX

    }

It looks like th original code was stepping 16MB (1024 * 1024 bytes)
past bad_address. That should be well more than one page away. BTW, you
can determine the kernel page size on most *nix platforms with sysconf
(_SC_PAGESIZE).

Travis


Of course the kernel memory page size from sysconf() isn't the same as
the virtual memory page size that you are talking about. :)

It's not? I thought both sysconf(_SC_PAGESIZE) and getpagesize()
returned the size of the virtual page. I.e., whatever smallest
unit mmap() allocates.

Martin

Reply via email to