eclipse Android Libgdx 致命信号 11(SIGSEGV),代码 1,故障地址 0x0
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28733068/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android Libgdx Fatal signal 11(SIGSEGV) ,code 1, fault addr 0x0
提问by Nemo_Sol
I know this is an error with accessing memory outside the readspace but i have absolutely no idea how to fix this. I'm new to android, so i don't exactly know how to print out a more detailed error list from logcat in eclipse. I've tried everything from disposing literally everything, to calling System.gc to setting all my variables to null. However, whenever i switch screens the fatal signal occurs. I just need someone to tell me what exactly is going on or how i could get more details about the error.
我知道这是访问读取空间之外的内存时出现的错误,但我完全不知道如何解决这个问题。我是 android 新手,所以我不完全知道如何从 eclipse 中的 logcat 打印出更详细的错误列表。我已经尝试了从字面上处理所有内容到调用 System.gc 到将所有变量设置为 null 的所有方法。但是,每当我切换屏幕时,就会出现致命信号。我只需要有人告诉我到底发生了什么或者我如何获得有关错误的更多详细信息。
采纳答案by Shirane85
I had the same error, what solved it was to make sure i'm on the UI thread, like this:
我有同样的错误,解决它的方法是确保我在 UI 线程上,如下所示:
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
// Your crashing code here
}
});
回答by Liviu
In my case i received same error when i try to create a new body and attach it's fixture, from beginContact (inside Contact Listener). After i moved outside Contact Listener my body creation everything was ok. Probably some conflict appears in Fixture createFixture (FixtureDef def) because according to manual: Contacts are not created until the next time step.
在我的情况下,当我尝试从 beginContact(在 Contact Listener 内部)创建一个新主体并附加它的夹具时,我收到了同样的错误。在我移出 Contact Listener 之后,我的身体创建一切正常。Fixture createFixture (FixtureDef def) 中可能会出现一些冲突,因为根据手册:直到下一个时间步才会创建联系人。