[Qt-interest] Static destructors errors

Brad Howes howes at ll.mit.edu
Fri Oct 16 17:51:55 CEST 2009


On Oct 16, 2009, at 11:04 AM, marc at mferland.net wrote:

> If I place breakpoints inside the timerIdsDestructorFunction and add a
> watch point for the iterator 'i', I get the following:
>
> (gdb) watch i
> Watchpoint 9: i
> (gdb) n
> Watchpoint 9: i
>
> Old value = 1
> New value = 399941192
> 0x0000003b17a79977 in *__GI___libc_free (mem=0xcc2fd0) at malloc.c: 
> 3675
> Current language:  auto; currently minimal
> (gdb)


Are you multithreaded? I had a similar (non-Qt) problem due to an  
initialization race condition in my code. These types of bugs are easy  
to create when you mix statics, DLLs and threads, and the order of  
initialization is not deterministic, which may be the case if multiple  
threads are running before DLLs get loaded.

Brad

-- 
Brad Howes
Group 42
MIT Lincoln Laboratory • 244 Wood St. • Lexington, MA 02173
Phone: 781.981.5292 • Fax: 781.981.3495 • Secretary: 781.981.7420








More information about the Qt-interest-old mailing list