OCCRA
Go to Post This isn't an engineering fair and demonstration, it's FRC. Defense is part of the game. You can't expect a good FRC team to just sit there and get clobbered by a full-court shooter; they're going to engineer a solution to the problem. - Kevin Sevcik [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media  
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 09-20-2018, 05:06 PM
3674 3674 is offline
Registered User
FRC #3674
 
Join Date: Jan 2018
Location: usa
Posts: 39
3674 is an unknown quantity at this point
bus error opencv on jetson tk1

I'm getting a bus error when cvtColor runs, it appears to be cv::Mat &out that is causing it

Code:
void VisionPipeline::hslThreshold(cv::Mat &input, double hue[], double sat[], double lum[], cv::Mat &out) {
	cv::cvtColor(input, out, cv::COLOR_BGR2HLS);
	cv::inRange(out, cv::Scalar(hue[0], lum[0], sat[0]), cv::Scalar(hue[1], lum[1], sat[1]), out);
}
it is being ran by:
Code:
	hslThreshold(hslThresholdInput, hslThresholdHue, hslThresholdSaturation, hslThresholdLuminance, this->hslThresholdOutput);
thanks for any help
Reply With Quote
  #2   Spotlight this post!  
Unread 09-20-2018, 11:05 PM
codedr codedr is offline
Registered User
FRC #0537
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2009
Location: Wisconsin
Posts: 100
codedr will become famous soon enoughcodedr will become famous soon enough
Re: bus error opencv on jetson tk1

A bus error would typically occur if the buffer being written to is not correctly byte aligned.
The arm processor like intel doesn't like it when a 2 or 4 byte entity is written to at an odd byte address.

If you are able to debug the issue with gdb, or the generated core file, you should be able to see the failing instruction. Dumping the target or source address from the register being used in the instruction will probably show an odd valued address.

If it's the out buffer, I would look at how the buffer is being allocated and make sure it is correctly aligned for the data type.
Reply With Quote
  #3   Spotlight this post!  
Unread 09-21-2018, 03:50 PM
3674 3674 is offline
Registered User
FRC #3674
 
Join Date: Jan 2018
Location: usa
Posts: 39
3674 is an unknown quantity at this point
Re: bus error opencv on jetson tk1

here is what i get from gdb:

Code:
Program received signal SIGBUS, Bus error.
0x0000b5d2 in __gnu_cxx::__exchanged_and_add (__mem=0x2, __val=-1)
at /usr/include/c++/4.8/ext/atomicity.h:49
49     { return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
Reply With Quote
  #4   Spotlight this post!  
Unread 09-21-2018, 04:04 PM
3674 3674 is offline
Registered User
FRC #3674
 
Join Date: Jan 2018
Location: usa
Posts: 39
3674 is an unknown quantity at this point
Re: bus error opencv on jetson tk1

0x0000b5d2 appears not to be byte aligned, how would i align it?
Reply With Quote
  #5   Spotlight this post!  
Unread 09-22-2018, 08:32 PM
3674 3674 is offline
Registered User
FRC #3674
 
Join Date: Jan 2018
Location: usa
Posts: 39
3674 is an unknown quantity at this point
Re: bus error opencv on jetson tk1

Ok we fixed it by eliminating some pointers
Reply With Quote
  #6   Spotlight this post!  
Unread 10-19-2018, 04:53 PM
codedr codedr is offline
Registered User
FRC #0537
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2009
Location: Wisconsin
Posts: 100
codedr will become famous soon enoughcodedr will become famous soon enough
Re: bus error opencv on jetson tk1

__mem does not look valid (2). It appears to be an invalid pointer.
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 02:44 AM.

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


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi