#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...
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...
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...
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 ...
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);
...
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...
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...
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!
...
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...
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...
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...
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...
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...
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...
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:...
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...
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...
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::...
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...
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...