Results 1 to 3 of 3

Thread: segmentation fault loading an Image

  1. #1
    Join Date
    Apr 2010
    Posts
    13
    Qt products
    Qt3 Qt4 Qt/Embedded

    Default segmentation fault loading an Image

    Hello , I am trying to represent a periodic Image in MythTV 0.22 background using the MythUIImage class.
    I have the following Qt code :

    Qt Code:
    1. MythScreenStack *mainStack = GetMythMainWindow -> GetMainStack;
    2. const QString pila("/home/aido/foto.jpg");
    3. MythScreenType *aux = new MythScreenType(mainStack,pila,true);
    4. pthread_t foto_thread;
    5. mainStack->AddScreen(aux);
    6. int status = pthread_create(&foto_thread,NULL,run_foto_thread,aux)
    7.  
    8.  
    9.  
    10.  
    11. static void *run_foto_thread(void *data)
    12. {
    13.  
    14. pthread_t imagen_thread;
    15. QString numero;
    16.  
    17.  
    18. QString s1("/home/aido/foto.jpg");
    19. MythScreenType *mnstack =(MyhtScreenType *)data;
    20.  
    21. MythUIImage *image = new MythUIImage(menstack,s1);
    22.  
    23. image->SetFilename(s1);
    24. while(true)
    25. {
    26.  
    27. sleep(1.1);
    28. image->Load(true);
    29.  
    30. }
    To copy to clipboard, switch view to plain text mode 


    The image is represented but I obtained a segmentation fault .I have debugged the code and I obtain the problem is in image->Load(true).
    Does anybody know Why can that be ?
    Thanks
    Gorka



    }
    Last edited by high_flyer; 6th May 2011 at 10:27. Reason: code tags

  2. #2
    Join Date
    May 2011
    Posts
    239
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60
    Thanks
    4
    Thanked 35 Times in 35 Posts

    Default Re: segmentation fault loading an Image

    First of all, you should copy the code exactly as it is -- now it would not even compile (for example: mnstack <> menstack) and people can't tell your typos from the possible bugs.

    I don't know anything about MythTV APIs, but if the code works up and untl Load, I suspect this: apparently you try to load an image in the background every second. Perhaps the system doesn't handle it correctly. I'd try changing Load(true) to Load(false) first and seeing what happens. Still, I don't understand what the idea is to load the same image again and again.

  3. #3
    Join Date
    Apr 2010
    Posts
    13
    Qt products
    Qt3 Qt4 Qt/Embedded

    Default Re: segmentation fault loading an Image

    I load the same Image again and again because I want to develop a videoconference based on loading multiple times a file Image which is continously changing and that is the only way I have found.
    I have tried to change from true to false and have the same problem
    Any other idea ?
    Thanks
    Gorka

Similar Threads

  1. QWT - Segmentation Fault
    By Wojtek.wk in forum Newbie
    Replies: 0
    Last Post: 17th April 2010, 15:29
  2. segmentation fault
    By navid in forum Qt Programming
    Replies: 3
    Last Post: 20th December 2009, 12:40
  3. Segmentation fault
    By impeteperry in forum Qt Programming
    Replies: 5
    Last Post: 29th December 2008, 19:59
  4. segmentation fault
    By uchennaanyanwu in forum Newbie
    Replies: 3
    Last Post: 31st July 2008, 17:52
  5. Segmentation Fault
    By merry in forum General Programming
    Replies: 4
    Last Post: 12th March 2007, 05:08

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
  •  
Qt is a trademark of The Qt Company.