segmentation-fault

libVLC function media_player_new() throws Segmentation Fault

落爺英雄遲暮 提交于 2019-12-05 10:21:18
media_player_new() throws segmentation fault. import vlc ins=vlc.Instance() player=ins.media_player_new() Here is where it crashes: Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 libvlc.dylib 0x000000010059aa78 libvlc_media_player_new + 24 libvlc.dylib is in the place where script is looking: /Applications/VLC.app/Contents/MacOS/lib vlc.py can be found here: git://git.videolan.org/vlc/bindings/python.git Any ideas why or how to debug? Launch Python in 32 bit modes by running export VERSIONER_PYTHON_PREFER_32_BIT=yes This is not an ideal solution, but it works for me. Applying these

C++ std::vector of pointers deletion and segmentation faults

江枫思渺然 提交于 2019-12-05 10:07:23
I have a vector of pointers to a class. I need to call their destructors and free their memory. Since they are vector of pointers vector.clear() does not do the job.So I went on to do it manually like so : void Population::clearPool(std::vector<Chromosome*> a,int size) { Chromosome* c; for(int j = 0 ;j < size-1;j++) { c = a.back(); a.pop_back(); delete c; printf(" %d \n\r",j); c = NULL; } } The printf in there is since I have a talking destructor to see in which Chromosome the segmentation fault happens. When clearPool() is called and say we got a size of 100, it can give a segmentation fault

pthread_cond_broadcast broken with dlsym?

一笑奈何 提交于 2019-12-05 10:02:57
I am trying to interpose calls to pthread_cond_broadcast using LD_PRELOAD mechanism. My interposed pthread_cond_broadcast function just calls the original pthread_cond_broadcast. However, for a very simple pthread code where both pthread_cond_wait and pthread_cond_broadcast get invoked, I either end up with a segfault in glibc (for glibc 2.11.1) or the program hangs (for glibc 2.15). Any clues on that is going on? The interposition code (that gets compiled as a shared library): #define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <dlfcn.h> static int (*orig

C++ strange segmentation fault by object creation

心不动则不痛 提交于 2019-12-05 08:15:09
问题 I have a strange problem by initiating a class object. The problem is as strange as well not easily reproducible. However I will try to give an indicating example. I have inheritance classes. class BarClass { public: BarClass() { ... } BarClass(int i, int j) { ... } void doSomething() { ... } }; class FooClass : public BarClass { public: FooClass() { } FooClass(int i, int j) : BarClass(i,j) { ... } }; Sometime if I initiate objects with following manner, I will get segmentation fault error by

Segmentation fault in std::map::insert(…)

这一生的挚爱 提交于 2019-12-05 07:43:31
i've used search but i didn't find answer satisfying me... so.. this is chunk of code: //VoteContainer.h typedef uint32_t order_id_t; typedef int driver_id_t; class Vote { public: enum DriverVoteResponse {YES, NO, TIMEOUT}; struct DriverResponse { driver_id_t driver_id; time_t time; DriverVoteResponse response; }; Vote() : m_order_id(0), m_time_until(0) {}; Vote(order_id_t inOrderId, std::vector<driver_id_t> inPermittedDrivers, int inSeconds); Vote(const Vote & other) : m_order_id(other.m_order_id), m_time_until(other.m_order_id) { m_drivers_responses = other.m_drivers_responses; m_permitted

Segmentation fault with opencv, in python on Raspberry

做~自己de王妃 提交于 2019-12-05 07:03:05
I'm making a really simple program which capture a video from a Raspberry pi camera, using opencv in python. I'm using Raspbian as OS. I've already made a few programs with the version 2.4.5 of opencv and now i've installed opencv 2.4.9. All the programs that i used to run on the previous version of opencv are not working now, and i think i found the point in which the programs gives me errors. Just trying to launch the following code: import cv2 import numpy as np cap = cv2.VideoCapture(0) resAcquisitionWidth = 160 resAcquisitionHeight = 120 cap.set(3, resAcquisitionWidth); cap.set(4,

Understanding the output of electric fence and gdb

♀尐吖头ヾ 提交于 2019-12-05 04:36:11
When debugging a program that terminates with a segfault, electric fence, in conjunction with gdb, returns this: "ElectricFence Exiting: mprotect() failed: Cannot allocate memory [Thread 0xb0bd4b70 (LWP 5363) exited] Program exited with code 0377. I actually thought electric fence would be more helpful. What does this mean? How can I interpret this piece of information? There doesn't seem to be any stack left that I can look at, or at least bt won't return anything. Any suggestion would be really appreciated. Thanks! Curtis P You have probably run out of memory map areas. The default is known

C++ in G++ - Segmentation Fault when not using pointers

情到浓时终转凉″ 提交于 2019-12-05 04:23:38
问题 I'm trying to use G++ to compile some C++ code. It seems to work fine in other compilers, but for whatever reason, G++ won't produce working output. Disclosure: This is part of a homework assignment, but I feel like it's more of a compiler issue, since it works in other compilers. Here's the snippet that's wreaking havoc: set<int> t1, t2; It's strange because the following code works just fine: set<int> *t1 = new set<int>(); set<int> *t2 = new set<int>(); Granted, I have to use -> instead of

C++11 std::vector in concurrent environment

不想你离开。 提交于 2019-12-05 02:28:50
I had an issue (segfault) running a multithreaded code in C++11. Here it is the code: #include <vector> #include <thread> std::vector<int> values; int i; void values_push_back() { values.push_back(i); } int main() { while(true) { std::vector<std::thread> threads; for(i=0; i<10; ++i) { std::thread t(values_push_back); threads.push_back(std::move(t)); } for(i=0; i<10; ++i) threads[i].join(); } return 0; } And here the backtrace on gdb: http://pastebin.com/5b5TN70c What's wrong in that? hmjd This is unrelated to moving. Multiple threads are executing vector::push_back() on the same vector but

Fortran 90 - “Segmentation fault - invalid memory reference” with scalable 3D array

那年仲夏 提交于 2019-12-05 02:25:41
I have compiled a fortran 90 program with gfortran which builds a scalable 3D array in a way I want. Upon running, I get the following error: Program received signal SIGSEGV: Segmentation fault - invalid memory reference. Backtrace for this error: #0 0x10542ee42 #1 0x10542f60e #2 0x7fff8d7895a9 #3 0x10542575e #4 0x105425975 #5 0x105425d0e Segmentation fault: 11 I believe this is a memory issue with the large 3D array, as it works if I decrease the dimensions, but is there anyway to get around this? Here is my code: PROGRAM phantomtest IMPLICIT NONE INTEGER, PARAMETER:: columns=34, rows=34,