应用程序崩溃(有时),致命信号 11 (SIGSEGV),代码

App crashes (sometimes) with Fatal signal 11 (SIGSEGV), code 1(应用程序崩溃(有时),致命信号 11 (SIGSEGV),代码 1)
本文介绍了应用程序崩溃(有时),致命信号 11 (SIGSEGV),代码 1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 HERE SDK 开发一个应用程序,到目前为止一切正常.我收到这样的错误:
致命信号 11 (SIGSEGV),代码 1,tid 10206 (FinalizerDaemon) 中的故障地址 0x750057
或者这个:
致命信号 11 (SIGSEGV),代码 1,tid 24605 (FinalizerDaemon) 中的故障地址 0x94789680

它们让我的应用崩溃.

它并不总是相同的错误,但它们总是单独出现在我的 Logcat 中,没有其他信息.

在我的所有应用程序中,我都在使用 HERE 对象和服务,即使通过打印堆栈跟踪,我也无法获得有关错误的更多信息.
我只是注意到这些错误几乎是随机出现的,但只有在我使用这些对象/服务时才会出现.

我使用真实设备来测试我的应用程序,即 Sony Xperia Z3 compact,所以我不认为它来自这里.

我真的迷路了,所以如果有人对如何获取有关错误的更多信息有任何想法,请帮助

 05-09 23:04:10.148 6770-6782/?A/libc:致命信号 11 (SIGSEGV),代码 1,tid 6782 (FinalizerDaemon) 中的故障地址 0x405-09 23:04:10.266 30179-30179/?我/调试:*** *** *** *** *** *** *** *** *** *** *** *** *** *** ***05-09 23:04:10.266 30179-30179/?我/调试:UUID:5569a1b9-c913-4101-99fa-5099e2cadd4805-09 23:04:10.266 30179-30179/?I/DEBUG:构建指纹:'Sony/D5803/D5803:5.1.1/23.4.A.1.264/2418263178:user/release-keys'05-09 23:04:10.266 30179-30179/?我/调试:修订:'0'05-09 23:04:10.266 30179-30179/?我/调试:ABI:手臂"05-09 23:04:10.266 30179-30179/?I/DEBUG:pid:6770,tid:6782,名称:FinalizerDaemon>>>com.david.metroz <<<05-09 23:04:10.266 30179-30179/?I/DEBUG:信号 11 (SIGSEGV),代码 1 (SEGV_MAPERR),故障地址 0x405-09 23:04:10.294 30179-30179/?I/调试:r0 98327400 r1 00000000 r2 00000002 r3 0000000005-09 23:04:10.294 30179-30179/?我/调试:r4 aec264c0 r5 b3df7acc r6 98327400 r7 7365234805-09 23:04:10.294 30179-30179/?我/调试:r8 6f9983a8 r9 b482a800 sl 12f1d820 fp b3df7abc05-09 23:04:10.294 30179-30179/?I/DEBUG: ip b5303950 sp b3df7ab0 lr b510717f pc a0b7205c cpsr a00e001005-09 23:04:10.294 30179-30179/?I/DEBUG: #00 pc 000f405c/data/app/com.david.metroz-1/lib/arm/libMAPSJNI.so (Java_com_nokia_maps_GeoBoundingBoxImpl_destroyNative+76)05-09 23:04:10.294 30179-30179/?我/调试:#01 pc 001d7d4f/data/dalvik-cache/arm/datacom.david.metroz-1@base.apk@classes.dex05-09 23:04:12.302 862-1274/?E/NativeCrashListener:处理报告的异常android.system.ErrnoException:读取失败:EAGAIN(再试一次)在 libcore.io.Posix.readBytes(本机方法)在 libcore.io.Posix.read(Posix.java:165)在 libcore.io.BlockGuardOs.read(BlockGuardOs.java:230)在 android.system.Os.read(Os.java:350)在 com.android.server.am.NativeCrashListener.consumeNativeCrashData(NativeCrashListener.java:240)在 com.android.server.am.NativeCrashListener.run(NativeCrashListener.java:138)

编辑 2: 我现在很确定当我使用 gson 从数据库中检索 HERE 对象时会发生崩溃.

