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

  • Home
  • SEARCH
  • 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 6115839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:08:16+00:00 2026-05-23T15:08:16+00:00

I have a program which produces a fatal error with a testcase, and I

  • 0

I have a program which produces a fatal error with a testcase, and I can locate the problem by reading the log and the stack trace of the fatal. It turns out that there is a read operation upon a null pointer.

But when I try to attach GDB to it and set a breakpoint around the suspicious code, the null pointer just cannot be observed! The program works smoothly without any error.

This is a single-process, single-thread program, and I didn’t experience this kind of thing before. Why is it?

Appended: I also tried to call the pause() system call before the fatal-trigger code, and expected to make the program sleep before the fatal point and then attach GDB on it on-the-fly, sadly, no fatal error occurred.

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

    It’s only guesswork without looking at the code, but debuggers sometimes do this:

    • They initialize certain stuff for you
    • The timing of the operations is changed

    I don’t have a quote on GDB, but I do have one on valgrind (granted the two do wildly different things..)

    My program crashes normally, but doesn’t under Valgrind, or vice versa. What’s happening?

    When a program runs under Valgrind,
    its environment is slightly different
    to when it runs natively. For example,
    the memory layout is different, and
    the way that threads are scheduled is
    different.

    Same would go for GDB.

    Most of the time this doesn’t make any
    difference, but it can, particularly
    if your program is buggy.

    So the true problem is likely in your program.

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

Sidebar

Related Questions

I have a program which has some Textareas / Labels these can be anywhere
Consider this problem: I have a program which should fetch (let's say) 100 records
I have a custom java program which produces a Comma Separated Values (CSV) file.
I have a program which needs to behave slightly differently on Tiger than on
I have a program which deliberately performs a divide by zero (and stores the
I have a program which needs installing on windows 64 boxes. Most of the
I have a program which only needs a NotifyIcon to work as intended. So
I have an AppleScript program which creates XML tags and elements within an Adobe
I have a program in which I've lost the C++ source code. Are there
I have a program in which the user adds multiple objects to a scene.

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.