segmentation-fault

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)

纵饮孤独 提交于 2019-12-21 04:32:08
问题 I am creating a 2D game on Android using OpenGL. Currently I am testing and debugging the game on several devices. The problem I am facing, is the terrible "signal 11" error. When I am playing on my Samsung Galaxy Nexus, everything runs smooth, and I can play it for hours without the game throwing any errors. My Nexus is running Android 4.0 Ice Cream Sandwich. Now, when I run it on other devices, I am getting this signal 11 error. This are the devices which throw the error: HTC Desire HD

iPhone KERN_INVALID_ADDRESS

杀马特。学长 韩版系。学妹 提交于 2019-12-21 02:45:12
问题 Im not sure why I am recieving this error, and I'm unable to track down the cause. This only happens on the device though, Simulator runs error-free as expected. Can anyone make sense of this crash log? Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x61f6490a Crashed Thread: 0 Thread 0 Crashed: 0 libobjc.A.dylib 0x32668edc 0x32665000 + 16092 1 Foundation 0x33f70990 0x33f29000 + 293264 2 Foundation 0x33f82a66 0x33f29000 + 367206 3 Foundation 0x33fdb2d8

Why is Ruby throwing a Segmentation fault on only my system, and only in this Rails application?

孤者浪人 提交于 2019-12-20 19:43:31
问题 I'm not exactly sure how to properly debug this but have tried a few different approaches that have chewed up time, but not solved the problem. At least 4 other people in my office can execute this code on identical machines with the same version of ruby and rubygems installed with no error. Here is the code that I'm executing: status = Open4::popen4( "swfmill simple stdin stdout" ) do | pid, stdin, stdout, stderr | stdin.write( config ) stdin.close bytes = stdout.read errors = stderr.read

segfault during __cxa_allocate_exception in SWIG wrapped library

ぃ、小莉子 提交于 2019-12-20 18:09:29
问题 While developing a SWIG wrapped C++ library for Ruby, we came across an unexplained crash during exception handling inside the C++ code. I'm not sure of the specific circumstances to recreate the issue, but it happened first during a call to std::uncaught_exception , then after a some code changes, moved to __cxa_allocate_exception during exception construction. Neither GDB nor valgrind provided any insight into the cause of the crash. I've found several references to similar problems,

Set stack size with setrlimit() and provoke a stack overflow/segfault

こ雲淡風輕ζ 提交于 2019-12-20 08:47:00
问题 In the given example below I try to set the stacksize to 1kb. Why is it now possible to allocate an array of ints on the stack with size 8kb in foo() ? #include <stdio.h> #include <sys/resource.h> void foo(void); int main() { struct rlimit lim = {1024, 1024}; if (setrlimit(RLIMIT_STACK, &lim) == -1) return 1; foo(); return 0; } void foo() { unsigned ints[2048]; printf("foo: %u\n", ints[2047]=42); } 回答1: The limit is set immediately but only checked when trying to allocate a new stack or

Segmentation fault [duplicate]

夙愿已清 提交于 2019-12-20 07:56:43
问题 This question already has answers here : Crash or “segmentation fault” when data is copied/scanned/read to an uninitialized pointer (5 answers) Closed 3 years ago . What is wrong with this code snippet? i am getting Segmentation fault! #include<stdio.h> int main() { struct { char* name; int age; } *emp; char* empname = "Kumar"; int empage = 31; emp->name = empname; emp->age = empage; printf("empname :%s\n",emp->name); printf("empage :%d",emp->age); return 0; } And how to correct this program

Shellcode not running

自闭症网瘾萝莉.ら 提交于 2019-12-20 07:39:15
问题 I've tried to run a lot of shell-codes via C program to test them. Here it is #include<stdio.h> #include<string.h> unsigned char code[] = "shell here"; main() { printf("Shellcode Length: %d\n", strlen(code)); int (*ret)() = (int(*)())code; ret(); } And here's example of shellcode "\x31\xc0\xb0\x46\x31\xdb\x31\xc9\xcd\x80\xeb"\ "\x16\x5b\x31\xc0\x88\x43\x07\x89\x5b\x08\x89"\ "\x43\x0c\xb0\x0b\x8d\x4b\x08\x8d\x53\x0c\xcd"\ "\x80\xe8\xe5\xff\xff\xff\x2f\x62\x69\x6e\x2f"\ "\x73\x68\x58\x41\x41

C segmentation fault-char pointers

℡╲_俬逩灬. 提交于 2019-12-20 07:38:05
问题 I need help figuring out why I am getting a segmentation fault here. I have gone over it and I think I am doing something wrong with the pointers, but I can figure out what. My Program: #include <stdlib.h> #include <stdio.h> void encrypt(char* c); //characters are shifted by 175 int main(){ char* a; *a = 'a'; /*SEGMENTATION FAULT HERE!*/ encrypt(a); printf("test:%c/n",*a); return 0; }; void encrypt(char* c){ char* result; int i=(int)(*c); i+=175; if(i>255) { i-=256; } *c=(char)i; }; 回答1: The

cudaMemcpy segmentation fault

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 07:23:24
问题 I've been haunted by this error for quite a while so I decided to post it here. This segmentation fault happened when a cudaMemcpy is called: CurrentGrid->cdata[i] = new float[size]; cudaMemcpy(CurrentGrid->cdata[i], Grid_dev->cdata[i], size*sizeof(float),\ cudaMemcpyDeviceToHost); CurrentGrid and Grid_dev are pointer to a grid class object on host and device respectively and i=0 in this context. Class member cdata is a float type pointer array. For debugging, right before this cudaMemcpy

C++: Seg Fault on exit of IF statement

前提是你 提交于 2019-12-20 06:48:11
问题 I am reposting this with all of the code this time. I would appreciate not closing the post for at least a little while. I am obviously no expert and I have never run into anything like this before but I do think it can be useful to other members. I tried the comments and agree the error is with destruction but can't find where. I have included the location of the seg fault in comment towards the bottom. I don't have an IDE and don't know how to use the debugger surely built into xterm so I