WyvernTKC / cpuminer-gr-avx2

Optimised Version of GR miner for RTM
GNU General Public License v2.0
375 stars 195 forks source link

A bug due to missing unlocking #101

Closed ryancaicse closed 2 years ago

ryancaicse commented 2 years ago

It seems the lock release of stats_lock is missing before Line 4857. Should it be a bug?

https://github.com/WyvernTKC/cpuminer-gr-avx2/blob/d2e391d29a0e9a42de2b85c25d51824b58554411/cpu-miner.c#L4841-L4857

michal-zurkowski commented 2 years ago

It is released here: https://github.com/WyvernTKC/cpuminer-gr-avx2/blob/d2e391d29a0e9a42de2b85c25d51824b58554411/cpu-miner.c#L4867

ryancaicse commented 2 years ago

Line 4857 and 4853 have return statements so the function returns with the lock acquired without reaching Line 4867.

michal-zurkowski commented 2 years ago

return from main will close the program entirely. It means it was not able to create threads properly so it does not matter.

ryancaicse commented 2 years ago

OK, thanks for your comments. But it does not harm to releasing locks for code symmetry.