Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFtp strange behaviour.

QFtp strange behaviour.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    serpulga
    wrote on last edited by
    #1

    Hi, I'm writing to see if anyone can explain a very weird behaviour of QFtp.

    A while ago I wrote a Qt application that uses QFtp (wrote and tested using Windows 7). Now I get feedback from
    some people that the application is crashing on start-up on their Windows XP machines.
    I set up a Windows XP environment and found out that it crashed for me too.

    In the code, I have a class that inherits from QFtp, and I found out that the crashing happens right
    when I access any methods from my newly created object:

    @
    ftp = new FtpConnection(appSettings, this);

    connect(ftp,SIGNAL(newTransferProgress(int,int)),this,SLOT(uploadProgressUpdate(int,int)));
    

    @

    The initial crashing happened on the connect line, so I changed the code:

    @
    ftp = new FtpConnection(appSettings, this);

    ftp->state();
    connect(ftp,SIGNAL(newTransferProgress(int,int)),this,SLOT(uploadProgressUpdate(int,int)));
    

    @

    And it crashed on the state() calling line, as if it 'ftp' were pointing to invalid memory.

    I started printing with QDebug the actual address held by 'ftp', long story short, the QDebug statement
    somehow made 'ftp' a valid pointer:

    On DEBUG mode, the application doesn't crash if I have it like this:

    @
    qDebug() << ftp;
    ftp = new FtpConnection(appSettings, this);
    qDebug() << ftp;

    connect(ftp,SIGNAL(newTransferProgress(int,int)),this,SLOT(uploadProgressUpdate(int,int)));
    

    @

    The previous code didn't work for RELEASE, so I had to change it again:

    @
    ftp = new FtpConnection(appSettings, this);
    qDebug() << ftp;

    connect(ftp,SIGNAL(newTransferProgress(int,int)),this,SLOT(uploadProgressUpdate(int,int)));
    

    @

    The application is running now without crashing, but I'm very surprised by the way it
    got unintentionally fixed...

    Am I overlooking something here?
    Could someone give an explanation of what's going on?

    Thank you,

    Sergio

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      Something inside the FtpConnection class is not being initialised and causes the crash when used. Without seeing that code we cannot possibly diagnose this. Running it in your debugger on the crashing machine will fairly quickly tell you exactly where it is breaking.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        serpulga
        wrote on last edited by
        #3

        Hi, that's for your answer. I'm pretty sure it crashed
        on Qt code.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved