segmentation-fault

SegFault after scanf?

#include <stdio.h> #define TimeConverter 60 #define TempFormula time * time * 4 / time + 2 - 20 double HoursMinToTime(int hour, int min); double Temperature(double time); int main() { int hour, min; double time, temperature; printf("Hours and minutes: "); scanf("%d %d", hour, min); //Segfault HERE time = HoursM...

Weird Pointer issue in C++

I'm running into a VERY frustrating pointer issue. I previously posted here: http://stackoverflow.com/questions/3114997/tough-dealing-with-deeply-nested-pointers-in-c But that post got overly long and is stale, so I chose to repost with more details. Here is my header file that defines my types: #include <string> #include <vector> #i...

QSvgRenderer segmentation fault

I realize specific questions like this aren't great, but I've spent several days trying to puzzle this out. Hopefully someone here can help. This python code using PyQt4 causes a segmentation fault: data = """<?xml version="1.0" ?> <svg height="1000" width="2000"> <text>blah</text> </svg>""" svg = QSv...

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

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 ...

Using sockets (nsIServerSocket) in XPCOM component (Firefox Extension) (sockets + new window = seg faults)

PLEASE READ THE UPDATE #2 BELOW IF YOU ARE INTERESTED IN THIS PROBLEM ;) Say I put this code into the JS of my extension. var reader = { onInputStreamReady : function(input) { var sin = Cc["@mozilla.org/scriptableinputstream;1"] .createInstance(Ci.nsIScriptableInputStream); sin.init(input); ...

Using python function callbacks with PyObjC?

I'm trying to use an Objective-C class made in Python to do this but Objective-C can't call the method which calls the python function. Here's the framework code which the Objective-C code: // // scalelib.h // Scalelib Cocoa Framework // // Created by Matthew Mitchell on 04/07/2010. // Copyright 2010 __MyCompanyName__. All rights r...

Help understanding segfault with std::map/boost::unordered_map

Hello, I have some code to handle resource (images, fonts, mesh data, etc.) management using a template'd static class, allowing client code to do something like: ResourceManager<Texture>::init("data/textures"); ResourceManager<Font>::init("data/fonts"); // later ... boost::shared_ptr<const Texture> tex = ResourceManager<Texture>::getR...

What is a segmentation fault?

In Linux: What is a segmentation fault? I know it crashes programs, but is that some sort of memory leak problem, or something completely unrelated? Also, how do you deal with these? Is this typically a problem with the computer set-up, or within the application itself? Also, does this happen in other OS's as well?\ Thanks! ...

Segmentation fault when using libavg on Ubuntu?

I have been in search of a tool to develop multi touch applications on linux. I happened to come across libavg a few days ago, but when I tried to run a sample program using libavg the program showed segmentation fault. I am using Ubuntu 10.04. When I looked it up on libavg's Wiki page they had given a few workarounds, but none of them w...

STL List copies a struct, but the copied values are offset by two memory addresses.

I'm compiling using Code::Blocks on Windows 7 using the MinGW compiler (which I can only assume is the latest version; both Code::Blocks and MinGW were installed this past week). My issue crops up under a particular circumstance, and my attempts to write a simpler script that demonstrates the problem have failed (which implies that there...

Lua C api : Too many lua_states lead to errors ?

Hi. We're working on multiple computers, executing a program coded in c/c++ and using lua api, and each one of them get crashed with different errors. It's usually either a segmentation fault, whose backtrace leads us to a call made bu liblua, or one that is usually given when trying to call a nil value as if it was a function. The wei...

Strange behavior with static template'd class.

Hello, I've been having some difficulties with diagnosing a segmentation fault resulting from, or at least I think resulting from a template'd static class (see original post here http://stackoverflow.com/questions/3200360/help-understanding-segfault-with-stdmap-boostunordered-map). Since posting that I found some other bizarre behavio...

C Doubly Linked List Segmentation Fault

I have written my own linked list implementation in C, and it works fine for storing values, but whenever I try to run through the list I get a segmentation fault. I'm not sure why the issue arises, and I spent a decent amount of time trying to run through the program myself but to no avail. Could you guys help me find the reason for the...

why doesnt this segfault

hello all I stumbled across something "interesting" and I cant put my finger why the behaviour isn't coherent. Check this code. char buf[100]; sprint(buf,"%s",bla); Simple, right. It's easy to understand what is going on when bla is a NULL pointer. This should always segfault right!? In one machine the executable segfaults, on ano...

Symfony doctrine data-load segmentation fault

Hi guys, I'm working through the Symfony Jobeet tutorial and am getting a segmentation fault when trying to load data from my fixtures files. PHP 5.2.6-1+lenny8 with Suhosin-Patch 0.9.6.2 (cli), S symfony version 1.4.5 I'm using the Doctrine plugin. My fixtures below: /data/fixtures/categories.yml JobeetCategory: design: name:...

Segmentation fault in libcurl, multithreaded

So I've got a bunch of worker threads doing simple curl class, each worker thread has his own curl easy handle. They are doing only HEAD lookups on random web sites. Also locking functions are present to enable multi threaded SSL as documented here. Everything is working except on 2 web pages ilsole24ore.com ( seen in example down ), and...

C++ Copy through assignment problem

Howdy, I seem to be having trouble with the following function: void OtherClass::copy_this( int index, MyClass &class_obj) { if(index < MAX_index) class_obj = array_of_MyClass[index]; } OtherClass maintains an array of MyClass objects, and I would like this function to copy a selected object out of the array into the prov...

using clone(): segmentation fault

Hi, I want to use clone to log the current status of my program. It has a lot of loops and I want to keep track of the process without printing the status in each loop iteration. That's why I created this proof-of-concept: #include <iostream> #include <cstdlib> unsigned int i; int log(void*) { std::cout << "LOGGING START" << std::...

electric-fence with pthread

I'm working on a multithreaded (pthread based) project. The project uses a library that I'm writing. In order to check it I linked it with -lefence and it gave me SIGSEGV. After a lot of time spent in figuring out what's wrong, I finally decided to search the error on the library, even if it's functionality is extremely simple. As test...

Segmentation Fault in rvm'd Ruby on Mac when running RSpec

I was developing something at the uni, saved to my Dropbox intending to continue at home. This is the message that greeted me: $ spec graph_spec.rb /Users/amadan/.rvm/gems/ruby-1.9.2-rc1/gems/PriorityQueue-0.1.2/ext/priority_queue/CPriorityQueue.bundle: [BUG] Segmentation fault ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10...