FIRST-Tech-Challenge / SkyStone

FTC SDK
https://www.firstinspires.org/robotics/ftc/what-is-first-tech-challenge
277 stars 1.04k forks source link

RobotLog.logMatch() sometimes crashes EventLoop when restarting robot while OpMode is running #88

Closed Windwoes closed 4 years ago

Windwoes commented 5 years ago

Sometimes RobotLog.logMatch() will crash the EventLoop with a NullPointerException if the robot is restarted while an OpMode is running. Most of the time the exception is caught and handled just as if the user code had crashed, but occasionally the entire app will go down. Here's the stacktrace:


2019-10-14 20:36:52.495 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager: Event loop threw an exception
2019-10-14 20:36:52.505 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.Calendar.get(int)' on a null object reference
2019-10-14 20:36:52.507 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager:     at com.qualcomm.robotcore.util.RobotLog.logMatch(RobotLog.java:637)
2019-10-14 20:36:52.512 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager:     at com.qualcomm.robotcore.util.RobotLog.stopMatchLogging(RobotLog.java:608)
2019-10-14 20:36:52.519 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager:     at org.firstinspires.ftc.robotcore.internal.opmode.OpModeManagerImpl.stopActiveOpMode(OpModeManagerImpl.java:286)
2019-10-14 20:36:52.520 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager:     at com.qualcomm.ftccommon.FtcEventLoop.processOpModeStopRequest(FtcEventLoop.java:403)
2019-10-14 20:36:52.521 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager:     at com.qualcomm.ftccommon.FtcEventLoop.loop(FtcEventLoop.java:206)
2019-10-14 20:36:52.523 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager:     at com.qualcomm.robotcore.eventloop.EventLoopManager$EventLoopRunnable$1.run(EventLoopManager.java:301)
2019-10-14 20:36:52.524 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager:     at com.qualcomm.robotcore.util.ThreadPool.logThreadLifeCycle(ThreadPool.java:737)
2019-10-14 20:36:52.526 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager:     at com.qualcomm.robotcore.eventloop.EventLoopManager$EventLoopRunnable.run(EventLoopManager.java:244)
2019-10-14 20:36:52.528 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager:     at com.qualcomm.robotcore.eventloop.EventLoopManager$1.run(EventLoopManager.java:569)
2019-10-14 20:36:52.529 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
2019-10-14 20:36:52.530 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
2019-10-14 20:36:52.530 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager:     at com.qualcomm.robotcore.util.ThreadPool$ThreadFactoryImpl$1.run(ThreadPool.java:793)
2019-10-14 20:36:52.531 15358-15850/com.qualcomm.ftcrobotcontroller E/EventLoopManager:     at java.lang.Thread.run(Thread.java:761)
2019-10-14 20:36:52.531 15358-15850/com.qualcomm.ftcrobotcontroller V/RobotCore: RobotCoreException in EventLoopManager: EventLoop Exception in loop(): NullPointerException - Attempt to invoke virtual method 'int java.util.Calendar.get(int)' on a null object reference
2019-10-14 20:36:52.531 15358-15850/com.qualcomm.ftcrobotcontroller V/RobotCore: EventLoopManager state is EMERGENCY_STOP
2019-10-14 20:36:52.532 15358-15850/com.qualcomm.ftcrobotcontroller V/RobotCore: Robot Status: EMERGENCY STOP
Windwoes commented 4 years ago

Fixed in v5.4