segmentation-fault

SegFault with Producer/Consumer File Copy

核能气质少年 提交于 2020-01-06 12:36:10
问题 back with another segfault. Not sure why, as this readdir line is the same one i've been using in other file copy assignments. Below is the code I crafted in lieu of the assignment shared here. I have commented where the segfault occurs in hopes of aiding better minds find my flaw! This is copyDirs.cpp //cmd: ./a.out [#ofConsumerThreads] [src directory] [dest directory] #include "copyDirs.h" int main(int ac,char* av[]) { pthread_mutex_init(&buflock,NULL); pthread_t prodT; if(ac == 4) { int

Segmentation fault CORBA C++

青春壹個敷衍的年華 提交于 2020-01-06 08:27:28
问题 I am trying to build a CORBA application, which has the following IDL interface: module Chat { exception SesionNoIniciada{}; exception UsuarioNoRegistrado{}; exception ErrorServidor{}; exception SesionYaIniciada{}; interface Cliente{ readonly attribute string nombre; oneway void nuevaSolicitudDeAmistad(in string c); //devuelve void, parametro string/char* oneway void actualizarListaAmigos(); oneway void nuevoMensaje(in Cliente usuario, in string men); }; typedef sequence<string> nombres;

Java2D Disposer Thread crashing the JVM

家住魔仙堡 提交于 2020-01-06 08:17:13
问题 My application is running on a jboss wich randomly crashes. After generating the below error file, we started investiguating. We are running withe the following ecosystem : jboss : JBOSS EAP 6.2 jvm : 1.7.0.121-2.6.8.1.el6_8 OS:Red Hat Enterprise Linux Server release 6.9 (Santiago) uname:Linux 2.6.32-696.30.1.el6.x86_64 libc:glibc 2.12 If I well understood, this is due to the garbage collection of native resources created by java.awt package. The thread responsible of that is Java2D Disposer.

Passing an array to a function - Different values - Segfault

柔情痞子 提交于 2020-01-06 07:52:10
问题 I have the following code: gpointer w[3]; GtkWidget *menu_item = gtk_menu_item_new(); w[0] = menu_item; menu_item = gtk_menu_item_new(); w[1] = menu_item; GtkTextBuffer *buffer = gtk_text_buffer_new(NULL); w[2] = buffer; This is all good till now. Let's now connect a signal: g_signal_connect(w[0], "activate", G_CALLBACK(runner), w); runner function is declared as: void runner(gpointer root, gpointer w[]); Testing the values of w array before entering runner and while in it shows that they

throw exception when Java JNI experiences segmentation fault

Deadly 提交于 2020-01-06 07:20:17
问题 We have code running JNI in a separate thread. We occasionally get segmentation faults while developing that we need to debug, but because the code is running in a separate thread the seg-fault isn't reported. Instead the thread essentially dies without warning making debugging difficult. I would like to be able to either detect a segmentation fault and/or throw an exception when a seg fault occurs so that we have some indication that a thread has died without warning. Is there any way to

Why doesn't the following code produce a segmentation fault? [duplicate]

你。 提交于 2020-01-06 03:02:26
问题 This question already has answers here : Accessing an array out of bounds gives no error, why? (17 answers) Closed 6 years ago . #include <iostream> using namespace std; int a[4]; int main(){ int b=7; cout<<a[b]<<endl; return 0; } I was trying to access the memory that was not allocated. So I expect the output to be a segmentation fault,instead the output is some garbage value. Later I increased 'b' to 1000, now the output is 'Segmentation fault'. Is there a specific reason for this kind of

Segmentation fault (core dumped) on Server side in CORBA C++/Java application

十年热恋 提交于 2020-01-05 08:29:37
问题 I have such code: interface Employee { string getLastname(); }; #include "Employee.idl" interface Work { Employee getEmployee(in short id); }; Server files: #include "Employee.hh" class EmployeeImpl : public POA_Employee { private: char* lastname; int id; public: EmployeeImpl(const char* lastname, int id); char* getLastname(); }; #include "EmployeeImpl.h" EmployeeImpl::EmployeeImpl(const char* lastname, int id) { this->lastname = const_cast<char*>(lastname); this->id = id; } char*

PyQt segfault when trying to get a sub-sub-property in QML

会有一股神秘感。 提交于 2020-01-05 08:03:22
问题 I was trying to Return an object in a role in Python and get a reference of another object in QML. Finally, I found I can use Property to do it. But, I want to get a reference of another reference of another object in QML, PyQt just segfault. I switched to PySide but it was still crashing when I run it. Did I doing something wrong? GDB said Cannot access memory at address 0xb Cannot access memory at address 0x3 main.py import sys from PySide import QtCore, QtGui, QtDeclarative from PySide

PyQt segfault when trying to get a sub-sub-property in QML

和自甴很熟 提交于 2020-01-05 08:03:11
问题 I was trying to Return an object in a role in Python and get a reference of another object in QML. Finally, I found I can use Property to do it. But, I want to get a reference of another reference of another object in QML, PyQt just segfault. I switched to PySide but it was still crashing when I run it. Did I doing something wrong? GDB said Cannot access memory at address 0xb Cannot access memory at address 0x3 main.py import sys from PySide import QtCore, QtGui, QtDeclarative from PySide

segmentation fault in C by replacing a string's letter [duplicate]

天涯浪子 提交于 2020-01-05 05:24:25
问题 This question already has answers here : Modifying String Literal [duplicate] (4 answers) Closed 3 years ago . I want to replace a character (for example the second one) from a string. What's wrong with my code? It can compile, but instead of doing what I need it give me a Segmentation fault. Thanks! #define _XOPEN_SOURCE #include <unistd.h> #include <stdio.h> #include <cs50.h> #include <string.h> int main (int argc, string argv[]) { string key="abcd"; key[1]='f'; } And after compiled my code