Closed anmenaga closed 6 years ago
@anmenaga Did you try this:
[Environment]::SetEnvironmentVariable("WIRINGPI_CODES", "1", "Process")
Notice the Process scope.
https://msdn.microsoft.com/en-us/library/96xafkes(v=vs.110).aspx
This is probably related to #29 I guess?
@tomlarse indeed
Oops :)
@tylerl0706 Tried that, but it has no effect - wiringPi not picking it up. By the way, RaspberryIO library already has this line in its Initialize code, but no effect; I think I saw an issue on CoreCLR github about this.
So strange...
Even with this flag, this is still crashing with
*** Error in `pwsh': free(): invalid pointer: 0x76c82694 ***
:( The worst part is that I can't understand when/why
@DanielSSilva can you add the code that's crashing here?
https://gist.github.com/DanielSSilva/ea2d5ddbaffa1ff5576622ea4543badd
It's easier to see here. Like I've said, it does not crash everytime...
@DanielSSilva This error is a signature of issue #29 . In short, there is a bug in error-handling routines of Unosquare.RaspberryIO library. WIRINGPI_CODES flag won't help with this; we actually need to fix RaspberryIO code.
@DanielSSilva please add your link to the issue #29 . It will help to keep everything related to this problem in one place. Thank you.
WiringPi library has a default behavior of terminating current process (e.g. PowerShell) even on non-critical errors in setup functions. For example:
pwsh will crash and throw the error Unable to select I2C device: Device or resource busy.
This PR adds doc instructions on how to avoid such crashes.