| Trolltech Home | Qt4-preview-feedback Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 1 | |
Hi,
I'm running Qt on two different machines; a desktop with one wired
ethernet, and a laptop with wired ethernet (which is unused) and a
wireless interface.
On both machines with 4.4.0-beta1, calling
QNetworkInterface::allInterfaces() or ::allAddresses() caused a fatal
error deep within the platform SDK code relating to memory management
when the most recent stack entry is popped.
Upon upgrading to snapshot 20080302, this crash went away on the
desktop, but remains in snapshot 20080303 on the laptop.
Both machines are running Windows Vista with all the latest patches at
time of writing. Both have Visual Studio 2005/2008 installed, the code
has been tested under both compilers and both cause the crash.
The following code is the simplest example that caused the crash.
#include <QtNetwork>
#include <QtCore>
int main(int argc, char* argv[])
{
QCoreApplication app(argc, argv);
QNetworkInterface::allInterfaces();
} /* fatal error occurrs here */
In my original code, I was calling allInterfaces() in a function, and
the crash manifested much later when the function returned (after the
destructors for temporary objects inside the function had been
called).
Using the vs debugger, the error given is
HEAP[app.exe]: Invalid Address specified to RtlValidateHeap( 012D0000,
0226A050 )
at free.c:109 (C:\Program Files\Microsoft Visual Studio 9.0\VC\crt\src\)
retval = HeapFree(_crtheap, 0, pBlock);
Ben Roberts.
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx
On Tuesday 04 March 2008 11:12:03 optimism_ wrote:
> int main(int argc, char* argv[])
> {
> QCoreApplication app(argc, argv);
> QNetworkInterface::allInterfaces();
> } /* fatal error occurrs here */
>
> In my original code, I was calling allInterfaces() in a function, and
> the crash manifested much later when the function returned (after the
> destructors for temporary objects inside the function had been
> called).
I think I know what this is.
For a while, we added a few lines to qshareddata.h that made
QSharedDataPointer be "movable". The only effect of making it movable is to
make QList allocate it differently. And that's exactly what
QNetworkInterfacePrivate::allInterfaces() does: it returns a
QList<QSharedDataPointer<QNetworkInterfacePrivate> >.
Even though it's private code, the problem is leaking to the front-end. Please
simply rebuild your Qt. The problem should go away. We can't reproduce this
at the office.
PS: this crash will happen if you run code built with Qt 4.3 against Qt 4.4.0
beta 1.
--
[ signature omitted ]
Attachment:
signature.asc
Description: This is a digitally signed message part.
Rebuild which version of Qt?
I have tried building the 20080303 daily snapshot on my laptop, and
allInterfaces() is still causing the same crash. Is there a different
snapshot I should be using?
With respect to your ps, I am running the my code against the qt
binaries for the same snapshot it was compiled against.
On 04/03/2008, Thiago Macieira <thiago.macieira@xxxxxxxxxxxxx> wrote:
> On Tuesday 04 March 2008 11:12:03 optimism_ wrote:
> > int main(int argc, char* argv[])
> > {
> > QCoreApplication app(argc, argv);
> > QNetworkInterface::allInterfaces();
> > } /* fatal error occurrs here */
> >
> > In my original code, I was calling allInterfaces() in a function, and
> > the crash manifested much later when the function returned (after the
> > destructors for temporary objects inside the function had been
> > called).
>
>
> I think I know what this is.
>
> For a while, we added a few lines to qshareddata.h that made
> QSharedDataPointer be "movable". The only effect of making it movable is to
> make QList allocate it differently. And that's exactly what
> QNetworkInterfacePrivate::allInterfaces() does: it returns a
> QList<QSharedDataPointer<QNetworkInterfacePrivate> >.
>
> Even though it's private code, the problem is leaking to the front-end. Please
> simply rebuild your Qt. The problem should go away. We can't reproduce this
> at the office.
>
> PS: this crash will happen if you run code built with Qt 4.3 against Qt 4.4.0
> beta 1.
>
>
> --
> Thiago José Macieira - thiago.macieira AT trolltech.com
> Trolltech ASA - Sandakerveien 116, NO-0402 Oslo, Norway
>
>
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx