timeout icon indicating copy to clipboard operation
timeout copied to clipboard

read access violation when running test in virtual studio 2015

Open Kiddinglife opened this issue 9 years ago • 2 comments

Hi wahern,

Exception thrown: read access violation. to->pending was 0x2404943C4E0.

After debugging, I found at line 350 wheel = timeout_wheel(rem); in file timeout.c wheel is 9, which is is the reason why write access violation

However, test runs pretty well in ubuntu 16.04

Regards

Kiddinglife avatar Dec 08 '16 11:12 Kiddinglife

After bebugging, I found the reason

at line 196 in file bitops.c __inline int clz64(uint64_t val) { unsigned long zeros = 0; _BitScanReverse64(&zeros, val); return (int)zeros; }

_BitScanReverse64 is actually fls.

Kiddinglife avatar Dec 09 '16 10:12 Kiddinglife

modify like this can fix it static __inline int clz64(uint64_t val) { DWORD zeros = 0; if (_BitScanReverse64(&zeros, val)) { return 63 - zeros; } else { return 64; } }

andrewChen2014 avatar Dec 22 '17 08:12 andrewChen2014