Results 1 to 6 of 6

Thread: dangerous QThread

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Posts
    57
    Qt products
    Qt4
    Platforms
    Windows
    Thanked 1 Time in 1 Post

    Default Re: dangerous QThread

    If it is only ATTEMPT to corrupt memory, the main thread shouldn't be corrupted after the termination of the secondary thread afaik. The sec.thread has its own code and stack segments, OS clear them and then pass the control to the main thread, perhaps notifying it "oops I've just killed your child".
    Anyway I've just discovered SEH exceptions, I suppose it will help.

    What do you think, which errors may rise while reading corrupted binary file of complex structure (ints, floats, strings, bitmaps etc)?

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: dangerous QThread

    Quote Originally Posted by Radagast View Post
    What do you think, which errors may rise while reading corrupted binary file of complex structure (ints, floats, strings, bitmaps etc)?
    mostly buffer overruns, but depends what/how you read... you could implement a completely safe file loader... all applications have mechanisms to detect corrupted files.
    I just think you're trying to reinvent the wheel there.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: dangerous QThread

    Quote Originally Posted by Radagast View Post
    If it is only ATTEMPT to corrupt memory, the main thread shouldn't be corrupted after the termination of the secondary thread afaik.
    If there is at least one case when this is not true, then this whole statement is not true. And there is at least one case when this is not true, for instance when writing to an area of memory that is protected from write access - you might write some data and then reach the protected page/segment/area - the application did something that it shouldn't have and thus should be terminated.

Similar Threads

  1. QThread and QTcpSocket
    By ^NyAw^ in forum Qt Programming
    Replies: 3
    Last Post: 12th May 2008, 14:06
  2. QThread and QSqlDatabase
    By pdoria in forum Qt Programming
    Replies: 1
    Last Post: 6th March 2008, 04:25
  3. Spawn a QThread in another QThread
    By david.corinex in forum Qt Programming
    Replies: 2
    Last Post: 19th December 2007, 13:54
  4. QThread exec proplem to stop...
    By patrik08 in forum Qt Programming
    Replies: 29
    Last Post: 21st May 2007, 08:51
  5. Is it possible to create a QThread without inheriting ?
    By probine in forum Qt Programming
    Replies: 6
    Last Post: 23rd March 2006, 23:51

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.