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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:44:10+00:00 2026-05-27T12:44:10+00:00

Through GDB I have determined that the segfault is occuring somewhere in this block

  • 0

Through GDB I have determined that the segfault is occuring somewhere in this block of code.

readInfo(fd)

int fd;

 {
  char str[200];
  while(readInfo(fd,str))
   printf("%s\n",str);
 }

What this code is trying to accomplish is to read information sent to it by a server. I’m not quite sure what the problem is. Any tips would be greatly appreciated.

EDIT: To be more specific:

Program received signal SIGSEGV, Segmentation fault.
0x0804864b in readInfo ()
  • 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-27T12:44:10+00:00Added an answer on May 27, 2026 at 12:44 pm

    I have three tips:

    1. Compile the program with debugging symbols. That way you can see the actual code that you are crashing on, as well as print variable values even after the crash.
    2. Write two functions – the non-recursive version and the recursive version. This isn’t always necessary, but since you’re adding a parameter, it is for you.
    3. Somewhere in there you’re going to actually have to write some code that reads from the file descriptor.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have looked through GDB documentation, but haven't found anything that works or shows
I would like to use GDB to step though the C++ code that makes
We have installed GDB on AIX 6.1 (gdb-6.0-1.aix5.1.ppc_AIX.rpm) and I notice that there is
When I run this code through several entries of a directory, it usually returns
I have been facing a weird issue in a piece of code. void app_ErrDesc(char
I have been playing around with some debugging and wrote some C code that
I am using g++ 4.1.2 and gdb 7.2 I am debugging code that uses
I have been debugging in GDB (C code). The issue is if I run
Say I have the code: std::string str = random; function(str); void function (std::string str)
I'm writing an application that uses GDB to access information through java. Using Runtime.getRuntime.exec,

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.