segmentation-fault

Maximum number of threads

吃可爱长大的小学妹 提交于 2019-12-06 05:33:04
问题 I have a program which accepts 2 N -digit numbers, multiplies them using threads & prints the output. The number of threads created here are 2 * N - 1 . whenever I run the program for N > 151 , the program gives me a segmentation fault. Is there a cap on maximum number of threads a process can get from the thread pool? If so, could this be a valid reason for the fault? Edit: Valgrind finds no memory leaks for N <= 150 . I'm running the program in Linux 2.6.x kernel. 回答1: By default, each

Segmentation fault with rake db:create in Rails

我怕爱的太早我们不能终老 提交于 2019-12-06 04:04:44
问题 I'm running into a segmentation fault when I do rake db:create in a The error output is: /home/[username]/.rvm/gems/ruby-1.9.2-p0/gems/sqlite3-1.3.3/lib/sqlite3/sqlite3_native.so: [BUG] Segmentation fault ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux] Aborted I tried following the sample tutorial at http://guides.rubyonrails.org/getting_started.html and I get the same error with a brand new project. 回答1: Instead you should probably try rake db:migrate 来源: https://stackoverflow.com

Segmentation fault- strcat

倖福魔咒の 提交于 2019-12-06 03:48:11
This is my code: #include<stdio.h> #include<stdlib.h> #include<string.h> void main(int arge, char *argv[]) { FILE *f1; char ch,*fn="~/lyrics/"; strcat(fn,argv[1]); strcat(fn,".txt"); if( (f1 = fopen(fn,"r"))==NULL ) { printf("\nWrong filename\n%s not found",argv[1]); return; } while((ch=getw(f1))!=EOF) { printf("%c",ch); } } I compiled it using gcc -g -o file file.c and the compiler gave no error messages. But when I run it I get the error message: Segmentation fault (core dumped) Bad permissions for mapped region at address 0x8048659 at 0x402C36B: strcat (in /usr/lib/valgrind/vgpreload

After the Ruby interpreter segfaults, is it possible to get the Ruby backtrace from the corefile?

爷,独闯天下 提交于 2019-12-06 03:31:24
问题 Note: I'm using a segfault that I encountered whilst using the libxml-ruby gem to illustrate the question, but I've since fixed my problem with said gem. What this question is really about is viewing the Ruby backtrace (i.e. the same thing the interpreter prints when Ruby code fails to handle an exception) from gdb with a corefile the interpreter itself encounters a segmentation fault. I'm getting an odd segfault while generating an XML document, of all things: /railsroot/vendor/isolated/ruby

C++ Creating a SIGSEGV for debug purposes

你说的曾经没有我的故事 提交于 2019-12-06 03:23:25
问题 I am working on a lock-free shared variable class, and I want to be able to generate a SIGSEGV fault to see if my implementation works as I planned. I've tried creating a function that modifies a pointer and read it 100 times. I then call this function in both threads and have the threads run infinitely within my program. This doesn't generate the error I want. How should I go about doing this? edit I don't handle segfaults at all, but they are generated in my program if I remove locks. I

Linux - run android emulator on Nouveau driver

大兔子大兔子 提交于 2019-12-06 03:12:17
Linux (Debian Sid x64), kernel 4.14, Nvidia GPU. I am unable to run Android emulator on open Nouveau drivers. There is no any error message that I can post, jus segmentation fault. When I choose software rendering, it works but unusable (it runs very slow). Does anybody know any workaround for that, or I am forced to use official Nvidia drivers? 来源: https://stackoverflow.com/questions/47900233/linux-run-android-emulator-on-nouveau-driver

libsigsegv and responding to a stack overflow

天大地大妈咪最大 提交于 2019-12-06 03:06:58
问题 We are attempting to test student code, and in an effort to automate the process, we'd like to detect if a student's code overflows the stack. I've met with some success using the libsigsegv library and its corresponding stackoverflow_install_handler. It works brilliantly, until the student's code blows the stack twice. For example, here's some sample output: [# ~]$ ledit ./interpreter -> (use solution) -> (fun 1 2) *** Stack overflow detected *** -> (fun 1 2) Signal -10 [# ~] The initial " *

Boost.Asio segfault, no idea why

我们两清 提交于 2019-12-06 02:18:06
问题 This is a SSCCE from my Boost.Asio project based on the examples. It took me about an hour to track the bug down to this: #include <boost/bind.hpp> #include <boost/asio.hpp> #include <boost/shared_ptr.hpp> class Connection { public: Connection(boost::asio::io_service& io_service) : socket(io_service) {} private: boost::asio::ip::tcp::socket socket; }; class Server { public: Server() : signal_monitor(io_service) { signal_monitor.add(SIGINT); signal_monitor.add(SIGTERM); signal_monitor.async

Persistent Ruby segfaulting after a clean install

心已入冬 提交于 2019-12-06 01:49:42
Ruby keeps segfaulting when using the Koala gem to talk over HTTP: /Users/pawel/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault I've tried the following: Run which -a ruby which showed multiple Rubies via MacPorts. So I deleted those and running the same command again returns only /usr/bin/ruby I've removed the MacPorts version of PostgreSQL and installed it with Homebrew instead (With MacPorts, it installs its own version of OpenSSL) Running openssl version returns OpenSSL 1.0.0g 18 Jan 2012 I removed Ruby 1.9.3 from RVM and tried Luciano's method below

C segmentation fault before/during return statement

坚强是说给别人听的谎言 提交于 2019-12-06 01:48:04
问题 I print the value that I'm returning right before my return statement, and tell my code to print the value that was returned right after the function call. However, I get a segmentation fault after my first print statement and before my second (also interesting to note, this always happens on the third time the function is called; never the first or the second, never fourth or later). I tried printing out all of the data that I'm working on to see if the rest of my code was doing something it