You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the provided bare bones application below, the program allocates 64 Mesh objects. When it terminates everything is fine.
However if the num_mesh is set to 65 or more, then upon program termination I receive:
double free or corruption (fasttop)
Aborted (core dumped)
Note that, in my actual program I create thousands of Mesh objects. And they render fine. It is only when the program terminates that the double free or corruption occurs. It does not matter if I call dispose() on the mesh objects or not.
import com.badlogic.gdx.Game;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
import com.badlogic.gdx.graphics.Mesh;
import com.badlogic.gdx.graphics.VertexAttribute;
import com.badlogic.gdx.graphics.VertexAttributes.Usage;
public class DesktopLauncher {
public static class Barebones extends Game {
Mesh[] meshes;
@Override
public void create () {
int num_mesh=64;
meshes=new Mesh[num_mesh];
for(int i=0;i<num_mesh;i++){
meshes[i]=new Mesh(true,10,10,
new VertexAttribute(Usage.Position,3,"a_position"),
new VertexAttribute(Usage.Normal,3,"a_normal"),
new VertexAttribute(Usage.TextureCoordinates,2,"a_texCoord0"));
}
}
@Override
public void render () {
super.render();
}
}
public static void main (String[] arg) {
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
config.setWindowedMode(1600, 960);
config.setResizable(false);
config.useVsync(true);
config.setForegroundFPS(60);
config.setTitle("My GDX Game");
new Lwjgl3Application(new Barebones(), config);
}
}
Please select the affected platforms
[X ] Linux
The text was updated successfully, but these errors were encountered:
It definitely seems like a bug, I just can't reproduce it on Windows 10, with Java 17 or Java 8. Linux could be a completely different can of worms, but I don't have a working Linux machine at this moment.
What Java version were you using when you encountered this? It may have to do with the behavior of finalizers, which is different in Java 8 and lower vs. in Java 9 and higher.
I can't reproduce on my machine (using OpenSuse Tumbleweed). Which version of Ubuntu are you using? It might be something to do with distro library versions or the distro provided JDK
In the provided bare bones application below, the program allocates 64 Mesh objects. When it terminates everything is fine.
However if the
num_mesh
is set to 65 or more, then upon program termination I receive:Note that, in my actual program I create thousands of Mesh objects. And they render fine. It is only when the program terminates that the double free or corruption occurs. It does not matter if I call
dispose()
on the mesh objects or not.Please select the affected platforms
The text was updated successfully, but these errors were encountered: