Results 1 to 6 of 6

Thread: Standalone executable crashing while executing using QProcess but works manually

  1. #1
    Join Date
    Feb 2016
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Exclamation Standalone executable crashing while executing using QProcess but works manually

    I have a console application executable which takes a file as input and prints another file as output.
    This executable is used in my GUI application using QProcess::execute("MyApp.exe") command.

    It has been working fine long since but for certain cases the executable crashes. I initially thought that my input might be wrong and tried to debug. But I found that the same executable is working fine when I execute it manually or use the system command.
    system("MyApp.exe")

    But it repeatedly crashes while executing it with QProcess::execute.

    Could it be any memory leak problem while using QProcess or any limitations of QProcess.

    Kindly help to resolve this issue.

    Thanks in advance for your solutions

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Standalone executable crashing while executing using QProcess but works manually

    Since you are using execute(), which means you are giving up control on the child process, maybe you are doing things like deleting either file while the program is still running?
    Or you are calling it again while it is still running?

    Cheers,
    _

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,715
    Thanks
    259
    Thanked 759 Times in 749 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Standalone executable crashing while executing using QProcess but works manually

    Or are there shared library / DLL dependencies that are successfully resolved when running from the command line or when the exe is invoked using the system() command, but which are not found when using a QProcess? In other words, is the environment the same in each scenario?

  4. #4
    Join Date
    Feb 2016
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Standalone executable crashing while executing using QProcess but works manually

    Quote Originally Posted by d_stranz View Post
    Or are there shared library / DLL dependencies that are successfully resolved when running from the command line or when the exe is invoked using the system() command, but which are not found when using a QProcess? In other words, is the environment the same in each scenario?
    Thank you for your Reply.

    We have checked the dependencies for external executable which we are running through QProcess and we did not find any problem there.

    with regards,
    Dinesh


    Added after 4 minutes:


    Thank you for reply Anda.

    We will check this out.

    Does the execute function wait until the console application completes its process?

    with regards,
    Dinesh
    Last edited by dynesh87; 4th February 2016 at 07:23.

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Standalone executable crashing while executing using QProcess but works manually

    Quote Originally Posted by dynesh87 View Post
    Does the execute function wait until the console application completes its process?
    Hmm, true, it does.

    Do you get any backtrace for the child process?
    E.g. a dumped core on Linux?
    Or in other words, how did you determine that it crashed?

    Cheers,
    _

  6. #6
    Join Date
    Feb 2016
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: Standalone executable crashing while executing using QProcess but works manually

    Quote Originally Posted by anda_skoa View Post
    Hmm, true, it does.

    Do you get any backtrace for the child process?
    E.g. a dumped core on Linux?
    Or in other words, how did you determine that it crashed?

    Cheers,
    _
    Thanks for your reply Anda.

    The executable was working fine in linux. It was crashing in windows(The windows showing message that the application stopped working). And in the process I found the problem. The executable was compiled in windows server and the GUI was installed in windows 7 OS. When the same GUI-executable combo was run in the server it was not crashing but in windows 7 it was crashing. And I made the executable as compatible to windows XP style in the properties in windows 7. It solved the problem. Now all my cases are working fine.

    Thank you all for your valuable time and suggestions.

    with regards,
    Dinesh

Similar Threads

  1. Replies: 10
    Last Post: 7th May 2015, 11:38
  2. Replies: 4
    Last Post: 26th May 2014, 15:48
  3. Replies: 4
    Last Post: 22nd April 2014, 16:34
  4. Replies: 2
    Last Post: 22nd July 2009, 15:14
  5. How to create a standalone executable?
    By Ashish in forum Qt Programming
    Replies: 1
    Last Post: 25th January 2007, 16:04

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.