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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:00:01+00:00 2026-05-30T16:00:01+00:00

I’ve been debugging a segfault in some numerical code (C++, no dependencies on any

  • 0

I’ve been debugging a segfault in some numerical code (C++, no dependencies on any external libraries). I’ve got it reproducing the segfault when compiled at optimization level -O0 (using gcc) and run within gdb; the backtrace I get is:

(gdb) backtrace 2
#0  0x000000000040171c in QExpFloorLog_Q_R (q=Cannot access memory at address 0x7fffff7fefec) at GlobalFunctions.hpp:11
#1  0x0000000000401b50 in MinExponentFromTheoremTwo (q=2, k_q=20 '\024', r=1122053) at GlobalFunctions.hpp:90

The signature of MinExponentFromTheoremTwo is:

unsigned char MinExponentFromTheoremTwo(const unsigned int q, const unsigned char k_q, const unsigned int r);

So, my question is: what am I to make of k_q=20 '\024'? I understand that k_q is an unsigned char, and therefore that gdb is giving me both a numerical value and an ascii representation; I have other places with unsigned char variables listed as var1=0 '\000', var2=1 '\001', etc. But k_q seems mismatched, with a value of 20 and a code of \024. Am I misunderstanding how unsigned char are used, or should this be helping me find the bug in my code?

Incidentally, I have

$ uname -a
Linux clayton-AOD255E 2.6.38-13-generic #53-Ubuntu SMP Mon Nov 28 19:33:45 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
$ g++ --version
g++ (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
$ gdb --version
GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2

Thanks for any and all help!

  • 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-30T16:00:03+00:00Added an answer on May 30, 2026 at 4:00 pm

    The number called twenty is represented in base 10 as ’20’. In base 8, it is ’24’. \024 is the octal representation of that value.

    All of the following are the same value:

    20     // decimal, base-10
    024    // octal, base-8
    '\024' // octal, base-8
    0x14   // hex, base-16
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
i got an object with contents of html markup in it, for example: string
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.