segmentation-fault

Push/Pop segmentation fault at Assembly x86

限于喜欢 提交于 2019-12-03 18:18:41
问题 I'm using elf64 to compile my assembly x86 code: I've this sub-routine: printNumber: mov EAX, EDX ; EDX contain some value like "35" mov ESI, 10 ; to divide by 10 MOV ECX,0 ; counter whileDiv: cmp EAX, 0 je endWhileDiv xor rdx, rdx ; clean RDX idiv ESI ; EAX=EAX/10 and EDX = EAX%10 push rdx ; this line generate a segmentation fault add ECX, 1; count how many items i has added into stack jmp whileDiv endWhileDiv: ret I'm trying to push all digits of a number into my stack using push, but i'm

segmentation fault 11 in C++ on Mac

不想你离开。 提交于 2019-12-03 17:47:39
问题 When I try to run this int N=10000000; short res[N]; I get segmentation fault 11 when I change to int N=1000000; short res[N]; it works fine 回答1: You've exceeded your stack space given by the OS. If you need more memory, the easiest way is to allocate it dynamically: int N=1000000; short* res = new short[N]; However, std::vector is preferred in this context, because the above requires you to free the memory by hand. int N = 1000000; std::vector<short> res (N); If you can use C++11, you can

Segmentation faults occur when I run a parallel program with Open MPI

故事扮演 提交于 2019-12-03 17:11:49
问题 on my previous post I needed to distribute data of pgm files among 10 computers. With help from Jonathan Dursi and Shawn Chin, I have integrate the code. I can compile my program but it got segmentation fault. I ran but nothing happen mpirun -np 10 ./exmpi_2 balloons.pgm output.pgm The result is [ubuntu:04803] *** Process received signal *** [ubuntu:04803] Signal: Segmentation fault (11) [ubuntu:04803] Signal code: Address not mapped (1) [ubuntu:04803] Failing at address: 0x7548d0c [ubuntu

Why is LLVM segfaulting when I try to emit object code?

扶醉桌前 提交于 2019-12-03 16:58:43
I'm trying to follow along with the LLVM tutorial on compiler implementation, but my code segfaults when I try to emit object code. Here's a minimal example that attempts to compile a function func . To keep things simple, func is a function that does nothing. #include <iostream> #include <llvm/ADT/Optional.h> #include <llvm/IR/BasicBlock.h> #include <llvm/IR/DerivedTypes.h> #include <llvm/IR/Function.h> #include <llvm/IR/IRBuilder.h> #include <llvm/IR/LLVMContext.h> #include <llvm/IR/LegacyPassManager.h> #include <llvm/IR/Module.h> #include <llvm/IR/Type.h> #include <llvm/IR/Verifier.h>

What can cause a Java native function (in C) to segfault upon entry?

允我心安 提交于 2019-12-03 15:54:25
问题 The Project I'm writing a Java command line interface to a C library of internal networking and network testing tools using the Java Native Interface. The C code (which I didn't write) is complex and low level, often manipulates memory at the bit level, and uses raw sockets exclusively. The application is multi-threaded from the C side (pthreads running in the background) as well as the Java side (ScheduledThreadPoolExecutors running threads that call native code). That said, the C library

graphviz segmentation fault

情到浓时终转凉″ 提交于 2019-12-03 15:46:43
I'm building a graph with many nodes, around 3000. I wrote a simple python program to do the trick with graphviz, but it gives me segmentation fault and I don't know why, if the graph is too big or if i'm missing something. The code is: #!/usr/bin/env python # Import graphviz import sys sys.path.append('..') sys.path.append('/usr/lib/graphviz') import gv # Import pygraph from pygraph.classes.graph import graph from pygraph.classes.digraph import digraph from pygraph.algorithms.searching import breadth_first_search from pygraph.readwrite.dot import write # Graph creation gr = graph() file =

Segmentation Fault on creating an array in C

独自空忆成欢 提交于 2019-12-03 15:41:35
I have recently migrated to a new laptop - HP dv6119tx (Intel Core i5, 4 GB RAM). It has Windows 7 Home Premium 64 bit installed. I am trying to create an array of type int of length 10^6 in C++ (Dev C++), which I used to create comfortably on my last laptop (32 bit Windows 7 Ultimate/Ubuntu Linux, 2GB RAM) and every other environment I have programmed on (It should take around 3.5 MB of RAM). But with the current setup, I am getting a "Segmentation Fault" error in Debug Mode. SCREENSHOTS (EDIT) : The first screenshot shows 10^5 working on the current setup and 10^6 not. I do not have a

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)

試著忘記壹切 提交于 2019-12-03 14:05:54
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 (Gingerbread) HTC Desire Z (Gingerbread) HTC Wildfire (Gingerbread) Advent Vega tablet (Vegacomb) Asus EE

Core dump analysis using gdb

蓝咒 提交于 2019-12-03 13:38:42
问题 I have a couple of questions regarding core dumps. I have gdb on Windows, using Cygwin. What is the location of core dump file? Is it a.exe.stackdump file? (This is the only file that generated after crash) I read on other forums that the core dump file is named "core". But I don't see any file with name "core". What is the command for opening and understanding core dump file? 回答1: You need to configure Cygwin to produce core dumps by including error_start=x:\path\to\dumper.exe in your CYGWIN

Python - C embedded Segmentation fault

岁酱吖の 提交于 2019-12-03 12:27:58
I am facing a problem similar to the Py_initialize / Py_Finalize not working twice with numpy .. The basic coding in C: Py_Initialize(); import_array(); //Call a python function which imports numpy as a module //Py_Finalize() The program is in a loop and it gives a seg fault if the python code has numpy as one of the imported module. If I remove numpy, it works fine. As a temporary work around I tried not to use Py_Finalize(), but that is causing huge memory leaks [ observed as the memory usage from TOP keeps on increasing ]. And I tried but did not understand the suggestion in that link I