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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:23:22+00:00 2026-06-11T15:23:22+00:00

I am playing with pointers just doing some basic stuff to solidify my understanding

  • 0

I am playing with pointers just doing some basic stuff to solidify my understanding of them. When I try debugging and following this example that I found on the web using GDB’s ‘next’ and ‘step’, GDB runs off the end of the function. After it reaches the statement “return 0;” it tells me that it “Cannot access memory at address 0x0 0x0000000100000de4 in start()

This is the code:

#include <cstdio>
#include <ctype.h>


int main()
{
    char my_str[] = "hello world";
    *my_str = toupper(*my_str);
    *(my_str + 6) = toupper(*(my_str + 6));
    printf("%s", my_str); // prints, "Hello World"
    return 0;
}

This is gdb’s output:

Breakpoint 1, main () at pwp.cpp:10
10       return 0;
(gdb) n
Cannot access memory at address 0x0
0x0000000100000de4 in start ()
(gdb) s
Single stepping until exit from function start, 
which has no line number information.
0x0000000100000ed6 in dyld_stub_exit ()
(gdb) n
Single stepping until exit from function dyld_stub_exit, 
which has no line number information.
0x0000000100000f08 in dyld_stub_printf ()
(gdb) n
Cannot find bounds of current function
(gdb) q

What is happening to cause this?

  • 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-11T15:23:23+00:00Added an answer on June 11, 2026 at 3:23 pm

    Returning from main() does not immediately exit your program — libc does some cleanup before exiting, which includes flushing output on file descriptors such as stdout (which is necessary here, because you didn’t include a \n in your printf).

    The n command in GDB attempts to step by one line of source code by default. Since you are single-stepping into code that you don’t have source available for (libc), and because the code you’re stepping into is somewhat odd (it’s a dynamic library “stub” function), the command doesn’t work correctly. If you really want to step one instruction at a time, use si.

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

Sidebar

Related Questions

I was just playing with pointers and found this weird thing. I created the
I've been playing with pointers to better understand them and I came across something
I am just playing around to understand smart pointers and trying to make mine
This surprised me a little bit, but I was playing around with some code
friends I was just playing around with some pointer programs and realized that the
Just playing with pointers, trying to pass the address of a pointer to a
Just playing around with Wordpress / Contact Form 7 . Is it possible to
I have a User, some of which are an employee. This is a one-to-one
Cheers, I ran into this chunk of code in Programming Game AI by Example:
I have a sortable list of playing cards. In order to just show 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.