Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read access violation when running test in virtual studio 2015 #23

Open
Kiddinglife opened this issue Dec 8, 2016 · 2 comments
Open

Comments

@Kiddinglife
Copy link

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
Copy link
Author

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.

@andrewChen2014
Copy link

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;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants