Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4615036
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:46:58+00:00 2026-05-22T01:46:58+00:00

I expected that Pageheap will force my application to crash while executing the 2nd

  • 0

I expected that Pageheap will force my application to crash while executing the 2nd and 3rd statements in the below code piece. But this is not happening. I enabled full page heap for the application.

What extra things should I do to make pageheap to break my application at second and third statements?

char *test =new char[12];
memset(test,'c',15);
test[13] = 'c';

But If I use, the following statement pagebreak will break my application

memset(test,'c',50);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:46:59+00:00Added an answer on May 22, 2026 at 1:46 am

    Allocations are rounded up N bytes, where N is a multiple of 8 and depends on which version of Windows you’re using. Let’s assume allocations are rounded up to the nearest 8 bytes, for this case.

    Pageheap works by inserting a ‘guard page’ at the end of each allocation and protecting it from read/write access, so any attempt to use it will result in an access violation.

    In this case, your allocation of test is requesting 12 bytes. The heap manager is actually giving you an allocation of 16 bytes. Accessing test[15] is within this allocation, so it’s not hitting the guard page.

    On one additional note, I believe a full pageheap will fill the ‘extra’ memory returned by an allocation with some special value. When you free the allocation, it will check the ‘extra’ memory and raise an exception if the value was changed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following bit of code that worked as expected before we upgraded
I expected the following code to print 8, 111 and 999. I supposed that
Is it expected that printing a large-ish ggplot to PDF will cause the RSession
I expected that manualy scheduled tasks will not change their dates automatically despite of
I have a Rails app implementing a game, so it's expected that a player
Is it expected behavior that two encodings can map to the same decoding? I'm
I have a method fetchObjects(String) that is expected to return an array of Contract
I know that one can define an 'expected' exception in JUnit, doing: @Test(expect=MyException.class) public
I am trying to test that a particular method throws an expected exception from
I've heard many people say that if the number of expected elements in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.