segmentation-fault

Detecting that the stack is full

*爱你&永不变心* 提交于 2019-12-06 00:54:20
问题 When writing C++ code I've learned that using the stack to store memory is a good idea. But recently I ran into a problem: I had an experiment that had code that looked like this: void fun(const unsigned int N) { float data_1[N*N]; float data_2[N*N]; /* Do magic */ } The code exploted with a seqmentation fault at random, and I had no idea why. It turned out that problem was that I was trying to store things that were to big on my stack, is there a way of detecting this? Or at least detecting

POSIX Threads and SIGSEGV

喜欢而已 提交于 2019-12-05 21:32:02
I have a system with 10+ threads. I have a signal handler to catch SIGSEGV. if one thread generates SIGSEGV, does that signal go to all threads, or just to the thread that generated the signal? SIGSEGV is a synchronous signal. It'll be delivered to the thread that caused the invalid memory access. From signal(7) : A signal may be generated (and thus pending) for a process as a whole (e.g., when sent using kill(2) ) or for a specific thread (e.g., certain signals, such as SIGSEGV and SIGFPE , generated as a consequence of executing a specific machine-language instruction are thread directed, as

PHPUnit Segmentation Fault 11

北城以北 提交于 2019-12-05 20:46:24
问题 I tried running PHPUnit this morning and it's producing a Segmentation Fault 11 error (using the command phpunit unit/ - If I run PHPUnit on my functional tests with Selenium then everything works fine, it's only the unit tests that are affected, I've tried the options in other threads here and those didn't fix the issue, and I have tried reinstalling MAMP locally and reinstalling PHPUnit through PEAR. I've also tried switching PHP versions on the command-line. The tests run fine on a

C Programming: seg faults, printf, and related quirks

Deadly 提交于 2019-12-05 18:52:01
As many young programmers do, I learned the usefulness of inserting numerous print-to-console statements of "here1," "here2," and so on at different points in code to figure out when my programs are going awry. This brute force debugging technique has saved me many, many times throughout my CS studies. However, when I started programming in C, I stumbled onto an interesting problem. If I were to try and run void* test; printf("hello world"); test[5] = 234; Of course I get a segfault for not malloc'ing memory for testChar. However, you would think logically that "hello world" would be printed

Trying to use cydia libraries: NSTask on Jailbroken iphone crashes with Segmentation fault: 11

大城市里の小女人 提交于 2019-12-05 18:50:28
I want to run dpkg ( or any other binary library files from cydia in the /bin or /usr/bin directories) from a GUI app with an icon, like mobileterminal, ifile, myfile, cydia, alertscript, and so many others can. How do they accesses the libraries? This code works, and the stdout of the process is printed in nslog but then it immediately crashes with Segmentation fault: 11. this is in my viewdidload function. This DOES NOT OCCUR IN THE SIMULATOR, only my iPhone 4. weird. have tried running as both mobile and root. the app is under /Applications folder. Here's my code. EDIT: I'm using the snow

plyr split_indices function crashes for long vectors

大城市里の小女人 提交于 2019-12-05 18:48:30
I am trying to run acast function from the package reshape2 on a large data set, and getting the program crash. I was able to localize this problem: library(plyr) n <- 15784000 g <- 1:n split_indices(g, n) # NOTE for copy/pasters: # this may result in an abort and R exit I am getting the following error message: *** caught segfault *** address 0x7ffffc3c44f0, cause 'memory not mapped' Traceback: 1: .Call("split_indices", group, as.integer(n)) 2: split_indices(g, n) If I reduce the value of n: n <- 3946000 then the error message is different: Error: segfault from C stack overflow The R system I

QApplication segmentation fault

蓝咒 提交于 2019-12-05 16:55:39
I get a crash when try to create a QApplication object. This is my code: #include <QLabel> #include <QApplication> int main(int argc, char* argv[]) { QApplication app(argc, argv); return app.exec(); } I am using Qt version 4.8.4 and the MinGW compiler. My application crashes when running QCoreApplicationPrivate::processCommandLineArguments method. Can anybody tell how to solve this problem? Apparently, this error is caused by binary incompatibility of Qt binaries and your compiler. From here : There are binary installers targetting MinGW for both Qt 4 and Qt 5. The Qt 4 ones are built with

Dwarf Error: Cannot find DIE

不想你离开。 提交于 2019-12-05 16:34:33
I am having a lot of trouble debugging a segmentation fault in a C++ project in XCode 4. I only get a segfault when I built with the "LLVM 2.0" compiler option and use -O3 optimization. From what I understand, there are limited debugging options when one is using optimization, but here is the debug output I get after I run in Xcode with gdb turned on: warning: Got an error handling event: "Dwarf Error: Cannot find DIE at 0x3be2 referenced from DIE at 0x11d [in module /Users/imran/Library/Developer/Xcode/DerivedData/cgo-hczcifktgscxjigfphieegbpxxsq/Build/Products/Debug/cgo]". No memory

RSpec throws segmentation fault

你。 提交于 2019-12-05 16:29:18
sometimes my test suite throws a segmentation fault for no reasons. Here is the output: /Users/Test/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.9/lib/active_record/relation/query_methods.rb:268: [BUG] Bus Error ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.3.0] -- Control frame information ----------------------------------------------- c:0209 p:---- s:0839 b:0839 l:000838 d:000838 CFUNC :- c:0208 p:0068 s:0835 b:0833 l:000832 d:000832 METHOD /Users/Test/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.9/lib/active_record/relation/query_methods.rb:268 c:0207 p:0031 s:0828 b

Application segmentation fault, only when compiling on Windows with MinGW

你离开我真会死。 提交于 2019-12-05 16:24:14
I'm trying to compile one of my games on Windows, but unfortunately, no matter what, I'm getting this segmentation fault every time I run the program. Compilation is successful, and without any warning. Program received signal SIGSEGV, Segmentation fault. __chkstk_ms () at ../../../../../src/gcc-4.8.1/libgcc/config/i386/cygwin.S:172 172 ../../../../../src/gcc-4.8.1/libgcc/config/i386/cygwin.S: No such file or directory. I've tried: Compiling on a Windows x86 machine Compiling on a Windows x64 machine nuwen.net's MinGW distro TDM MinGW 4.8.1 SJLJ MinGW builds x86 SJLJ MinGW builds x64 SJLJ