segmentation-fault

glibc detected error

不想你离开。 提交于 2019-12-29 09:56:10
问题 Can anybody please help me make sense of this error message? *** glibc detected *** ./kprank_new3_norm: munmap_chunk(): invalid pointer: 0x00000000096912d0 *** ======= Backtrace: ========= /lib64/libc.so.6(cfree+0x1b6)[0x3df6e75a36] ./kprank_new3_norm[0x409277] ./kprank_new3_norm[0x4092a9] ./kprank_new3_norm[0x4092ea] ./kprank_new3_norm[0x40941f] ./kprank_new3_norm[0x40943b] ./kprank_new3_norm[0x40945f] ./kprank_new3_norm[0x409628] ./kprank_new3_norm[0x4096a7] ./kprank_new3_norm[0x40968d] .

“[notice] child pid XXXX exit signal Segmentation fault (11)” in apache error.log

心已入冬 提交于 2019-12-29 09:50:13
问题 First off: this is no duplicate as the solution provided differs from any solution for similar questions and "[notice] child pid XXXX exit signal Segmentation fault (11)" in apache error.log does not accept any more answers. Also I cannot comment on SO yet. I just upgraded from PHP-7.0 to PHP-7.3 (or any version combo for that matter) and am now getting [notice] child pid XXXX exit signal Segmentation fault (11) in my apache error.log file. Other solutions to this question did not apply:

Why does this generate a segmentation fault?

社会主义新天地 提交于 2019-12-29 06:56:26
问题 #include<stdio.h> void foo(int **arr) { arr[1][1]++; } main() { int arr[20][20]; printf("%d\n",arr[1][1]); foo((int**)arr); printf("%d\n",arr[1][1]); } 回答1: Suppose you declare: int arr[ 10 ][ 20 ] ; What type is arr? You may think that it's int ** , but that's incorrect. Its actually of type int (*)[20] when it decays (like when you pass it to a function); Array decaying applies only once. Details here Now consider the following, #include<stdio.h> #include<stdlib.h> void foo(int arr[][20]) {

Why glibc's fclose(NULL) cause segmentation fault instead of returning error?

馋奶兔 提交于 2019-12-28 04:01:36
问题 According to man page fclose(3) : RETURN VALUE Upon successful completion 0 is returned. Otherwise, EOF is returned and the global variable errno is set to indicate the error. In either case any further access (including another call to fclose() ) to the stream results in undefined behavior. ERRORS EBADF The file descriptor underlying fp is not valid. The fclose() function may also fail and set errno for any of the errors specified for the routines close(2) , write(2) or fflush(3) . Of course

String literals: pointer vs. char array

徘徊边缘 提交于 2019-12-28 03:38:50
问题 In this statement: char *a = "string1" What exactly is string literal? Is it string1 ? Because this thread What is the type of string literals in C and C++? says something different. Up to my knowledge int main() { char *a = "string1"; //is a string- literals allocated memory in read-only section. char b[] = "string2"; //is a array char where memory will be allocated in stack. a[0] = 'X'; //Not allowed. It is an undefined Behaviour. For me, it Seg Faults. b[0] = 'Y'; //Valid. return 0; }

What causes a Python segmentation fault?

a 夏天 提交于 2019-12-27 11:03:44
问题 I am implementing Kosaraju's Strong Connected Component(SCC) graph search algorithm in Python. The program runs great on small data set, but when I run it on a super-large graph (more than 800,000 nodes), it says "Segmentation Fault". What might be the cause of it? Thank you! Additional Info: First I got this Error when running on the super-large data set: "RuntimeError: maximum recursion depth exceeded in cmp" Then I reset the recursion limit using sys.setrecursionlimit(50000) but got a

Memory Allocation (Pointers and Stacks)

北慕城南 提交于 2019-12-26 06:49:10
问题 I've created a stack of pointers, which is being used to create a binary tree. While I can fill the stack with individual nodes, upon trying to allocate the top node's memory to a new node so I can create an actual tree, it segfaults. As an example: TreeNode *c = new TreeNode; c = stack.top(); //this segfaults I'm not sure if I'm misunderstanding how this works, but since both are of the same type, shouldn't c be able to equal the top of the stack? I've been stuck on this for hours now. 回答1:

Memory Allocation (Pointers and Stacks)

混江龙づ霸主 提交于 2019-12-26 06:49:04
问题 I've created a stack of pointers, which is being used to create a binary tree. While I can fill the stack with individual nodes, upon trying to allocate the top node's memory to a new node so I can create an actual tree, it segfaults. As an example: TreeNode *c = new TreeNode; c = stack.top(); //this segfaults I'm not sure if I'm misunderstanding how this works, but since both are of the same type, shouldn't c be able to equal the top of the stack? I've been stuck on this for hours now. 回答1:

Segmentation faults using f2py

随声附和 提交于 2019-12-26 04:04:20
问题 This is a follow up to a question I asked here... How do I allocate input arrays with f2py? I've reworked the question in response to comments. The original question was unclear and too lengthy. See comment 1 below. I am trying to use f2py to wrap various fortran subroutines/functions for reading the data output from a variety of atomic physics codes written in fortran 77. I am using the Anaconda python distribution (python 3.4 64 bit) on Ubuntu 14.04 (64 bit) with the gnu compiler suite (gcc

Segmentation faults using f2py

心不动则不痛 提交于 2019-12-26 04:02:34
问题 This is a follow up to a question I asked here... How do I allocate input arrays with f2py? I've reworked the question in response to comments. The original question was unclear and too lengthy. See comment 1 below. I am trying to use f2py to wrap various fortran subroutines/functions for reading the data output from a variety of atomic physics codes written in fortran 77. I am using the Anaconda python distribution (python 3.4 64 bit) on Ubuntu 14.04 (64 bit) with the gnu compiler suite (gcc