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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:14:29+00:00 2026-05-11T13:14:29+00:00

My application is suspending on a line of code that appears to have nothing

  • 0

My application is suspending on a line of code that appears to have nothing wrong with it, however my IDE appears to be suspending on that line with the error:

gdb/mi (24/03/09 13:36) (Exited. Signal ‘SIGSEGV’ received. Description: Segmentation fault.)

The line of code simply calls a method which has no code in it. Isn’t a segmentation fault when you have a null reference? If so, how can an empty method have a null reference?

This piece of code, seems to be causing the issue:

#include <sys/socket.h>  #define BUFFER_SIZE 256  char *buffer;  buffer = (char*)GetSomePointer()->SomeStackMemoryString.c_str(); int writeResult = write(socketFD, buffer, BUFFER_SIZE);  bzero(buffer, BUFFER_SIZE); int readResult = read(socketFD, buffer, BUFFER_SIZE); 

When the line using the read(...) method is commented out, the problem goes away.

Update:

I have changed the question to point toward the actual problem, and I have removed all the irrelevant code – and I also answered my own question so that people reading this know specifically what the issue is, please read my answer before saying "you’re a moron!".

  • 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. 2026-05-11T13:14:30+00:00Added an answer on May 11, 2026 at 1:14 pm

    Your code is bogus: buffer points to some random piece of memory. I’m not sure why the line with bzero is not failing.

    The correct code is:

       char buffer[BUFFER_SIZE];     bzero(buffer, BUFFER_SIZE);    int readResult = read(socketFD, buffer, BUFFER_SIZE); 

    or you can use calloc(1, BUFFER_SIZE) to get some memory allocated (and zeroed out).

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

Sidebar

Related Questions

I have a web application which uses URLs that look like this: http://library.example.com/Register.aspx?query=academic&key=586c70bb-5683-419c-aae9-e596af9ab66a (The
I have a servlet that has a suspending method and a broadcasting one: @GET
I have an application that reads lines from a file and runs its magic
I have a nice problem. I have an application that suspend the request and
I have an application that takes a bunch of data and processes it in
I have a Winforms application that uses show multiple top-level windows: Form1 form1 =
Application able to record error in OnError, but we are not able to do
Application : HTA (therefore IE) This is an application that uses SendKeys to populate
Application[temp] = 8; should set the value 8 to the key temp . However,
We are running a Java application that sometimes freezes because some thread is using

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.