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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:40:28+00:00 2026-06-12T22:40:28+00:00

I am having trouble with a bug caused by overwriting a pointer with an

  • 0

I am having trouble with a bug caused by overwriting a pointer with an invalid value. I have not been able to find the bug using valgrind (in it’s default mode) or with GDB because they only point me to the invalid pointer, and NOT what overwrote that pointer to the incorrect value.

It’s always the same variable, however, I do not explicitly set it to the bad value. Some other line in the program must be accessing memory out of it’s bounds but by chance it happens to hit the storage for this pointer instead.

I am unsure what debugging tools/options I should use to approach this bug.

Example crash:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff6ffc700 (LWP 2425)]
0x00000000004058b2 in writeToConn (conn=0x7ffff0004f40) at streamHandling.c:115
115             ssize_t result = send(conn->fd, conn->head->data->string + position, conn->head->data->size - position, 0);
(gdb) print conn
$1 = (struct connection *) 0x7ffff0004f40
(gdb) print conn->head->data
$2 = (struct dbstring *) 0x35

Unfortunately I can’t simply watch the variable conn->head->data because I have about 5,000 conn structs.

This code works most of the time, however if run under a moderately heavy load it will crash after a few seconds.

  • 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-12T22:40:29+00:00Added an answer on June 12, 2026 at 10:40 pm

    You can have gdb automatically execute commands when a breakpoint is triggered, with Break Commands.

    You could set up a Break Command to run whenever a struct connection is allocated, and have it add a watchpoint on the field of interest.

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

Sidebar

Related Questions

I'm having trouble finding a list of the changes and bug fixes that have
Having Trouble with Entity Framework. I have been populating EntityReferences with an EntityKey inorder
I have a very subtle bug that I'm having trouble identifying. Background: We have
I'm having trouble reproducing a bug where I get a null pointer exception when
I have a recursive function with a bug that I am having trouble with.
I'm having trouble with a gradient drawing call. I have a Form that looks
I'm having trouble setting up multicast transport using ActiveMQ. I noticed with version 5.2
I'm having some trouble identifying a bug on the website I'm developing. To be
I'm having trouble using a template bound multiple times. For instance this is fine:
I am having trouble using Visio 14.0 Drawing Control (Visio 2010) in Visual Studio

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.