Closed eriksejr closed 3 years ago
Ah! I just found out why. It's a bug in conn.
https://github.com/periph/conn/blob/v3.6.8/driver/driverreg/driverreg_parallel.go#L76 reads loaded in a separate routine while line 101 writes to it. I guess it's really faster than other platforms because I never detected it elsewhere.
Thanks a lot for the bug report. It made is easy to find the bug.
https://github.com/periph/conn/tree/sync should resolve this. I have to log off now, will investigate tomorrow to get it in and make a new release.
I fixed in 1d85d07b4615168a7cc82950da52504f8317b2fe bug forgot to refer to the bug. I have an on-going PR that I'll try to get committed then I'll tag another release. In the meantime, explicitly fetching this commit should get you going, e.g.:
go get periph.io/x/conn/v3@1d85d07b4615168a7cc82950da52504f8317b2fe
but it's a matter of a few days.
Sorry I didn't reply I was out of town for a while there. Thank you for your efforts, I will try the patched version when I am back at work next week!
Describe the bug I've been running a project which uses the MCP23XXX driver on ARM64 (RPI4) under the race detector to debug a few things. I've fixed all the races I have run into except this one which I hit almost every time the program starts up when host.Init() is called:
Line 137 of wbcmdd.go calls host.Init():
I am also using periph.io for GPIO on the Raspberry Pi 4. When I remove the hardware that uses the MCP23017 chip but call host.Init() to still initialize periph.io for the GPIO I do not see this race. It seems like it may be related to this specific driver.
Note that I am not actually having any issues with the driver or the software, only that I am running into this race being reported when run under the race detector.
Expected behavior No race is reported
Platform (please complete the following information): OS: Raspberry Pi OS 64-bit Board: Raspberry Pi 4 8GB RAM version