segmentation-fault

GDB debugging trace with no relevant info (#0 0x2e6e6f69 in ?? ())

牧云@^-^@ 提交于 2019-12-12 00:55:32
问题 I am facing a specific challenge while debugging with GDB. My binary is generating core. When i am debugging it GDB. I am not getting relevant debugging information. GDB stack trace (bt):- [root@ussdgw5 bin]# gdb pull core.11328 GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5) Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO

Fortran segmentation fault in pointer array

爱⌒轻易说出口 提交于 2019-12-12 00:26:56
问题 I have a segmentation fault problem in fortran. I allocate a pointer array by calling a subroutine and pass this array to another subroutine. I compile this program by PGI fortran 9.0.2 on Linux machine. Here is my test program. How should I fix this problem? Thank you very much for your help. module hogehoge implicit none type foo real, pointer :: x(:)=>null() end type foo contains subroutine hogehoge_func(foox) type(foo), intent(inout) :: foox integer i allocate(foox%x(2048)) do i = 1, 2048

Segmentation fault when returning a sequence CORBA C++ Server Java Client

陌路散爱 提交于 2019-12-11 20:15:52
问题 I'm developing a project in which I need to implement a Chat server in C++ and Chat clients in Java using swing for implementing the GUI. I'm having exactly this problem, implementing nearly the same project: Segmentation fault CORBA C++ This is the part of my IDL where the problem is: typedef sequence<ICliente> ListaClientes; interface IServer { attribute ListaClientes lista; void registrar_usuario (in ICliente cliente) raises (usuarioRegistrado); IConversacion crear_conversacion (in

Class destruction segfault

独自空忆成欢 提交于 2019-12-11 19:58:26
问题 This post is not a duplicate. Read my question first. I'm certainly missing something here. I would like to have my Entity class be able to destroy an instance of itself when the health quantity is zero. virtual int takeDamage(int damage) { health -= damage; if(health <= 0) delete this; } What's wrong with the above code? The program crashes with a segfault when the last line above is called. So far I have tried: Making a custom destructor Making a destructor function: virtual void destroy

Segfault when adding Qwt plot to layout

Deadly 提交于 2019-12-11 19:55:03
问题 I try to build chart demo using Qwt and C++. I've added the following code to button click handler: QwtPlot *plot = new QwtPlot(QwtText("Demo")); plot->setGeometry(0, 0, 100, 100); QwtPlotCurve curve("Sine"); QVector<double> xs; QVector<double> ys; for (double x = 0; x < 100; x++) { xs.append(x); ys.append(sin(x)); } QwtPointArrayData *series = new QwtPointArrayData(xs, ys); curve.setData(series); curve.attach(plot); plot->show(); QLayout *lay = ui->centralWidget->layout(); lay->addWidget

Perl getting segmentation fault while timeout using alarm

折月煮酒 提交于 2019-12-11 18:49:03
问题 I'm writing Perl for the first time and Internet tells me i can use alarm if i have a long running sql query. I need to run a SP which will run for hours in a Perl, and i would like to set a time limit. Below is the last step of my codes but i'm getting segmentation fault when the process runs longer that my timeout, in this occasion sleep(20). Logs shows it finished printing ---1---- and then segmentation fault. How can I fix this? I tried taking sub DelRef{} out into a seperate .pl and

Swift enum segmentation fault

断了今生、忘了曾经 提交于 2019-12-11 18:35:01
问题 I have to following code: groupListeningObject = NSNotificationCenter.defaultCenter().addObserverForName(groupJoinedOrLeftNotificationName, object: nil, queue: nil) { [weak self] notification in if let notificationArray = notification.object as? [AnyObject] { let joinedOrLeft = JoinOrLeave(rawValue: notificationArray[1] as Int) if joinedOrLeft == .Join { //some code } } } This gives a segmentation fault error, but if I modify the if statement as follows: if joinedOrLeft == JoinOrLeave.Join

Using sockets in multithread server

試著忘記壹切 提交于 2019-12-11 18:18:52
问题 guys! I'm developing multithread server on c under *nix. In the main thread of the process I have listening socket which waits for connections (accept). When it gets a connection (accept returns client socket descriptor) I start new pthread whith some routine, which answers the request and closes client socket descriptor. It looking something like this: while(1) { sock_cl =(int *)malloc(sizeof(int)); *sock_cl = accept(sock_serv, NULL, NULL); pthread_create(thread, attr, answer, sock_cl); }

where is the cause of this segmentation fault, where 1 is entered into the item_choice_i/item_choice_k variable?

若如初见. 提交于 2019-12-11 18:08:19
问题 I'm getting a segmentation fault whenever a 1 is entered at the prompt for: print*,"where would you like to buy/sell from/into (enter first number between 1 and ", & size(energy(:,1)),"and second number between 1 and",size(energy(1,:)),")" So, I'm trying to create a simple program representing a market and it seems that everything else works so far, except when 1 is passed into the subroutine buy_sell through the item_choice_i or item_choice_k. I'm somewhat new at programming and I'm not sure

Segmentation Fault(core dumped)

寵の児 提交于 2019-12-11 18:03:29
问题 hey guys i have got this code: (im trying to read a string and put it inside the output file) #include "structs.h" #include <stdio.h> #include <stdlib.h> int main () { FILE* input = fopen("journal.txt", "r"); FILE* output = fopen("output.txt", "w"); char date[9]; if( ferror(input) || ferror(output) ) { perror("Error opening input/output file\n"); } fscanf(input, "%s", date); fgets(date, 9, input); fputs(date, output); fclose(input); fclose(output); return 0; } it compiles properly but at