Go to Post Ask questions; don't be afraid to talk to "powerhouse" teams. - CalTran [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 25-06-2015, 22:57
maglax's Avatar
maglax maglax is offline
Registered User
AKA: Michael Glass
FRC #3966 (L&N STEMpunks)
Team Role: Engineer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: United States
Posts: 7
maglax is an unknown quantity at this point
An Enjoyable(Not) Java Compiler Error (Stack Guard) and ELFCLASS32 *Not Solved*

Whenever I try to run a project, my debug window shows a Java Stack Guard Error. This one to be exact:
Code:
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /tmp/libwpilibJavaJNI4147524003046367514.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/libwpilibJavaJNI4147524003046367514.so: /tmp/libwpilibJavaJNI4147524003046367514.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
I have tried installing the official version of Java (Versus openjdk (I run ubuntu)), and uninstalling and purging every version of java from my system and reinstalling the official java release. Then I started to pay more attention the the error and saw that it asked me to run
Code:
execstack -c /tmp/libwpilibJavaJNI4147524003046367514.so
so I did (after installing execstack of course) but it could not find the file sadly because it was a temp file so was gone already.

Paying attention to the file I see it is wpilib related. I have been using the toast api, but it doesn't look like it was that. I also had a failed installation of frcsim (I have Ubuntu 15.04 not 14.04 so it would not work ): )

Has anyone had this problem and fixed it or know how to fix it? Is this frcsim related or toast or wbilib error or something I am unaware of?

Any help is appreciated. Thanks in advance!



/*
*----------EDIT----------
*
*/

It appears that the Stack Guard error may be caused by
Code:
the wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
. After some googling I found that it is related to my system architecture (32 bit vs 64). Am I correct in saying that wpilib is not architecture specific? Most of the fixes I have seen for this involve rebuilding a file, but I don't know if I can do this for wpilpb. Any sugestions?

Last edited by maglax : 26-06-2015 at 03:05. Reason: More information
Reply With Quote
  #2   Spotlight this post!  
Unread 26-06-2015, 11:44
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: An Enjoyable(Not) Java Compiler Error (Stack Guard)

Are you accidently trying to run the code on the simulator (by choosing the "WPILib Java Simulation" rather than "WPILib Java Deploy" in the Run As dialog or some other reason)?

That is the only reason I could think of that a native library would be needed on your computer. If you are using a 64bit Java VM, then loading the 32bit simulation library could possibly cause this issue.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote
  #3   Spotlight this post!  
Unread 26-06-2015, 17:12
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 543
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: An Enjoyable(Not) Java Compiler Error (Stack Guard)

Quote:
Originally Posted by lopsided98 View Post
Are you accidently trying to run the code on the simulator (by choosing the "WPILib Java Simulation" rather than "WPILib Java Deploy" in the Run As dialog or some other reason)?

That is the only reason I could think of that a native library would be needed on your computer. If you are using a 64bit Java VM, then loading the 32bit simulation library could possibly cause this issue.
This is what I think too. The key here is

Quote:
JNI
You shouldn't be invoking the JNI at all...

e/ well maybe the compiled file invokes the JNI on the roboRIO but it shouldn't be executed compile-tile
__________________
FRC Team 1684 - Head Programmer (2013-2016)
FRC Team 5460 - Programming Mentor (2015-2016)

FIRST in Michigan - Technical Crew (2015-continuing)
Reply With Quote
  #4   Spotlight this post!  
Unread 26-06-2015, 17:46
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: An Enjoyable(Not) Java Compiler Error (Stack Guard)

This is just the jar that contains the robot code for the roboRIO trying to run on your machine, which is wrong.

You need to deploy the jar to your robot. I think you can do this in Eclipse with the WPILib plugins by right clicking on the project then Run As > WPILib Java Deploy.

Alternatively, you can run 'ant deploy' on the command line in your source directory.
Reply With Quote
  #5   Spotlight this post!  
Unread 26-06-2015, 17:52
maglax's Avatar
maglax maglax is offline
Registered User
AKA: Michael Glass
FRC #3966 (L&N STEMpunks)
Team Role: Engineer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: United States
Posts: 7
maglax is an unknown quantity at this point
Re: An Enjoyable(Not) Java Compiler Error (Stack Guard)

Quote:
Originally Posted by Tom Bottiglieri View Post
This is just the jar that contains the robot code for the roboRIO trying to run on your machine, which is wrong.