当一切都在同一个应用程序运行时完成时,以下代码有效,但是当我在数据库中保存一个字符串,关闭应用程序然后重新打开它时,我得到 致命信号 而将 json 字符串 转换回对象.

//插入我创建一个json字符串,然后将它插入到数据库中字符串 mGbSortie = gson.toJson(geoboundinBox);//然后检索数据:类型 gbType = new TypeToken(){}.getType();geoBoudingBox = gson.fromJson(stringFromDb, listType)

我真的不知道为什么它不起作用.

解决方案

1) 首先判断是android、第三方库还是你的设备的bug,这样你就知道应该怎么处理了.

这个答案给出了如何做到这一点的解决方案:

<块引用>

如果您编写(或正在使用)一个插件,该插件又通过 NDK 使用本机 C/C++ 代码,这可能表明该本机代码中存在错误.

否则,这是您正在测试的设备或模拟器的固件中的错误.

如果您可以在模拟器、具有原始 ROM 的 Nexus 设备或来自不同制造商的各种设备上重现此问题,则可能是 Android 本身的错误.在这种情况下,请创建一个可以重现错误的示例项目,并将其与整个堆栈跟踪一起发布到 http://b.android.com,Android 操作系统问题跟踪器.

如果您只在一台设备或一个第三方 ROM 上遇到此问题,这可能是一个更具体的错误 - 您最好联系设备制造商或 ROM 发行商并告知您的症状.

这两个问题详细讨论了您收到的错误:

安卓致命信号 11 (SIGSEGV) 位于 0x636f7d89 (code=1).怎么追到?

致命信号 11 (SIGSEGV) 在 0x00000000 (code=1) - PhoneGap

2) 在解析您的 geobounds 值方面(看起来问题可能出在哪里),请确保您使用正确的 geobound 值正确处理 Gson 和 Json 之间的解析.看来您存储值的方式与检索它们的方式不一致.

来自米孔:

<块引用>

toJson() – 将 Java 对象转换为 JSON

Gson gson = new Gson();员工 obj = 新员工();//1. Java 对象转 JSON,并存入文件gson.toJson(obj, new FileWriter("D:\file.json"));//2. Java 对象转 JSON,并赋值给 String字符串 jsonInString = gson.toJson(obj);

fromJson() – 将 JSON 转换为 Java 对象

Gson gson = new Gson();//1. JSON 到 Java 对象,从文件中读取.Staff Staff = gson.fromJson(new FileReader("D:\file.json"), Staff.class);//2. JSON 到 Java 对象,从 Json 字符串中读取.String jsonInString = "{'name' : 'mkyong'}";职员职员 = gson.fromJson(jsonInString, Staff.class);//JSON 转 JsonElement,稍后转换为 String.JsonElement json = gson.fromJson(new FileReader("D:\file.json"), JsonElement.class);字符串结果 = gson.toJson(json);

来自这个答案:

<块引用>

