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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:50:11+00:00 2026-05-26T11:50:11+00:00

I get a strange problem here, and ask for help. (gdb) 28 set_file_bit( file,

  • 0

I get a strange problem here, and ask for help.

(gdb) 
    28      set_file_bit( file, bytePos, bitPos, argv[1] );
    (gdb) p argv[1]
    $3 = 0xbfffef5c "00"
    (gdb) s
    set_file_bit (file=0x804b008, bytePos=2, bitPos=2, binary=0x80490e5 "11") at util/file.c:112
    112     long int pos = ftell(file);

We can see the value of binary is 0x80490e5, not 0xbfffef5c , why?
argv is the parameter of function main.
some part of function main is

int main( int argc, char** argv ){
    FILE* file = 0;
    file = fopen( "t.txt", "r+" );
    unsigned int bytePos = 2;
    unsigned int bitPos = 2;
    char buff[2] = { 0, 0 };
    get_byte( file, bytePos, 1, buff);
    set_file_bit( file, bytePos, bitPos, argv[1] );

Thanks

  • 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-26T11:50:12+00:00Added an answer on May 26, 2026 at 11:50 am

    The most likely reason is that set_file_bit was compiled with optimization, and the parameters have not been completely set up when GDB stepped into it.

    Try printing binary inside set_file_bit, it will likely be 0xbfffef5c. When debugging optimized code, one frequently sees such artifacts. Rebuild with -O0 to make your debugging easier.

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

Sidebar

Related Questions

I've got a strange problem with a php file. I'm trying to get some
I have a strange problem in my rich client application. Here is some background:
I'm having a strange problem here, and I can't manage to find a good
Have a very strange problem with Apache .htaccess URL Rewriting and Redirection. Here's my
Admittedly, this is a strange problem for me to have, but here is what
The problem is that I use the method file _ get _ contents(body.html) in
Bit of a strange problem here... I've got an update query that isn't working,
I get a strange problem when extracting the selected option of an html drop
Here is a strange problem. In irb, require 'openssl' return true. Went into subdir
I have a strange problem with mod_rewrite, the rules that are relevant here are:

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.