segmentation-fault

Python: help(numpy) causes segfault on exit

女生的网名这么多〃 提交于 2019-12-08 17:06:33
问题 I came across a strange occurrence: in the python interpreter, I do the following: >>>import numpy >>>help(numpy) The help displays correctly, but as soon as I press q to return to the interpreter: Segmentation fault (core dumped) I have no idea what causes the segfault and it still happens if I import numpy with a local name (the typical np). This does not happen with any other libraries. I tried uninstalling and reinstalling numpy but that made no difference. Is numpy too large to handle

Calling isalpha Causing Segmentation Fault

筅森魡賤 提交于 2019-12-08 15:50:13
问题 I have the following program that causes a segmentation fault. #include <stdio.h> #include <string.h> #include <ctype.h> int main(int argc, char *argv[]) { printf("TEST"); for (int k=0; k<(strlen(argv[1])); k++) { if (!isalpha(argv[1])) { printf("Enter only alphabets!"); return 1; } } return 0; } I've figured out that it is this line that is causing the problem if (!isalpha(argv[1])) { and replacing argv[1] with argv[1][k] solves the problem. However, I find it rather curious that the program

PHP segmentation fault caused by php while loop

徘徊边缘 提交于 2019-12-08 15:28:55
问题 I discovered a way to make php segfault, and I'm a bit curious about what's happening. Maybe someone can explain this for me? joern@xps:..com/trunk5/tools/nestedset> cat > while.php <?php while(1){ die('dd'); } ?> ^C 0 joern@xps:..com/trunk5/tools/nestedset> php -f while.php ddzsh: segmentation fault php -f while.php 0 joern@xps:..com/trunk5/tools/nestedset> php -f while.php dd% 0 joern@xps:..com/trunk5/tools/nestedset> php -f while.php dd% 0 joern@xps:..com/trunk5/tools/nestedset> php -f

Writing to screen solves segmentation error?

亡梦爱人 提交于 2019-12-08 14:29:36
问题 I'm calling (external) subroutine Objee from within another subroutine (FindVee): subroutine FindVee(EVone,Vw0,Ve,Fye) use nag_library, only: nag_wp use My_interface_blocks, only: Objee ... implicit none real(kind=nag_wp) :: apmax, Val ... call Objee(apmax,Val) write(*,*) 'After Objee', apmax, Val ... end subroutine FindVee Subroutine Objee is: subroutine Objee(ap,V) use nag_library, only: nag_wp ... implicit none real(kind=nag_wp), intent(in) :: ap real(kind=nag_wp), intent(out):: V ... V =

Printing pointer to integer causes segmentation fault. Why?

孤街浪徒 提交于 2019-12-08 14:14:03
问题 #include<stdio.h> main() { int *num2=20; printf("\n\n\n%d",num2); } When I run it as it is, it prints 20 . If I use *num2 it causes segmentation fault. Why? 回答1: Why printing num was okay but *num resulted in segmentation fault? When you say, int *num2=20; . It is equivalent to int *num; /* Type:(int*) num is a pointer to an integer and hence holds address of an integer object. */ num = 20; /* Type of the value assigned to num is (int).*/ You are assigning int to int * . You should have

Segmentation fault with GDB debugger - C

半世苍凉 提交于 2019-12-08 13:55:48
问题 I am trying to "debug" this program using GDB debugger. I get the Segmentation fault (core dumped) when I execute the program. This is my first time using GDB, so I do not really know what command to use or what to expect. EDIT: I know what the error is. I need to find it using the GDB Debugger This is the code: #include <stdio.h> int main() { int n, i; unsigned long long factorial = 1; printf("Introduzca un entero: "); scanf("%d",n); if (n < 0) printf("Error! Factorial de un numero negativo

C string from GetString() when strlen produces segmentation fault [closed]

此生再无相见时 提交于 2019-12-08 13:20:23
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I am running a program in C. When I run the program I get a segmentation fault error. IN gdb when I backtrace it tells me Program received signal SIGSEGV

Is there an error in many TQLI implementations in C?

霸气de小男生 提交于 2019-12-08 11:10:56
问题 In the comments of this question user Groo discovered, that in this TQLI implementation for C done by the Collaboratory For Advanced Computing And Simulations of the University of Southern California there is the very basic mistake that all arrays are treated as if they would be one-based. Although it already seems very strange to me that a very renowned institution would have such a basic mistake in one of there codes it confuses me even more, that basically every other implementation of the

Passing Object over Server to client

邮差的信 提交于 2019-12-08 10:28:45
问题 I am trying to create a client server application in linux. Server is supposed to send one object to all connected clients. Here is the code for it. In this When server send object, everything remains ok at server side but Segmentation fault occurs on client server immediately it receive it. Server: #include "Question.h" #include <iostream> #include <string.h> using namespace std; #include<sys/socket.h> #include<sys/types.h> #include<stdio.h> #include<arpa/inet.h> #include<time.h> #include

SIGSEGV with a recursive algorithm

故事扮演 提交于 2019-12-08 10:04:48
问题 I implemented a recursive algorithm which runs for about 1730 recursions and then crashes with a mysterious SIGSEGV. I tried my gdb and got the following output: Program received signal SIGSEGV, Segmentation fault. 0x000000000040b7da in Town::get_cur_capacity (this=0x61efe0) at ./solver/Darstellung.cpp:54 54 return left_over_capacity; (gdb) print 0x61efe0 $1 = 6418400 (gdb) print *0x61efe0 Cannot access memory at address 0x61efe0 (gdb) print this $2 = (const Town * const) 0x61efe0 (gdb) How