Ursprungsmitteilung
Thema XboxController library causing fatal error 
Autor Peach 
Eingangsdatum 2014-06-13 19:15:48.0 
Mitteilung Hi! When I try to implement the XboxController library into my game, it works for a little while, but after a short time crashes and leaves a log. Here's the top part of the log:


# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000021fe959, pid=9440, tid=2148
#
# JRE version: Java(TM) SE Runtime Environment (7.0_55-b13) (build 1.7.0_55-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.55-b03 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# J sun.misc.FloatingDecimal.readJavaFormatString(Ljava/lang/String;)Lsun/misc/FloatingDecimal;
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

I love your implementation and have already written it into my program, but this crash is very frustratingly making it useless :( I'll likely have to go to another implementation if unable to work this out.

Thanks for the help, hope you see this. 
 
      
Antworten
Thema XboxController error 
Autor Aegidius Pluess 
Eingangsdatum 2014-06-16 08:48:31.0 
Mitteilung Thanks for your forum request. I am sorry that you have troubles with my XboxController library. If a sporadic crash is always hard to fix. Try the following:

- I seems that the error is due to a bad conversion of the kind

Double aDouble = Double.parseDouble(aDoubleStr);

I checked my libraries, but I couldn't find this conversion anywhere. Check if you never mix integers and doubles in your code

- Use the full constructor
/**
* Creates a XboxController instance using the given native Windows DLL
* and tries to establish a connection to the controller with the given
* player number.
* @param dll the fully qualified path to the native DLL.
* If the extension .DLL is missing, the DLL is searched in the Windows path.
* @param playerNb the number of the player 1..4
* @param controllerPollPeriod the period (in ms) of the native timer that polls the state of the controller
* @param queuePollPeriod the period (in ms) of the Java timer that polls the message queue
*/
public XboxController(String dll, int playerNb, int controllerPollPeriod, int queuePollPeriod)


and set the controllerPollPeriod and queuePollPeriod to a value greater than the defaults (greater than 50 ms).

- Use the source of XboxController and set the private boolean debug = true. Check what is written to the console, when the crash happens. You also may write debug information to a log file.

-Isolate the code fragment where you think that the crash happens and send it me.

You may reach me also at support@aplu.ch

Hope this helps.

Aegidius