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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:08:05+00:00 2026-05-13T06:08:05+00:00

I am sure a lot of you have experienced this. Sometimes while debugging a

  • 0

I am sure a lot of you have experienced this. Sometimes while debugging a crash you add a line of trace and viola the crash disappears. This generally points to a memory corruption and you look for buffer overflows etc around the code. To be more specific the same occurs for even single threaded applications.

How does though a line of trace prevent the crash from occurring?

The trace line is a piece of code so should go to the code segment which is as it is read only right?

It should have no impact on the local stack of execution? How does it impact pointer offsets to make some other piece of memory to get over written which doesn’t manifest it self(still bad).

  • 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-13T06:08:05+00:00Added an answer on May 13, 2026 at 6:08 am

    A couple of folks have already mentioned timing changes. Even if your code is single-threaded, you might be calling API that either starts threads on your behalf, or implements some other form of asynchronous communication.

    As far as this statement is concerned:

    The trace line is a piece of code so should go to the code segment

    That depends on what your tracing code actually does. Even something as simple as:

    write(0, "Hello, World!\n", 14);
    

    Will at the least add additional data storage for the constant string, which will shift the location of other constant data, and possibly change the start of other memory segments, affecting the location of code and/or heap, as well. If this is the first reference to that function, it’ll add a relocation record to the object file, which might cause other shifts in the memory layout.

    A more-complex tracing call that calls fwrite or printf, for example, will almost certainly end up allocating some memory for temporary buffers, etc.

    If you can reproduce the bug (with the original code, obviously) when running in the debugger, then you should be able to at least determine which code is triggering the segfault. If the debugger also causes the bug not to happen, you might consider enabling core dumps, and debugging based on the dump.

    Failing that, you can try running the code with a debugging malloc package (there are several available). Even if “the bug” doesn’t reproduce, you’ll likely find some improper pointer manipulation that way.

    Last suggestion: Re-compile your code with all warnings enabled on the compiler, and seriously consider all of the warnings so generated. Note that with gcc, -Wall does not turn on all warnings.

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

Sidebar

Ask A Question

Stats

  • Questions 255k
  • Answers 255k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I could be mis-interpreting your question, but it sounds like… May 13, 2026 at 10:22 am
  • Editorial Team
    Editorial Team added an answer Just as a clearer community answer, because I know I've… May 13, 2026 at 10:22 am
  • Editorial Team
    Editorial Team added an answer This looks right to me. The foo_foos_path helper is generated… May 13, 2026 at 10:22 am

Related Questions

I am just starting up a new project that needs some cross-platform GUI, and
I am working on a solution that aims at solving problems that newbie programmers
Answered : They don't allow any kind of redistribution with 2.6, supposedly, unless you
When coding new javascript heavy websites, which order or web browser do you code
Greetings, everyone. I consider myself to be an intermediate developer, but, to be candid,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.