Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  EXCEPTION_ACCESS_VIOLATION (0xc0000005)  (Read 991 times)
0 Members and 1 Guest are viewing this topic.
Offline Rayexar

Junior Member


Medals: 2
Exp: 5 years



« Posted 2014-08-11 02:50:08 »

I'm getting this error randomly while playing the game I've created in Libgdx. Here's the error log it generated: http://pastebin.java-gaming.org/410373b5b071d

Could anyone explain what it means and how I should try fixing it?

Edit: This is what it says in the console after it crashes: AL lib: (EE) alc_cleanup: 1 device not closed
Offline Dregron
« Reply #1 - Posted 2014-08-11 07:39:50 »

This might make more sense:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.badlogic.gdx.physics.box2d.World.jniCreateBody(JIFFFFFFFFZZZZZF)J+0
j  com.badlogic.gdx.physics.box2d.World.createBody(Lcom/badlogic/gdx/physics/box2d/BodyDef;)Lcom/badlogic/gdx/physics/box2d/Body;+80
j  com.rayexar.slimeblaster.Projectile.initialise()V+24
j  com.rayexar.slimeblaster.weapons.ElectricBlast.fire(FFLcom/rayexar/slimeblaster/entities/Entity;I)V+82
j  com.rayexar.slimeblaster.entities.Entity.attackWeapon()V+89
j  com.rayexar.slimeblaster.InputHandler.keyUp(I)Z+240
J 1065 C1 com.badlogic.gdx.backends.lwjgl.LwjglInput.processEvents()V (478 bytes) @ 0x0000000002a94dc4 [0x0000000002a94820+0x5a4]
j  com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop()V+557
j  com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run()V+27
v  ~StubRoutines::call_stub


Think this is due to creating a body while World is locked if it is then
maybe:

1  
if (world.isLocked()) return;

The trouble with programmers is that you can never tell what a programmer is doing until it’s too late.
Offline PandaMoniumHUN

JGO Coder


Medals: 31
Exp: 3 years


White-bearded OGL wizard


« Reply #2 - Posted 2014-08-11 07:41:46 »

What JVM are you using? Oracle or OpenJDK? OpenJDK has many bugs and I wouldn't recommend using it.
Also it can be caused by a JNI call where you are doing something "bad" (eg. trying to access memory that doesn't belong to your application). I usually got this kind of errors when I forgot to flip my buffers before uploading them to the GPU.
If you scan through your code and you can't see anything bad try to reinstall your JRE.

My Blog | Jumpbutton Studio - INOP Programmer
Can't stress enough: Don't start game development until you haven't got the basics of programming down! Pointing
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Rayexar

Junior Member


Medals: 2
Exp: 5 years



« Reply #3 - Posted 2014-08-11 07:54:47 »

Hey,

Thank you both for the replies, I really didn't expect to get any replies because this problem seemed uncommon.

Can I find out where the body is being created while the world is locked? The game seems to crash when I fire a "bullet", but I've added a check using if (!world.isLocked()) before creating a body.

I'm using the Oracle JDK, and I've just reinstalled JRE and the problem is still there.

I can see that it's crashing at Projectile.initialise(), but I'm checking the whole initialise() method to make sure that world.isLocked() is false.

The error is being trigged in here somewhere:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
public void initialise() {

      if (!world.isLocked()) {
            Gameplay.worldBusy = true;
            shape.setAsBox(hwidth, hheight);
            body = world.createBody(bodyDef);
            body.setTransform(initPos.x, initPos.y, 0);
            fixture = body.createFixture(fixtureDef);
            body.applyLinearImpulse(initImpulse, body.getLocalCenter(),
                  true);
            Gameplay.worldBusy = false;
      }
   }

but I can't see a problem with it. I'm already checking that the world isn't locked. Can anyone see a problem that would cause the error?

I've even made sure that the world doesn't step if the boolean worldBusy is true, so it can't be creating a body while stepping.

Edit: Well I've spent pretty much the whole day trying to solve this but still can't Sad. Is there a temporary solution to suppress this error (kinda like how you would catch an exception), so that the program will keep running?

I've been playing around with the game, and it seems to crash when I try to fire while a Projectile(body) is being destroyed at the same time. Can't say for sure that this is the problem, but it feels like it when playing. For now I'm just going to make the projectiles that the weapons fire sensors; hopefully that'll get rid of the problem for now.
Online princec

JGO Kernel


Medals: 378
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #4 - Posted 2014-08-11 17:27:53 »

What JVM are you using? Oracle or OpenJDK? OpenJDK has many bugs and I wouldn't recommend using it.
Er, wut? That's news to me.

Cas Smiley

Offline PandaMoniumHUN

JGO Coder


Medals: 31
Exp: 3 years


White-bearded OGL wizard


« Reply #5 - Posted 2014-08-11 18:56:28 »

Er, wut? That's news to me.

Cas Smiley
Well, "many" might have been a little extreme. It's not that bad, but compared to Oracle JDK I've experienced way more issues in OpenJDK.

My Blog | Jumpbutton Studio - INOP Programmer
Can't stress enough: Don't start game development until you haven't got the basics of programming down! Pointing
Offline 65K
« Reply #6 - Posted 2014-08-11 19:08:28 »

I've been playing around with the game, and it seems to crash when I try to fire while a Projectile(body) is being destroyed at the same time.
What does "at the same time" mean ? Are you messing with multiple threads ?

Offline Rayexar

Junior Member


Medals: 2
Exp: 5 years



« Reply #7 - Posted 2014-08-11 23:41:24 »

What does "at the same time" mean ? Are you messing with multiple threads ?

The bullets get destroyed when they hit an enemy, or after a period of time. I think the Timer I use creates a new thread
Offline 65K
« Reply #8 - Posted 2014-08-12 06:30:16 »

I think the Timer I use creates a new thread
Then you need to properly synchronize access to the Box2d world object.
Or much better, do not use timers and multiple threads at all.

Pages: [1]
  ignore  |  Print  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (15 views)
2014-09-19 03:14:18

Dwinin (33 views)
2014-09-12 09:08:26

Norakomi (58 views)
2014-09-10 13:57:51

TehJavaDev (80 views)
2014-09-10 06:39:09

Tekkerue (40 views)
2014-09-09 02:24:56

mitcheeb (63 views)
2014-09-08 06:06:29

BurntPizza (46 views)
2014-09-07 01:13:42

Longarmx (33 views)
2014-09-07 01:12:14

Longarmx (37 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!