Go to Post If there is water in the 2006 game, I will blame it on Gary. - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-01-2017, 22:54
Bradley Boxer's Avatar
Bradley Boxer Bradley Boxer is offline
Registered User
AKA: Bradley Boxer
FRC #0303 (TEST Team 303)
Team Role: Programmer
 
Join Date: May 2015
Rookie Year: 2015
Location: United States
Posts: 26
Bradley Boxer is an unknown quantity at this point
Exclamation OpenCV Crashing?!

We used GRIP to generate a vision pipeline (java), and then overlay the first two contours it sees onto a SmartDashboard camera feed. Last week, this was working great.

This week, we noticed sporadic and mysterious drops in comms with the RoboRio. When this happens, the driver station (and the computer) stops being able to ping the RoboRio until the robot is either rebooted or the Rio reset. The camera code has not changed from last week to now, but we have updated WPILib to 2017.2 and set up a PID loop on a CANTalon.

As to investigating the source of the error, we have USB'd into the Rio after a crash and looked at the FRC log, and there we found a java error with a message about further information at /tmp/hs_err_pid1429.log. The log at this location is as follows:
Code:
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0x7) at pc=0xad323b9a, pid=1429, tid=2892047456
#
# JRE version: Java(TM) SE Embedded Runtime Environment (8.0_06-b23) (build 1.8.0_06-b23)
# Java VM: Java HotSpot(TM) Embedded Client VM (25.6-b23 mixed mode linux-arm )
# Problematic frame:
# C  [libopencv_core.so.3.1+0x14bb9a]  cv::_OutputArray::create(int, int const*, int, int, bool, int) const+0x8b1
#
# Core dump written. Default location: //core or core.1429 (max size 2048 kB). To ensure a full core dump, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0xacd68000):  JavaThread "Thread-0" daemon [_thread_in_native, id=1468, stack(0xac5c3000,0xac613000)]

siginfo:si_signo=SIGBUS: si_errno=0, si_code=1 (BUS_ADRALN), si_addr=0x00000056

Registers:
  r0  = 0x00000000
  r1  = 0x00de0000
  r2  = 0xac6117d0
  r3  = 0x00000056
  r4  = 0x0000001c
  r5  = 0xffffffff
  r6  = 0xac611988
  r7  = 0x00000002
  r8  = 0x00000001
  r9  = 0x0000003c
  r10 = 0xab345ef0
  fp  = 0x00000001
  r12 = 0xad381a2c
  sp  = 0xac611570
  lr  = 0xad323edf
  pc  = 0xad323b9a
  cpsr = 0x00070030

Top of Stack: (sp=0xac611570)
0xac611570:   00000000 00000000 ac6117d0 0000001c
0xac611580:   fffffffe 00000000 00000000 00000000
0xac611590:   ae071130 ab3a78d8 00000000 00000000
0xac6115a0:   00000000 00000002 00000000 00000167
0xac6115b0:   0000a7d0 ad10dc84 ad10dc84 ad10dc84
0xac6115c0:   00000000 00000000 ac6115a8 ac6115d0
0xac6115d0:   000001e0 00000001 42ff4000 00000002
0xac6115e0:   00000000 00000000 00000000 00000000 

Instructions: (pc=0xad323b9a)
0xad323b7a:   f8cd4649 f6d2c000 4648ed02 ec9cf6d2
0xad323b8a:   3024f8da 330cb173 8f5ff3bf 2f00e853
0xad323b9a:   e8431e51 28001000 2a01d1f8 8f5ff3bf
0xad323baa:   85e1f000 2004f8da f8ca2300 429a3024 

Register to memory mapping:

  r0  = 0x00000000
0x00000000 is an unknown value

  r1  = 0x00de0000
0x00de0000 is an unknown value

  r2  = 0xac6117d0
0xac6117d0 is pointing into the stack for thread: 0xacd68000

  r3  = 0x00000056
0x00000056 is an unknown value

  r4  = 0x0000001c
0x0000001c is an unknown value

  r5  = 0xffffffff
0xffffffff is an unknown value

  r6  = 0xac611988
0xac611988 is pointing into the stack for thread: 0xacd68000

  r7  = 0x00000002
0x00000002 is an unknown value

  r8  = 0x00000001
0x00000001 is an unknown value

  r9  = 0x0000003c
0x0000003c is an unknown value

  r10 = 0xab345ef0
0xab345ef0 is an unknown value

  fp  = 0x00000001
0x00000001 is an unknown value

  r12 = 0xad381a2c
0xad381a2c: <offset 0x1a9a2c> in /usr/local/frc/lib/libopencv_core.so.3.1 at 0xad1d8000

  sp  = 0xac611570
