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 8770443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:33:36+00:00 2026-06-13T17:33:36+00:00

I have a problem on an embedded device that I think might be related

  • 0

I have a problem on an embedded device that I think might be related to a stack overflow.

In order to test this I was planning to fill the stack with magic bytes and then periodically check if the stack has overflowed by examining how much of my magic bytes that are left intact.

But I can’t get the routine for marking the stack to work. The application keeps crashing instantly. This is what I have done just at the entry point of the program.

    //fill most of stack with magic bytes
    int stackvar = 0;
    int stackAddr = (int)&stackvar;
    int stackAddrEnd = stackAddr - 25000;
    BYTE* stackEnd = (BYTE*) stackAddrEnd;

    for(int i = 0; i < 25000; ++i)
    {
        *(stackEnd + i) = 0xFA;
    }

Please note that the allocated stack is larger than 25k. So I’m counting on some stack space to already be used at this point. Also note that the stack grows from higher to lower addresses that’s why I’m trying to fill from the bottom and up.

But as I said, this will crash. I must be missing something here.

  • 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-06-13T17:33:37+00:00Added an answer on June 13, 2026 at 5:33 pm

    From what I can see, you may be easily overwriting the contents of the stackEnd variable in the last few iterations of the loop. This is obviously a bad thing, as you’re using it in the very same loop. Does stopping in your loop at, say 24900, help?

    I’d suggest to stop the loop at a well calculated value depending on the size of integer on your platform then.

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

Sidebar

Related Questions

I have a legacy (solve this problem for us issue) app that communicates with
I have a problem linking an application for an embedded target. I'm developing on
I have the following problem. I have embedded a map using Google Maps' API.
I do have a strange focus problem when using a JComboBox inside an embedded
I have a flash app embedded in a yui TabView tab div, the problem
I have problem with my query on C, I’m using the oci8 driver. This
I have a problem with relationships persisting in an embedded document. Here is the
I have an embedded system that can be treated as an Access Point. There's
I am writing a C++ application for an embedded Linux. I have a problem
I have a problem with my web site position, this is my CSS: My

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.