Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6342551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:15:45+00:00 2026-05-24T20:15:45+00:00

I start coding a small qt application to compute checksums. After the unthreaded code

  • 0

I start coding a small qt application to compute checksums. After the unthreaded code run fine I moved to a more responsive way since the mainwindow blocks while computing a hash of a bigger file.

But calling the run() method failes for unknown reason. I even cleared out the run-method completely. No matter what I do: SIGSEV.

Other threaded code from the qt help compile and run without problems – even threaded code in other apps I coded still run, but this not:

the header:

#include <QThread>
class Hasher : public QThread
{
    Q_OBJECT

public:
    Hasher();
    void computeHash();

protected:
    void run();

};

the implementation

#include "hasher.h"

Hasher::Hasher()
{
}

void Hasher::computeHash() {
    start();
}

void Hasher::run() {
    // compute the hash, but for now simply return
}

caller

Hasher h
h.computeHash();

As I said above all works well without threads but crashes when using threads.
I am using QT 4.7.3 on a 64bit ARCH-Linux – and I am really clueless about this.
Maybe someone can help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:15:45+00:00Added an answer on May 24, 2026 at 8:15 pm

    If you do like this your thread will be created on stack and it will be destroyed while the thread is still running !

    void myfunction ()
    {
     Hasher h
     h.computeHash();
    
    }
    

    NeilMonday’s example works because he has a return a.exec(); in his code which keeps Hasher thread alive on the stack. So you have to make your thread live longer.

    1. Either make it a member variable of you class or
    2. Create it on the heap like Hasher* h = new Hasher (); or
    3. Use QtConcurrentRun and QFuture and do not mess with threads.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

assume that i start coding an application from scratch, is the best way to
Start a new Silverlight application... and in the code behind (in the Loaded event),
I have decided to start doing small coding projects on my own that focus
I'm going to start coding some automated tests of our presentation soon. It seems
Ok so I start coding websites (yes I know I am almost 15 years
I'd like to start coding for NVIDIA 3D Vision and wonder where can I
I want to start coding in Python or Ruby. Since I own a Lego
I am coding in php, attempting to get the start\end dates and times for
i just loved the fullcalendar and wanted to implement it in a small application,
I would like to develop a small notifications application for Windows in .NET that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.