Results 1 to 4 of 4

Thread: segmentation fault

  1. #1
    Join Date
    Sep 2006
    Posts
    102
    Thanks
    5
    Qt products
    Qt3
    Platforms
    Unix/X11

    Exclamation segmentation fault

    hiiii friends

    i am getting segmentation fault everytime i try to create a thread. the thread gets executed but then immediately segmentation fault occurs.
    i am not quite sure that my Qt 3.3.0 is configure with multi threading support or not.
    but i think it supports multithreading because the library files in qt are libqt-mt.so(link), libqt-mt.so.3(link) , libqt-mt.so.3 .3(link) , libqt-mt.so.3.3.0 .

    but i am not using the threads of Qt. Actually the project file is made and compiled in Qt using qmake.
    but then i have included the dialogs in kdevelop. and then i use the kdevelop's thread i.e. i include the header file pthread.h
    and then create the thread using pthread_create() function which is of kdevelop and not Qt.

    then also the segmentation fault occurs.

    do you think it is necessary to enable multi threading in Qt to use multithreading in kdevelop??


    thanks and regards

    shamik
    Last edited by shamik; 23rd November 2006 at 10:43.

  2. #2
    Join Date
    Nov 2006
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: segmentation fault

    are u sure its because of the multithreading when done in your program...
    sudeepdua

  3. #3
    Join Date
    Sep 2006
    Posts
    102
    Thanks
    5
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: segmentation fault

    now i am quite sure that my Qt is multithreaded

    previously before including threading in my program it was working fine. but to provide more functionality i have to include threads.
    and when i started including threads, everytime the program executed, it terminated unusually causing segmentation fault.

    i think its because the function in which i m creating the thread is getting finished so the thread also has to get terminated.
    but i dont know the exact reason.

    please tell me how to do multi threading. as i told i am using pthread. is this pthread.h class is contained in our traditional c++ ??

    regards
    shamik

  4. #4
    Join Date
    Apr 2006
    Posts
    122
    Thanks
    18
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: segmentation fault

    No, pthread library is not part of C++. and you can well use pthread library with Qt.
    [QOUTE]
    i think its because the function in which i m creating the thread is getting finished so the thread also has to get terminated.
    but i dont know the exact reason.
    [/QOUTE]
    Simple deletion of object will also produce warning thread object deleted while in use . You may be refrencing to a object either not created or deleted during execution.

Similar Threads

  1. segmentation fault insert QString in QCombobox
    By regix in forum Qt Programming
    Replies: 16
    Last Post: 8th August 2006, 08:46
  2. why does qt program meet segmentation fault?
    By wquanw in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 15th May 2006, 16:52
  3. (Another) segmentation fault
    By Lebowski in forum Qt Programming
    Replies: 27
    Last Post: 6th April 2006, 06:33
  4. Replies: 2
    Last Post: 25th March 2006, 06:54
  5. Icons missing => segmentation fault
    By antonio.r.tome in forum Qt Programming
    Replies: 4
    Last Post: 8th March 2006, 16:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.