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 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

Related Questions

I'm sure this question is asked a lot but I cannot find an answer
I'm sure there are a lot of people with this problem, but I can't
I use $_SERVER[DOCUMENT_ROOT] a lot to make sure that all my links will work
Sure I've seen this done before but off-hand I can't find any examples. I've
Sure I could write this myself, but before I go reinventing the wheel is
Not sure if this counts as programming related, it's a tool that I use.
Not sure exactly what I need to do to make this work, so my
Not sure why my .plist looks like this when viwed as source code, and
Not sure if I've just missed something but this doesn't work: $(this).children('td.threadtitle a').html('thread title');
I would like to real-hand experienced answer on this. Which one is faster? Writing

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.