公共类 YourObject {私有字符串应用程序名;私有字符串版本;私有字符串 UUID;私有字符串 WWXY;私有字符串 ABCD;私有字符串 YUDE;//getter/setterYourObject 已解析 = new Gson().fromJson(jsons, YourObject.class);String jsons = "{'appname':'application', 'Version':'0.1.0', 'UUID':'300V', 'WWXY':'310W', 'ABCD':'270B', 'YUDE':'280T'}";YourObject 已解析 = new Gson().fromJson(jsons, YourObject.class);JsonObject 对象 = new JsonParser().parse(jsons).getAsJsonObject();object.get("appname");//应用object.get("版本");//0.1.0

这些 SO 问题提供了更多详细信息:
如何在android中使用GSON解析json
使用 gson 和 GsonBuilder() 解析 JSON

3) 确保您为地理绑定坐标传递了正确的值.这个问题值不在GeoboundingBox WinRT的预期范围内(尽管 C# 提供了一个很好的例子来说明如何分解您尝试存储和检索的信息的组成部分.

答案很简单.

<块引用>

var nw = new BasicGeoposition();nw.Latitude = Max(pos.Coordinate.Latitude, pos2.lat);nw.Longitude = Min(pos.Coordinate.Longitude, pos2.lng);var se = new BasicGeoposition();se.Latitude = Min(pos.Coordinate.Latitude, pos2.lat);se.Longitude = Max(pos.Coordinate.Longitude, pos2.lng);

并学习如何使用 gson 解析您的 json:

在您的 Android 应用程序中使用 Gson 处理 JSON

还有这个 gihub repo 供你浏览更多想法.

I am developing an app with the HERE SDK, and everything worked fine until now. I get errors like this one:
Fatal signal 11 (SIGSEGV), code 1, fault addr 0x750057 in tid 10206 (FinalizerDaemon)
or this one:
Fatal signal 11 (SIGSEGV), code 1, fault addr 0x94789680 in tid 24605 (FinalizerDaemon)

and they make my app crash.

It's not always the same errors, but they always come all alone in my Logcat,with no other information.

In all my app I am using HERE objects and services, and even by printing the stacktrace I don't get more information about the errors.
I just noticed that these errors appear pretty much randomly, but only when I am using these objects/services.

I use a real device to test my app, a Sony Xperia Z3 compact, so I don't think it comes from here.

I am really lost, so if someone has any idea even on how to get more infos about the errors, please help

EDIT:

 05-09 23:04:10.148 6770-6782/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x4 in tid 6782 (FinalizerDaemon)
05-09 23:04:10.266 30179-30179/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-09 23:04:10.266 30179-30179/? I/DEBUG: UUID: 5569a1b9-c913-4101-99fa-5099e2cadd48
05-09 23:04:10.266 30179-30179/? I/DEBUG: Build fingerprint: 'Sony/D5803/D5803:5.1.1/23.4.A.1.264/2418263178:user/release-keys'
05-09 23:04:10.266 30179-30179/? I/DEBUG: Revision: '0'
05-09 23:04:10.266 30179-30179/? I/DEBUG: ABI: 'arm'
05-09 23:04:10.266 30179-30179/? I/DEBUG: pid: 6770, tid: 6782, name: FinalizerDaemon  >>> com.david.metroz <<<
05-09 23:04:10.266 30179-30179/? I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
05-09 23:04:10.294 30179-30179/? I/DEBUG:     r0 98327400  r1 00000000  r2 00000002  r3 00000000
05-09 23:04:10.294 30179-30179/? I/DEBUG:     r4 aec264c0  r5 b3df7acc  r6 98327400  r7 73652348
05-09 23:04:10.294 30179-30179/? I/DEBUG:     r8 6f9983a8  r9 b482a800  sl 12f1d820  fp b3df7abc
05-09 23:04:10.294 30179-30179/? I/DEBUG:     ip b5303950  sp b3df7ab0  lr b510717f  pc a0b7205c  cpsr a00e0010
05-09 23:04:10.294 30179-30179/? I/DEBUG:     #00 pc 000f405c  /data/app/com.david.metroz-1/lib/arm/libMAPSJNI.so (Java_com_nokia_maps_GeoBoundingBoxImpl_destroyNative+76)
05-09 23:04:10.294 30179-30179/? I/DEBUG:     #01 pc 001d7d4f  /data/dalvik-cache/arm/datacom.david.metroz-1@base.apk@classes.dex
05-09 23:04:12.302 862-1274/? E/NativeCrashListener: Exception dealing with report
                                                     android.system.ErrnoException: read failed: EAGAIN (Try again)
                                                         at libcore.io.Posix.readBytes(Native Method)
                                                         at libcore.io.Posix.read(Posix.java:165)
                                                         at libcore.io.BlockGuardOs.read(BlockGuardOs.java:230)
                                                         at android.system.Os.read(Os.java:350)
                                                         at com.android.server.am.NativeCrashListener.consumeNativeCrashData(NativeCrashListener.java:240)
                                                         at com.android.server.am.NativeCrashListener.run(NativeCrashListener.java:138)

EDIT 2: I am now pretty sure that the crash happens when I am retrieving HERE objects from database using gson.

The following code works when everything is done in the same app runtime, but when I save a string in the database, close the app and then re-open it, I get the Fatal signal while converting the json string back to the object.

// to insert I create a json string and then insert it in the database
String mGbSortie = gson.toJson(geoboundinBox);

//and then to retrieve the data :
Type gbType = new TypeToken<GeoBoundingBox>(){}.getType();
geoBoudingBox = gson.fromJson(stringFromDb, listType)

I really don't know why it doesn't work.

解决方案

1) Firstly determine whether it's a bug within the android, the third party libraries or your device, so you can know which way to proceed.

