我收到了客户的崩溃日志,以了解我的应用程序崩溃iPhone的原因.
这里来自崩溃日志的一些信息:
Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x00000000, 0x00000000 Crashed Thread: 0
线程0的堆栈跟踪
Thread 0 Crashed: 0 libSystem.B.dylib 0x3293f98c 0x328c1000 + 518540 1 libSystem.B.dylib 0x3293f97c 0x328c1000 + 518524 2 libSystem.B.dylib 0x3293f96e 0x328c1000 + 518510 3 libSystem.B.dylib 0x3295461a 0x328c1000 + 603674 4 libstdc++.6.dylib 0x30a143b0 0x309cf000 + 283568 5 libobjc.A.dylib 0x3347a858 0x33475000 + 22616 6 libstdc++.6.dylib 0x30a12776 0x309cf000 + 276342 7 libstdc++.6.dylib 0x30a127ca 0x309cf000 + 276426 8 libstdc++.6.dylib 0x30a12896 0x309cf000 + 276630 9 libobjc.A.dylib 0x33479714 0x33475000 + 18196 10 CoreFoundation 0x335c8210 …
我有一个std::vector<double>GDB显示它包含这些值:
Wph <5 items> vector<double>
[0] 10.750281685547618 double
[1] 0.0053087812248281997 double
[2] 4.2807534148705719e-08 double
[3] 5.7427427663508097e-07 double
[4] 0 double
Run Code Online (Sandbox Code Playgroud)
在函数退出时自动销毁,它会抛出SIGABRT.
0 raise raise.c 64 0x7fffeec5ad05
1 abort abort.c 92 0x7fffeec5eab6
2 __libc_message libc_fatal.c 189 0x7fffeec93d7b
3 malloc_printerr malloc.c 6283 0x7fffeec9fa8f
4 _int_free malloc.c 4795 0x7fffeec9fa8f
5 __libc_free malloc.c 3738 0x7fffeeca38e3
6 __gnu_cxx::new_allocator<double>::deallocate new_allocator.h 95 0x457828
7 std::_Vector_base<double, std::allocator<double> >::_M_deallocate stl_vector.h 146 0x45567e
8 std::_Vector_base<double, std::allocator<double> >::~_Vector_base stl_vector.h 132 0x4542b3
9 std::vector<double, std::allocator<double> >::~vector stl_vector.h 314 0x453a96
Run Code Online (Sandbox Code Playgroud)
这是怎么回事? …
我正在尝试在 C++ 中对字符串数组进行排序,但收到以下错误消息:
抛出“std::logic_error”实例后调用终止 what(): basic_string::_M_construct null 无效
以下程序会导致上一个错误。v有 17 个元素时出现错误,但当元素v较少时一切正常。
有人能指出我有什么问题吗?我正在使用gcc 版本 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
bool comp (string s1, string s2) {
if (s1.size() < s2.size())
return false;
else
return true;
}
int main () {
vector<string> v = { "a", "a", "a", "a",
"a", "a", "a", "a",
"a", "a", "a", "a",
"a", "a", "a", "a",
"a" };
sort(v.begin(), v.end(), comp);
return 0;
}
Run Code Online (Sandbox Code Playgroud) 我的 iPhone/ipad 应用程序出现问题。它已发布在应用程序商店中,但现在似乎有一些用户在尝试启动该应用程序时遇到崩溃。有时它有助于硬重启。\n如果有人能帮我解决发生的事情,我会非常高兴。如果重要的话,该应用程序是在 unity 3d 中构建的.. Here\xc2\xb4s 我的崩溃日志:
\n\nHardware Model: iPad2,3\nProcess: thegame [3955]\nPath: /var/mobile/Applications/...thegame.app/thegame\nIdentifier: thegame\nVersion: ??? (???)\nCode Type: ARM (Native)\nParent Process: launchd [1]\nDate/Time: 2013-03-18 23:00:43.195 +0000\nOS Version: iOS 6.1.2 (10B146)\nReport Version: 104\n\nException Type: EXC_BAD_ACCESS (SIGABRT)\nException Codes: KERN_INVALID_ADDRESS at 0x00000000\nCrashed Thread: 0\n\nThread 0 name: Dispatch queue: com.apple.main-thread\nThread 0 Crashed:\n0 libsystem_kernel.dylib 0x3a863350 __pthread_kill + 8\n1 libsystem_c.dylib 0x3a7da11e pthread_kill + 54\n2 libsystem_c.dylib 0x3a81696e abort + 90\n3 thegame 0x00bc6288 0x1000 + 12341896\n4 thegame 0x00bb6e64 0x1000 + 12279396\n5 libsystem_c.dylib 0x3a7e3e90 _sigtramp + 40\n6 thegame …Run Code Online (Sandbox Code Playgroud) 我的程序中有一个结构
struct List
{
int data;
List *next;
};
Run Code Online (Sandbox Code Playgroud)
以及向列表尾部添加元素的功能:
void addL(List* &tail, int dat)
{
if (tail==NULL)
{
tail = new List;
tail->data = dat;
tail->next=NULL;
}
else
{
tail->next = new List;
tail = tail->next;
tail->data = dat;
tail->next = NULL;
}
}
Run Code Online (Sandbox Code Playgroud)
gdb说到了这个问题
terminate called after throwing an instance of 'St9bad_alloc'
what(): std::bad_alloc
Program received signal SIGABRT, Aborted.
0xb7fdd424 in __kernel_vsyscall ()
Run Code Online (Sandbox Code Playgroud)
排队
tail->next = new List;
Run Code Online (Sandbox Code Playgroud)
我尝试制作另一个类型为List的变量:
List* add;
add = new List;
Run Code Online (Sandbox Code Playgroud)
但在第二行遇到了同样的问题.
如何正确地重写?是否需要粘贴调用addL的函数?对不起,如果这个问题已经被问过,我一看就知道了.
在第56行,我正在尝试调整数组的大小:
tokenArray = (char**) realloc(tokenArray, tokSize * (sizeof(char)));
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
(11972,0x7fff7ca4f300)malloc:*对象0x100105598的错误:释放对象的校验和不正确 - 对象可能在被释放后被修改.*在malloc_error_break中设置断点以进行调试
这是一个类的编程分配,我已经被特别指示动态分配我的数组,然后根据需要进行扩展.我已经广泛搜索了同样的另一个线程,这个线程对我来说并不太先进,但没有运气......所以希望我能得到一些帮助.谢谢!这是我的代码:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_ROW_SIZE 81
void strInput(char str[], int numElem);
int main(int argc, const char * argv[])
{
printf("Enter a string of any number of integers separated by spaces or tabs.\n");
printf("Maximum string length is 80 characters.\n");
printf("Enter an empty string to conclude input.\n");
int arrSize = 10, tokSize = 10, i = 0, j = 0;
char** inputArray = malloc(arrSize …Run Code Online (Sandbox Code Playgroud) 我正在使用 aViewPager来显示片段。当我多次滑动它时,它会出现以下错误:
E/libc++abi: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
--------- beginning of crash
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 6900
Run Code Online (Sandbox Code Playgroud)
我正在显示和缓存图像(使用这个)以及我正在使用TextView用来在Fragment.
我试图从其他链接获得帮助,但未能成功。
我已经构建了一个xamarin.ios应用程序.该应用程序一直工作得很好.没有代码更改,并且突然出现,应用程序现在在访问摄像头时崩溃.我不知道为什么会这样,有人能解释一下这个问题吗?我已经谷歌围绕这个错误并尝试了各种各样的东西,包括删除各种包.我最近更新到ios 10,但更新后应用程序仍然正常工作.错误如下:
2016-10-10 21:44:28.925 Coacher [307:24128]批评:原生堆栈跟踪:
2016-10-10 21:44:28.934 Coacher [307:24128] critical:0
libmonosgen-2.0.dylib 0x00363d33 mono_handle_native_sigsegv + 242 2016-10-10 21:44:28.934 Coacher [307:24128] critical:1 libsystem_platform.dylib
0x1db5326d _sigtramp + 24 2016-10-10 21:44:28.935 Coacher [307:24128] critical:2 libsystem_kernel.dylib 0x1da9fd8f + 64 2016-10-10 21:44:28.935 Coacher [307:24128] critical:3 libsystem_kernel. dylib 0x1da9fdd9 system_set_sfi_window + 0 2016-10-10 21:44:28.935 Coacher [307:24128] critical:4 TCC 0x201a8e85 + 228 2016-10-10 21:44:28.936 Coacher [307:24128] critical:5 TCC 0x201a8da1 + 0 2016-10-10 21:44:28.936 Coacher [307:24128]关键:6 TCC
0x201ab57b + 276 2016-10-10 21:44:28.936 Coacher [307:24128]关键:7 libxpc.dylib 0x1db8915f + 46 …
不知道问这个问题的最佳方式是什么......但我有一个带有皮肤人体模型的场景套件场景(它由几个皮肤网格组成,有些具有混合形状(变形)、骨骼层次和> 60种不同的材料) . 一些网格分配了 3-8 种材料。所有这些网格都分为 8 组。
当我在设备(iPhone 5s、iPad Pro)上运行项目时,出现此错误:
validateFunctionArguments:2800: 失败的断言 `(length - offset)(11088) 在 scn_node[0] 的索引 1 处的缓冲区绑定必须 >= 12368。'
如果我隐藏前两组网格,那么项目运行得很好。如果我取消隐藏前两组并隐藏其他所有内容,则应用程序也可以在设备上正常运行。但是,如果我显示所有 8 个组应用程序崩溃并给出该错误。如果我删除 3D 包中的所有材料,然后使用单一材料导出模型,那么所有显示的 8 个组都运行良好。
我们正在使用金属。最新的 Xcode 8,最新的 iOS 10
什么可能导致这种情况?场景只有那个模型,没有别的。非常感谢任何帮助或建议。谢谢!