0xac611570 is pointing into the stack for thread: 0xacd68000

  lr  = 0xad323edf
0xad323edf: _ZNK2cv12_OutputArray6createEiPKiiibi+0xbf6 in /usr/local/frc/lib/libopencv_core.so.3.1 at 0xad1d8000

  pc  = 0xad323b9a
0xad323b9a: _ZNK2cv12_OutputArray6createEiPKiiibi+0x8b1 in /usr/local/frc/lib/libopencv_core.so.3.1 at 0xad1d8000



Stack: [0xac5c3000,0xac613000],  sp=0xac611570,  free space=313k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libopencv_core.so.3.1+0x14bb9a]  cv::_OutputArray::create(int, int const*, int, int, bool, int) const+0x8b1
I have never really had any experience with debugging this low level, and best I've been able to ascertain is that the library libopencv_core.so.3.1 is crashing. Any help would be greatly appreciated.
__________________
The opinions expressed in this post are mine and do not necessarily reflect those of my team.
Reply With Quote
  #2   Spotlight this post!  
Unread 25-01-2017, 01:14
balloman balloman is offline
Sophomore Programmer
AKA: Bernard
FRC #0034 (Rockets)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Athens, AL
Posts: 17
balloman is on a distinguished road
Re: OpenCV Crashing?!

I don't know much about GRIP as we are using c++ OpenCV, but it looks like when you drop the frames, OpenCV gets images that it can't use and it crashes the program. Is there anything in particular you are doing with the bot before it crahes?
Reply With Quote
  #3   Spotlight this post!  
Unread 25-01-2017, 06:55
Bradley Boxer's Avatar
Bradley Boxer Bradley Boxer is offline
Registered User
AKA: Bradley Boxer
FRC #0303 (TEST Team 303)
Team Role: Programmer
 
Join Date: May 2015
Rookie Year: 2015
Location: United States
Posts: 26
Bradley Boxer is an unknown quantity at this point
Re: OpenCV Crashing?!

90% if the times it crashes, the robot is just standing still. Sometimes it is pointed at retroreflective tape (so it tries to draw contours) but sometimes it is not.

Our camera has been dropping out once in awhile (for about 500ms here and there), but I didn't think it would matter, since our code continues the thread before the pipeline if cvSink.grabFrame(mat) is equal to zero.

Additionally the Rio doesn't crash every time the camera drops, so this didn't make sense to me as the cause of the issue. I could be wrong, though.
__________________
The opinions expressed in this post are mine and do not necessarily reflect those of my team.
Reply With Quote
  #4   Spotlight this post!  
Unread 25-01-2017, 10:11
SamCarlberg's Avatar
SamCarlberg SamCarlberg is offline
GRIP, WPILib. 2084 alum
FRC #2084
Team Role: Mentor
 
Join Date: Nov 2015
Rookie Year: 2009
Location: MA
Posts: 151
SamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to behold
Re: OpenCV Crashing?!

Can you share your project? A zip of the eclipse project or a link to a commit on github would be fine
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote
  #5   Spotlight this post!  
Unread 25-01-2017, 11:41
Bradley Boxer's Avatar
Bradley Boxer Bradley Boxer is offline
Registered User
AKA: Bradley Boxer
FRC #0303 (TEST Team 303)
Team Role: Programmer
 
Join Date: May 2015
Rookie Year: 2015
Location: United States
Posts: 26
Bradley Boxer is an unknown quantity at this point
Re: OpenCV Crashing?!

Our GitHub link to our last camera code update is https://github.com/Team303/Java-Robo...986e305d8e4b52. The class running camera and OpenCV code is Camera, and our generated pipeline is BoilerPipeline.
__________________
The opinions expressed in this post are mine and do not necessarily reflect those of my team.
Reply With Quote
  #6   Spotlight this post!  
Unread 25-01-2017, 12:25
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,386
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: OpenCV Crashing?!

I have seen OpenCV projects crash many times before, but I have never run them on the RoboRio. When they crash, there is usually a solid reason. Sometimes though, it appears random, but when you get to the root of it, it also becomes solid as well.

Out of curiosity, what USB camera make and model are you using?
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
Reply With Quote
  #7   Spotlight this post!  
Unread 25-01-2017, 15:11
Bradley Boxer's Avatar
Bradley Boxer Bradley Boxer is offline
Registered User
AKA: Bradley Boxer
FRC #0303 (TEST Team 303)
Team Role: Programmer
 
Join Date: May 2015
Rookie Year: 2015
Location: United States
Posts: 26
Bradley Boxer is an unknown quantity at this point
Re: OpenCV Crashing?!

We are using an IP Camera (Axis M1011).
__________________
The opinions expressed in this post are mine and do not necessarily reflect those of my team.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 15:30.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi