Research, development and trades concerning the powerful Proxmark3 device.
Remember; sharing is caring. Bring something back to the community.
"Learn the tools of the trade the hard way." +Fravia
You are not logged in.
Time changes and with it the technology
Proxmark3 @ discord
Users of this forum, please be aware that information stored on this site is not private.
Hangs in several commands (e.g. "hf mf chk" or "hf mf nested" with option "t") are caused by a compiler optimization.
Reason: in proxmark.c there is an empty while loop
while(txcmd_pending);
which should wait until a previos (pending) USB-Command is transmitted to the proxmark. The parallel threat responsible for the USB-communication would then set txcmd_pending to false and the while loop would be ended.
Unfortunately the compiler doesn't know about parallel threats and therefore optimizes the loop to nothing for txcmd_pending==false and an infinite loop for txcmd_pending==true. The latter then results in the observed hangs.
Simply declaring txcmd_pending as volatile prevents the compiler from optimizing the loop and fixes this issue:
Index: C:/proxmark3/client/proxmark3.c
===================================================================
--- C:/proxmark3/client/proxmark3.c (revision 730)
+++ C:/proxmark3/client/proxmark3.c (working copy)
@@ -26,7 +26,7 @@
static serial_port sp;
static UsbCommand txcmd;
-static bool txcmd_pending = false;
+volatile static bool txcmd_pending = false;
void SendCommand(UsbCommand *c) {
#if 0
This probably fixes the shitty issue https://code.google.com/p/proxmark3/issues/detail?id=45 as well.
Can one of the committers please check and commit.
(tested on SVN 730, Windows 8 x64, mingw)
Offline
Thanks! Committed as r731
Offline