segmentation-fault

C program to transfer contents of one array to another results in segmentation fault

≯℡__Kan透↙ 提交于 2019-12-12 04:05:14
问题 C beginner here. My transfer function is supposed to take 5 parameters, two arrays (first array has values the other is empty), a length value for the arrays, a size of value, a remove function, and an insert function. It then takes the values of the first array and puts them in a linked list. Then it removes the values from the linked list and inserts them into the 2nd array. Unfortunately I'm getting the following error message when the transfer function runs in test.c file. Segmentation

Code fails with segmentation fault

大憨熊 提交于 2019-12-12 03:54:17
问题 I am getting a segmentation fault failure in my code. I have narrowed down the code to this simplified version. I have removed the obvious malloc checks as there was no failure in malloc . I am getting an error when I try to access a[0] in do_something but when I try to access the same in the give_mem_and_do it doesnt fail. I am not able to comprehend the reason . I am passing the address of a location that is already allocated on the heap. So why should it in fail in accessing this location.

Android - concurrent access to the canvas safely?

一世执手 提交于 2019-12-12 03:40:56
问题 I'm making a grid + tile activity where tiles need to move across the grid. The grid (and tiles) are being drawn on a surfaceView in a separate thread to the UI (UI deals with touch events and pushes them onto a queue for the grid to process). This is all fine. I have a toolbar from which I can drag tiles. The toolbar is a View which has been added to the relative layout (and runs on the UI thread). No matter how many times i use synchronize or try to safeguard the canvas from being written

When I run my own images on caffe , it stop at Iteration 0, Testing net (#0)

半世苍凉 提交于 2019-12-12 03:36:35
问题 I ran caffe and got this output: who can tell me what is the problem? I will really appreciate!! 回答1: It seems like one (or more) of your label values are invalid, see this PR for information: If you have an invalid ground truth label, "SoftmaxWithLoss" will silently access invalid memory [...] The old check only worked in DEBUG mode and also only worked for CPU. Make sure your prediction vector length matches the number of labels you try to predict. From your comments, it seems like you have

Segfault in c++ program; Incomprehensible valgrind output

折月煮酒 提交于 2019-12-12 03:29:42
问题 I'm currently writing my first big c++-project but encountered a segmentation fault when running the program. I already tried to debug it using valgrind, but so far without success. Since the program is quite big, I'll show only the relevant function in which the error occured: void RigidBody::RotateAroundAxis( dReal Angle, dRealVector3 Axis, dRealVector3 Anchor) { std::cout<<"RotateAroundAxis BodyID: " << this->GetBodyId()<<std::endl; dRealMatrix3 RotationMatrix=HelperFunctions:

-Dfile.encoding=UTF-16BE crashes JavaFX

给你一囗甜甜゛ 提交于 2019-12-12 03:27:30
问题 When I use the JVM flag -Dfile.encoding=UTF-16BE to launch a JavaFX application libfreetype.so.6 catches a SIGSEGV . It only happens in JavaFX applications and if I don't use the flag the application launches fine and I can use UTF-16BE to write files without problem by specifying the charset in my code. This is my crash log https://drive.google.com/open?id=0BzW0t4K6XI4gdHhWa0M2YWNtUTQ 来源: https://stackoverflow.com/questions/37206211/dfile-encoding-utf-16be-crashes-javafx

Segmentation fault at 'ilutGLLoadImage'

给你一囗甜甜゛ 提交于 2019-12-12 03:18:27
问题 Anyone happen to know why I'm getting a segmentation fault at line 2 below (this is after all my glInit stuff)? I've tried different image formats (.jpeg, .png, .bmp, all from internet). Debug tips or anything helps! If you wanna see more source, ask and I'll edit promptly. ilutRenderer(ILUT_OPENGL); GLuint tex1 = ilutGLLoadImage("/home/brent/Desktop/myimage.jpeg"); gdb backtrace, for what it's worth: #0 0x00000000 in ?? () #1 0x021b318e in ilDetermineType ( FileName=0x804ad84 "/home/brent

double free or corruption(fasttop) error/segmentation fault in C

醉酒当歌 提交于 2019-12-12 03:17:29
问题 I'm trying to dynamically allocate an array to read user input from the command line. It works 99/100 times, but if I type in a bunch of characters repeatedly I will sometimes get a segmentation fault error OR a double free or corruption(fasttop) error. This error is relatively hard to reproduce. I'm pretty sure the error occurs because of the way I'm reallocating the array. while(1){ char *buf_in; // Holds user keyboard input int cnt = 0, length = 0; // cnt stores current read buffer size,

SIGSEGV on declaration

懵懂的女人 提交于 2019-12-12 03:08:02
问题 Ok, so this is my WHOLE code. I removed everything else. I can compile it no probs in codeblocks but when using an evaluator it gives me sigsegv Makes no sense to me... It's not because of too much memory allocated btw. #include <iostream> #include <cstdio> #include <queue> #include <cmath> using namespace std; int n; int kx,ky,px,py; long long a,b,c; struct par { int x,y; }; long long int bsiter,bsearch; par start,stari,novi; long long int high[1001][1001]; int val[1001][1001]; int ud,rl;

Segmentation fault 11, python hash with lists, hashing 1 million objects

北城以北 提交于 2019-12-12 03:05:08
问题 When I try to make and hash objects from a file, containing one million songs, I get a weird segmentation error after about 12000 succesfull hashes. Anyone have any idea why this: Segmentation fault: 11 happens when I run the program? I have these classes for hashing the objects: class Node(): def __init__(self, key, value = None): self.key = key self.value = value def __str__(self): return str(self.key) + " : " + str(self.value) class Hashtable(): def __init__(self, hashsize, hashlist =