You need to deploy the jar to your robot. I think you can do this in Eclipse with the WPILib plugins by right clicking on the project then Run As > WPILib Java Deploy.

Alternatively, you can run 'ant deploy' on the command line in your source directory.
I am trying to run the toast api simulation, which involves changing the run configuration to include the argument "-sim 'my main class'". So I do need to run it on my computer.

Last edited by maglax : 26-06-2015 at 18:02.
Reply With Quote
  #6   Spotlight this post!  
Unread 26-06-2015, 18:26
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: An Enjoyable(Not) Java Compiler Error (Stack Guard)

Quote:
Originally Posted by maglax View Post
I am trying to run the toast api simulation, which involves changing the run configuration to include the argument "-sim 'my main class'". So I do need to run it on my computer.
It looks like this bug might be specific to Toast and how you have your system set up, so you might get more help by talking to the Toast API developer directly, as not many people on CD have used Toast.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote
  #7   Spotlight this post!  
Unread 26-06-2015, 23:58
Jaci's Avatar
Jaci Jaci is offline
Registered User
AKA: Jaci R Brunning
FRC #5333 (Can't C# | OpenRIO)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Perth, Western Australia
Posts: 259
Jaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond repute
Re: An Enjoyable(Not) Java Compiler Error (Stack Guard)

Hey there, I'm the Dev behind Toast. The problem you're having is indeed related to Toast. If you're running Eclipse or IntelliJ IDEA (and have the latest version of the Toast Release), running 'gradlew eclipse' or 'gradlew idea' should be enough to generate the Run Configurations for you.

Alternatively, adding the argument '-sim --search' or '-sim [your.robot.Class]' should be enough to make Toast both start in Simulation Mode and find your ToastModule class. If you're running from the command line, these arguments are just appended to the command, i.e. 'java -jar Toast.jar -sim --search'. In Eclipse and IntelliJ IDEA, this is found under the 'Launch Configurations' window.

Hopefully this fixes everything, have fun!
__________________
Jacinta R

Curtin FRC (5333+5663) : Mentor
5333 : Former [Captain | Programmer | Driver], Now Mentor
OpenRIO : Owner

Website | Twitter | Github
jaci.brunning@gmail.com
Reply With Quote
  #8   Spotlight this post!  
Unread 27-06-2015, 00:41
maglax's Avatar
maglax maglax is offline
Registered User
AKA: Michael Glass
FRC #3966 (L&N STEMpunks)
Team Role: Engineer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: United States
Posts: 7
maglax is an unknown quantity at this point
Re: An Enjoyable(Not) Java Compiler Error (Stack Guard)

Quote:
Originally Posted by Jaci View Post
Hey there, I'm the Dev behind Toast. The problem you're having is indeed related to Toast. If you're running Eclipse or IntelliJ IDEA (and have the latest version of the Toast Release), running 'gradlew eclipse' or 'gradlew idea' should be enough to generate the Run Configurations for you.

Alternatively, adding the argument '-sim --search' or '-sim [your.robot.Class]' should be enough to make Toast both start in Simulation Mode and find your ToastModule class. If you're running from the command line, these arguments are just appended to the command, i.e. 'java -jar Toast.jar -sim --search'. In Eclipse and IntelliJ IDEA, this is found under the 'Launch Configurations' window.

Hopefully this fixes everything, have fun!


So just checking, I should have my workspace located in the release folder of the Toast API directory and that is where ./gradlew eclipse should be run?

It may also be that I am understanding toast wrong? Do I program it the same way as a regular robot?

Last edited by maglax : 27-06-2015 at 00:52.
Reply With Quote
  #9   Spotlight this post!  
Unread 27-06-2015, 00:55
Jaci's Avatar
Jaci Jaci is offline
Registered User
AKA: Jaci R Brunning
FRC #5333 (Can't C# | OpenRIO)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Perth, Western Australia
Posts: 259
Jaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond reputeJaci has a reputation beyond repute
Re: An Enjoyable(Not) Java Compiler Error (Stack Guard)

The Toast Repository shouldn't be downloaded for your module. Download the Universal Release and extract the Toast.zip file to where you wish to have your module. From there you can run ./gradlew eclipse and your Module will be setup for you.
__________________
Jacinta R

Curtin FRC (5333+5663) : Mentor
5333 : Former [Captain | Programmer | Driver], Now Mentor
OpenRIO : Owner

Website | Twitter | Github
jaci.brunning@gmail.com
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 12:00.

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