You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There appears to be a concurrency bug in p2app that can be caused passing the -O3 or -O2 flags to gcc via the Makefile. These flags should let the compiler produce more optimized code, including by reordering instructions in a way it believes won't change the program semantics.
When connecting via Thetis v2.10.3.6 dev_3, if I transmit, the power reading meter shows 0W. If I recompile p2app without -O2 or -O3 (gcc will use -O1 by default) & run it, Thetis shows the correct transmit power.
This suggests there's a critical section that isn't synchronized somewhere, or some other undefined behavior that p2app is relying on when it shouldn't. We should fix it, since relying on the compiler to order things in a certain way is dangerous and it's only a matter of time before it crops up again in another setting. This also limits using -O2 and -O3, which we could use to produce more efficient executables.
The text was updated successfully, but these errors were encountered:
dchristle
changed the title
Transmit power reading incorrect when compiling p2app with -O3 flag
Transmit power reading incorrect when compiling p2app with -O3 & -O2 flags
Aug 7, 2024
There appears to be a concurrency bug in p2app that can be caused passing the
-O3
or-O2
flags to gcc via the Makefile. These flags should let the compiler produce more optimized code, including by reordering instructions in a way it believes won't change the program semantics.When connecting via Thetis v2.10.3.6 dev_3, if I transmit, the power reading meter shows 0W. If I recompile p2app without
-O2
or-O3
(gcc will use-O1
by default) & run it, Thetis shows the correct transmit power.This suggests there's a critical section that isn't synchronized somewhere, or some other undefined behavior that p2app is relying on when it shouldn't. We should fix it, since relying on the compiler to order things in a certain way is dangerous and it's only a matter of time before it crops up again in another setting. This also limits using
-O2
and-O3
, which we could use to produce more efficient executables.The text was updated successfully, but these errors were encountered: