0

I am trying to track function call counts on a program I'm interested in. If I run the program on its own, it will run fine. If I try to run it with valgrind using the command seen below I seem to be getting a different result.

Command run: enter image description here

Produces this input immediately, even though the execution is normally slow. enter image description here

dearn44
  • 3,198
  • 4
  • 30
  • 63

2 Answers2

0

valgrind has limited floating point support. You're probably using non-standard or very large floats.

UPDATE: since you're using long double, you're outta luck. Unfortunately,

Your least-worst option is to find a way to make your world work just using standard IEEE754 64-bit double precision.

This probably isn't easy considering you're using an existing project.

Sagar
  • 1,617
  • 9
  • 17
  • It's unlikely to be related to x87 instructions. – Paul Floyd Jun 26 '22 at 07:31
  • @PaulFloyd: The stack trace includes `long_double_max()`. If that's using the C++ `long double` type, that's the 80-bit x87 type even on x86-64, on non-Windows systems. OTOH it's `cpp_dec_float`, so decimal float? IDK, might not be using hardware FP at all. Running under GDB might allow examining the instruction that triggered the exception, or I guess we have the absolute addresses from the backtrace so the OP could disassemble that function. – Peter Cordes Jun 26 '22 at 20:15
  • The project is indeed using `long double`'s – dearn44 Jun 27 '22 at 08:23
0

I'd say that this is more likely to be related to this issue. However to be certain you will need to tell us

  1. what compilation options are being used - specifically are you using anything related to AVX or x87?
  2. What hardware this is running on.

It would help if you can cut this down to a small example and either update this or the frexp bugzilla items.

Paul Floyd
  • 5,530
  • 5
  • 29
  • 43
  • 1
    I'm trying to test this application [https://github.com/gyoto/Gyoto/tree/da5b07150bcdfe0626eb1ed1a2edf5fd5ce13096] and I believe it is using both `long double` types and avx instructions. I am running it on a Linux based VM, that can otherwise run the program on its own. – dearn44 Jun 27 '22 at 08:25
  • It's going to be difficult to find the time/motivation to build that. – Paul Floyd Jun 27 '22 at 09:41
  • I feel you on that – dearn44 Jun 27 '22 at 10:54