segmentation-fault

Seg Fault when using std::string on an embedded Linux platform

狂风中的少年 提交于 2019-12-19 08:11:11
问题 I have been working for a couple of days on a problem with my application running on an embedded Arm Linux platform. Unfortunately the platform precludes me from using any of the usual useful tools for finding the exact issue. When the same code is run on the PC running Linux, I get no such error. In the sample below, I can reliably reproduce the problem by uncommenting the string, list or vector lines. Leaving them commented results in the application running to completion. I expect that

segfault using numpy's lapack_lite with multiprocessing on osx, not linux

落爺英雄遲暮 提交于 2019-12-19 05:18:37
问题 The following test code segfaults for me on OSX 10.7.3, but not other machines: from __future__ import print_function import numpy as np import multiprocessing as mp import scipy.linalg def f(a): print("about to call") ### these all cause crashes sign, x = np.linalg.slogdet(a) #x = np.linalg.det(a) #x = np.linalg.inv(a).sum() ### these are all fine #x = scipy.linalg.expm3(a).sum() #x = np.dot(a, a.T).sum() print("result:", x) return x def call_proc(a): print("\ncalling with multiprocessing")

C - Unexpected Segmentation Fault on strtok(…)

笑着哭i 提交于 2019-12-19 04:28:09
问题 I am using strtok(...) of the library and it appears to be working fine until the end condition, where it results in a segmentation fault and program crash. The API claims that strtok(...) will output a NULL when there are no more tokens to be found, which meant, I thought, that you had to catch this NULL in order to terminate any loops that you were running using strtok(...). What do I need to do to catch this NULL to prevent my program from crashing? I imagined the NULL was allowed for use

Segfault when deleting pointer

好久不见. 提交于 2019-12-19 04:19:30
问题 I've been experiencing segfaults when running some C++ code. I've isolated the problem to a line in the program that deletes a pointer. Here's a simple example that produces the same error: int main() { int* pointer=0; int number = 3; pointer = &number; delete pointer;//This line causes a segmentation fault pointer=0; return 0; } A slight modification produces code that will work as expected: int main() { int* pointer=new int(3); delete pointer;//This line now works pointer=0; return 0; } Can

std::sort with equal elements gives Segmentation fault

烂漫一生 提交于 2019-12-19 03:31:11
问题 I have a container storing pointers. I am trying to sort these pointers in non-increasing order based on a data member in the corresponding objects pointed by the pointers. In my case, it is possible that many objects have the same value for that data member. The following is a short code to illustrate the problem. The call to the sort function is giving a Segmentation fault. The weird thing about this is, if I have 16 elements in the container pointing to objects with same value for the

Segmentation Fault when trying to use scanf on a struct

南楼画角 提交于 2019-12-18 17:37:32
问题 I'm pretty new to c and I'm pretty frustrated at the moment as well. Here's the code I have: typedef struct { char* fName; char* lName; char* pNum; char* address; char* email; } contactInfo; void addContact(){ contactInfo *contact; contact = (contactInfo *) malloc (sizeof(contactInfo)); printf("\n[Add a contact]\nFirst Name: "); scanf("%s", contact->fName); printf("%s", contact->fName); } For some reason when I enter a value for the scanf it gives me a segmentation fault. If I try to add a &

Upgraded to ruby 1.9.2 and getting Segmentation Fault errors in nokogiri

只谈情不闲聊 提交于 2019-12-18 17:11:11
问题 I decided to upgrade to 1.9.2 ruby yesterday and also installed rvm to do it. I ran a few recent files I had working previously on 1.8.7 but anything requiring nokogiri fails with the following errors. /Users/myusername/.rvm/gems/ruby-1.9.2-p0/gems/nokogiri-1.4.3.1/lib/nokogiri/nokogiri.bundle: [BUG] Segmentation fault ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] I am running nokogiri 1.4.3.1, ruby 1.9.2 on OSX Snow Leopard 10.6.4 回答1: If you get a Segmentation fault error

When setting the WA_DeleteOnClose attribute on a Qt MainWindow, the program crashes when deleting the ui pointer

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 16:46:09
问题 I have set the WA_DeleteOnClose widget attribute in a MainWindow. setAttribute(Qt::WA_DeleteOnClose); However, whenever I close that main window, I get a segfault in its destructor, which only has delete ui; In a nutshell, created a Qt4 GUI Application in Creator, added the setAttribute(Qt::WA_DeleteOnClose); to constructor, program now crashes on exit. 回答1: Are you getting a segfault in its destructor the first time, or the second time? Remember that your main window destructor should run

c: catch a segfault in exec() which was run in a child process

こ雲淡風輕ζ 提交于 2019-12-18 13:42:11
问题 EDIT: I am trying to write a simple smoketest, where all options and reasonable parameters are tested. I used popen() to execute the program that should be tested. Using this approach does not work, because if the process dies with a signal (SIGINT, SIGSEGV...) the pipe from popen() does not tell me what happend. Writing a signal handler did not help since popen creates a new process that receives the signals but not my smoketest. Thanks to the answers i used pipe(), fork() and execv() to

rjava dependent package installation Segmentation fault (core dumped)

旧巷老猫 提交于 2019-12-18 12:38:45
问题 I am trying to reinstall a package that I was previously able to install and use. I was building a package of my own after my computer unexpectedly restarted and then I started to have problems loading the rpgraph package. So I decided to uninstall it and to reinstall it. When I did so I got the following error: library(devtools) library(rJava) install_github("Albluca/rpgraph") Downloading GitHub repo Albluca/rpgraph@master from URL https://api.github.com/repos/Albluca/rpgraph/zipball/master