Open langefa opened 7 months ago
I'm bad at valgrind -- do I understand it correctly that the unrecognized instruction is in fmpz_mpoly/void_ring.c
at line 113 in FLINT?
What CFLAGS were used when you compiled it with 3.0.1, and what CFLAGS are being used now? Are they the same or not?
I'm bad at valgrind -- do I understand it correctly that the unrecognized instruction is in
fmpz_mpoly/void_ring.c
at line 113 in FLINT?
Yes, it pritnt a backtrace of calls, the top line is the inner call in the stack
Unless @langefa changed something, it is should be by default, and the flags should be the same. We only pass paths to gmp and mpfr
Okay, so the default CFLAGS where changes some time after that. We increased the optimization level from -O2
to -O3
and added -march=native
(unless cross-compiling). It may be the case that Valgrind simply does not recognize the instruction that were generated (see https://stackoverflow.com/questions/37032339/valgrind-unrecognised-instruction for example).
Is there any recomended way to force specific CFLAGS? I will force their usage in FUEL, so that @langefa can retry (I have not seen the error message)
Assuming you are using Make to build FLINT, yes. For instance,
$ ./configure CFLAGS="-O2"
will set CFLAGS to -O2
, and there may be some other default options that may be put in there too (for instance, --enable-debug
is the default, so -g
will also be added to the CFLAGS unless you specify --disable-debug
).
@albinahlback , thank ypu @langefa , I pushed a commit so that fuel will configure flint with -O2, please give it a try
The CFLAGS are indeed the culprit. -O3
has no impact though, -march=native
is solely responsible. It looks like there is some architecture dependent optimization on my machine that is not compatible with Valgrind.
What is the resolution then? Nothing wrong here in flint, the issue can be closed? I am probably then returning default opitons and you can change them if needed
This is a common problem with valgrind. Before closing the issue, we should add a section to the FLINT docs on using valgrind
including a mention of this problem.
I see, then it's good we reported it.
When running Valgrind on an example for the FUEL library (https://gitlab.com/feynmanintegrals/fuel), it encounters an unhandled instruction:
This did not happen with v3.0.1. However, to fix #1652, FUEL was updated to commit 3ef8253157dd22b1480f7669dbb3684008637ded. I checked that the problem persists with the most recent commit 2318e1bebd5df5723db7e048494ce31bc4baff61 in trunk.
I noticed this in the context of looking into a memory leak in FUEL, see https://gitlab.com/feynmanintegrals/fuel/-/issues/1 and #1676.