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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:15:30+00:00 2026-05-25T19:15:30+00:00

I get a segfault in my program and was trying to detect the source

  • 0

I get a segfault in my program and was trying to detect the source via gdb.

O/p of the gdb is as follows:

[Switching to Thread 0xb6dffb70 (LWP 6448)]
#0 0x00adc026 in __strlen_sse2_bsf () from /lib/libc.so/6
#1 0x08049e77 in sim_txn (fd=0x804c5c0) at rand_trace0.c:390

and at rand_trace0.c:390 I have the line

system_call_length = strlen("rename(")+strlen(filename1)+strlen(",")+strlen(filename)+strlen(")")+1;

Everything seems to be working before it.
I am at a loss.

  • 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-25T19:15:31+00:00Added an answer on May 25, 2026 at 7:15 pm

    Are filename1 and filename both valid pointers to null-terminated strings? The most common reason you might get a segfault with that is if your pointer wasn’t properly initialized or if one of the strings isn’t null-terminated (possibly because of a buffer overflow) and thus is resulting in strlen() trying to read past the size of the allocated memory.

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

Sidebar

Related Questions

I get the following error when trying to run the latest Cygwin version of
I'm rewriting an old program to do some new stuff, and suddenly I get
I get a segfault when calling viewTree(root); struct treeElement { unsigned long weight; unsigned
I get a seg fault for the simple program below. It seems to be
I'm trying to achieve a dynamic two dimensional array in C. Whenever the program
I'm trying to debug a Windows program compiled using MinGW's gcc that only ever
I'm trying to write a program which calls a library function ( http://www.diku.dk/hjemmesider/ansatte/pisinger/3dbpp.c )
I'm new to C++ and just trying to get a hang of it. It
This behavior is strange because I could not get the segfault if the shared
During some memory tests I did I got a segfault from the following program:

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.