robotpy / robotpy-wpilib

Moved to https://github.com/robotpy/mostrobotpy
https://robotpy.github.io
Other
169 stars 59 forks source link

HALInitialize fails with 'Could not initialize HAL' #122

Closed virtuald closed 9 years ago

virtuald commented 9 years ago

Reproduced this way:

I get the following error message, followed by a HALError that says "Could not initialize HAL".

Killing previously running FRC program...
FRC pid 1705 did not die within 110ms. Aborting

If I waited a second and ran it again, by then the other process has died and HALInitialize succeeds. I'm not sure if there's a bad side effect that would happen if we just waited and tried to initialize HAL again. Maybe we shouldn't fix this, but only document it.

This does not occur when doing a deploy via pyfrc, only when starting a program manually.

PeterJohnson commented 9 years ago

Looking at HAL.cpp, you can call HALInitialize(1) to kill -9 the old process, or HALInitialize(2) to just warn instead of fail. It sounds like the timeout should just be a bit longer though.

robobenklein commented 9 years ago

I also get a HALInitialize error.
I do not however get a notification "Killing previously running FRC program..."

To fix this, I just run the code once, let it break, then run it again directly afterwards. It runs exactly as intended.

virtuald commented 9 years ago

@robobenklein do you get the notificatoin when using pyfrc's deploy function, or only when running a program manually?

robobenklein commented 9 years ago

I only see it when I run the code manually.

On Wednesday, January 14, 2015, Dustin Spicuzza notifications@github.com wrote:

@robobenklein https://github.com/robobenklein do you get the notificatoin when using pyfrc's deploy function, or only when running a program manually?

— Reply to this email directly or view it on GitHub https://github.com/robotpy/robotpy-wpilib/issues/122#issuecomment-69935748 .

/Ben Klein Founder & Owner of Robosane Servers http://robosane.net

virtuald commented 9 years ago

Users really don't have a good reason to run code manually, I'm going to close this as wont-fix.