[Qt-interest] Qt with x64 computer

P B chose29 at hotmail.com
Thu Jan 8 16:31:03 CET 2009


Hi Ian,
 
   ok, I have it down to this, hope this helps you understand my problem:
 
 
The following code does no error, does not crash:
 
void MainWindow2D::loadParameterFile(const char *filename)
{
   QString loadfile = QString(filename);
   
   if(loadfile.isEmpty())
   {
      loadfile = QFileDialog::getOpenFileName(0, "Open parameter file", QDir::currentPath(), tr("Parameter file (*.*)"));
   }

 
   if(!loadfile.isEmpty())
   {
 
   }
}
 
 
The following code crashes at the specified place ( <--- )
 
void MainWindow2D::loadParameterFile(const char *filename)
{
   QString loadfile = QString(filename);
   
   if(loadfile.isEmpty())
   {
      loadfile = QFileDialog::getOpenFileName(0, "Open parameter file", QDir::currentPath(), tr("Parameter file (*.*)"));
   }


 
   if(!loadfile.isEmpty())
   {
 
      std::string StdStrg = loadfile.toStdString();  // when debugging I pass through here
 
   } <--- The crash is here ?!?
}
 
when debugging (running each line at a time), the application crashes where specified, therefore at the exit of the function. 
When debugging, I do a "step into" (that's the F11) at the exit of the function, the application enters xstring file and goes into the following function where it crashes at _Tidy(true).
 
 
__CLR_OR_THIS_CALL ~basic_string()
{ // destroy the string
_Tidy(true);
}
 
"loadfile" is a QObject and I conclude the problem is there since the crash is with deleting a string, am I right? Am I manipulating "loadfile" in a wrong way? The code seems pretty basic to me but I'm obviously missing something,
 
Pascale
 
 
 
> Date: Thu, 8 Jan 2009 14:21:05 +0000> From: Ian.Thomson at iongeo.com> To: qt-interest at trolltech.com> Subject: Re: [Qt-interest] Qt with x64 computer> > Hi,> > Qt's classes sometimes use other Qt classes internally. If you did not > specifically use a QHash then this will be the reason why it crashes > there anyway.> > Your code is no use to me. In fact you said that the application crashes > in loadParameters and that loadParameters executes OK. I don't know what > the loadParameters function is or what type the variable 'reg' is. Also, > I don't know what pressing F11 does for you.> > What I suggest you do is create a minimal example that does the same > thing you're trying to do which causes your crash. Usually doing that is > enough to highlight the problem, or if not, it will be easy for other > people to discuss.> > Cheers,> Ian.> > > P B wrote:> > Hi Ian,> > > > I'm confused as to where the error stands in my code, I traced it up to > > this. The application crashes at loadParameters(...) in the following code> > > > ______________________________________________________> > loadParamFile(const char *filename)> > {> > QString loadfile = QString(filename);> > if(!loadfile.isEmpty())> > {> > QDir::setCurrent(QFileInfo(loadfile).absolutePath());> > reg->loadParameters(loadfile.toStdString().c_str());> > ______________________________________________________> > > > > > > > > > The function loadParameters executes OK, the file is read and my > > parameters take on the values in the file. then after when doing F11 it > > seems to go into:> > > > ______________________________________________________ > > __CLR_OR_THIS_CALL ~basic_string()> > { // destroy the string> > _Tidy(true);> > }> > ______________________________________________________> > > > > > and crash at _Tidy(true). It brings up a failure and stops at qhash.h in > > function :> > > > Q_OUTOFLINE_TEMPLATE typename QHash<Key, T>::Node **QHash<Key, > > T>::findNode(const Key &akey,> > uint *ahp) const> > > > > > at line:> > > > while (*node != e && !(*node)->same_key(h, akey))> > > > > > Since the file is read I conclude the string is ok, I wonder what could > > cause this. It is obviously due to my code, I wonder if it is related to > > Qt now or is it a string problem?!? Why would the crash end up in Qhash?> > > > Thanks again for helping, it's very appreciated,> > > > Regards,> > Pascale> > > > > > > > > Date: Thu, 8 Jan 2009 12:29:02 +0000> > > From: Ian.Thomson at iongeo.com> > > To: qt-interest at trolltech.com> > > Subject: Re: [Qt-interest] Qt with x64 computer> > >> > > Hi,> > >> > > This is probably caused by a problem in your code. Without seeing your> > > code or, even better, a small example which demonstrates your problem, I> > > doubt anyone will be able to help.> > >> > > Is it intentional that your hash type is a pointer to a pointer to a> > > QObject?> > >> > > Cheers,> > > Ian.> > >> > > P B wrote:> > > > Hi André,> > > >> > > > I am completely new to compiling and using Qt. So since there's no> > > > problem with x64, I'm obviously doing something wrong. Do you have an> > > > idea what an error in Qhash could indicate? The stack indicates this> > > > when stopping in debug mode: QtCored4.dll!QHash<QObject *,QObject *> > > > *>::findNode(QObject * const & akey=, unsigned int * ahp=0x0240a058).> > > >> > > >> > > > Thanks again for helping!> > > >> > > > Regards,> > > > Pascale> > > >> > > > > Date: Thu, 8 Jan 2009 13:04:18 +0100> > > > > From: apoenitz at trolltech.com> > > > > To: chose29 at hotmail.com> > > > > Subject: Re: [Qt-interest] Qt with x64 computer> > > > >> > > > > P B wrote:> > > > > > Hi,> > > > > >> > > > > > I am new to Qt, using an open source version. [...]> > > > > > Is there still a problem with Qt and x64? The debugger stops at :> > > > >> > > > > [Not sure what the "still" in the sentence means, anyway:]> > > > >> > > > > A fairly large portion of both Qt users and Qt developers use> > > > > Qt on 64bit machines on Windows and Unix, so there does not> > > > > seem to be a general "problem with Qt and x64".> > > > >> > > > > Regards,> > > > > Andre'> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > >> > > >> > > > > > ------------------------------------------------------------------------> > > >> > > > _______________________________________________> > > > Qt-interest mailing list> > > > Qt-interest at trolltech.com> > > > http://lists.trolltech.com/mailman/listinfo/qt-interest> > >> > > This email and any files transmitted with it are confidential and are > > intended solely for the use of the individual or entity to whom they are > > addressed. If you are not the original recipient or the person > > responsible for delivering the email to the intended recipient, be > > advised that you have received this email in error, and that any use, > > dissemination, forwarding, printing, or copying of this email is > > strictly prohibited. If you received this email in error, please > > immediately notify the sender and delete the original.> > >> > >> > >> > > _______________________________________________> > > Qt-interest mailing list> > > Qt-interest at trolltech.com> > > http://lists.trolltech.com/mailman/listinfo/qt-interest> > > > > > ------------------------------------------------------------------------> > Easily add maps and directions to your online party invites. Click to > > learn how. <http://www.microsoft.com/windows/windowslive/events.aspx>> > _______________________________________________> Qt-interest mailing list> Qt-interest at trolltech.com> http://lists.trolltech.com/mailman/listinfo/qt-interest
_________________________________________________________________
Show them the way! Add maps and directions to your party invites.
http://www.microsoft.com/windows/windowslive/events.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090108/654cd8fc/attachment.html 


More information about the Qt-interest-old mailing list