This answer gives a solution of how to do this:

If you have written (or are using) a plugin that in turn uses native C/C++ code through the NDK, this may indicate a bug in that native code.

Otherwise, this is a bug in the firmware of the device or emulator you are testing upon.

If you can reproduce this in an emulator, on a Nexus device with the original ROM, or on a variety of devices from different manufacturers, it is probably a bug in Android itself. In that case, please create a sample project that can reproduce the error, and post it along with the entire stack trace to http://b.android.com, the Android OS issue tracker.

If you are only encountering this on one device or one third-party ROM, it is probably a more specific bug -- your best bet is to contact the device manufacturer or ROM publisher with your symptoms.

There are these two questions which discuss the error you are receiving in detail:

Android Fatal signal 11 (SIGSEGV) at 0x636f7d89 (code=1). How can it be tracked down?

Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1) - PhoneGap

2) In terms of parsing your geobounds values (as it would seem is where the problem may lie), ensure you are handling your parsing between Gson and Json correctly, with the correct geobound values. It appears how you are storing the values is not in accord with how you are retreiving them.

From Mykong:

toJson() – Convert Java object to JSON

Gson gson = new Gson();
Staff obj = new Staff();

// 1. Java object to JSON, and save into a file
gson.toJson(obj, new FileWriter("D:\file.json"));

// 2. Java object to JSON, and assign to a String
String jsonInString = gson.toJson(obj);

fromJson() – Convert JSON to Java object

Gson gson = new Gson();

// 1. JSON to Java object, read it from a file.
Staff staff = gson.fromJson(new FileReader("D:\file.json"), Staff.class);

// 2. JSON to Java object, read it from a Json String.
String jsonInString = "{'name' : 'mkyong'}";
Staff staff = gson.fromJson(jsonInString, Staff.class);

// JSON to JsonElement, convert to String later.
JsonElement json = gson.fromJson(new FileReader("D:\file.json"), JsonElement.class);
String result = gson.toJson(json);

From this answer:

public class YourObject {
   private String appname;
   private String Version;
   private String UUID;
   private String WWXY;
   private String ABCD;
   private String YUDE;
   //getters/setters


YourObject parsed = new Gson().fromJson(jsons, YourObject.class);  

String jsons = "{'appname':'application', 'Version':'0.1.0', 'UUID':'300V', 'WWXY':'310W', 'ABCD':'270B', 'YUDE':'280T'}";
YourObject parsed = new Gson().fromJson(jsons, YourObject.class);  

JsonObject object = new JsonParser().parse(jsons).getAsJsonObject();
object.get("appname"); // application 
object.get("Version"); // 0.1.0

These SO questions give more details:
How to parse json parsing Using GSON in android
parse JSON with gson and GsonBuilder()

3) Ensure you are passing the correct values for your geobound co-ords. This question Value does not fall within the expected range GeoboundingBox WinRT (although it is C# gives a good example of how to break down the components of information you are trying to store and retrieve.

The answer is straightforward.

var nw = new BasicGeoposition();
nw.Latitude = Max(pos.Coordinate.Latitude, pos2.lat);
nw.Longitude = Min(pos.Coordinate.Longitude, pos2.lng);
var se = new BasicGeoposition();
se.Latitude = Min(pos.Coordinate.Latitude, pos2.lat);
se.Longitude = Max(pos.Coordinate.Longitude, pos2.lng);

And learn how to parse your json with gson:

Use Gson to work with JSON in your Android apps

There is also this gihub repo for you to browse for more ideas.

这篇关于应用程序崩溃(有时),致命信号 11 (SIGSEGV),代码 1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)