Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, May 2008
Invoking differrent process from within another process


Message 1 in thread

Hello,

 

Below is my setup.

 

OS: Linux 7.3

Gcc: 3.4.3

QT: 3.3.8

 

I am trying to invoke a QT application from another QT application using
QProcess. The parent process is getting hung when I call
QProcess:start(). Below the trace stack from gdb. Some articles from
internet say that there is deadlock happening in QT's main event loop.
Can you please help me to identify the cause and solution if any.

 

0x420daca4 in read () from /lib/i686/libc.so.6

(gdb) bt

#0  0x420daca4 in read () from /lib/i686/libc.so.6

#1  0x4093e990 in __JCR_LIST__ () from
/LinuxDisk/usr/home/rkamoji/GCC343_Project/qt-x11-commercial-3.3.8/lib/l
ibqt-mt.so.3

#2  0x40a0098b in CKAppLauncher::Invoke(QDir&, QString const&,
QStringList const&, bool) (dir=@0xbfffceb0,

    appName=@0xbfffce90, argv=@0xbfffcf70, trackOutput=true) at
Gui/KAppLauncher.cpp:90

#3  0x40a00834 in CKAppLauncher::Launch(QString const&, QStringList
const&, bool) (appName=@0xbfffcf20, argv=@0xbfffcf70,

    trackOutput=true) at Gui/KAppLauncher.cpp:71

#4  0x40ad6234 in CKAcmApplication::StartACM(QStringList)
(argv={<QValueList<QString>> = {sh = 0x81b1268}, <No data fields>})

    at Domain/KAcmApplication.cpp:236

#5  0x40ad5f8d in CKAcmApplication::GetInstance(QStringList) (argv=

        {<QValueList<QString>> = {sh = 0x81b1268}, <No data fields>}) at
Domain/KAcmApplication.cpp:107

#6  0x08071e14 in CKNetMasterEventController::Init() (this=0x81ae6f0) at
Domain/KNetMasterEventController.cpp:112

#7  0x409c1ccb in CKApplication::CreateMasterEventController()
(this=0xbfffd260) at GuiKnights/KApplication.cpp:177

#8  0x409bee2e in CKCmdAppStartup::Execute(int, void*) (this=0xbfffd1b0,
iMenuID=0, pData=0x0)

    at GuiKnights/KCmdAppStartup.cpp:98

#9  0x409c19b5 in CKApplication::KMain(int, char**) (this=0xbfffd260,
argc=2, argv=0x8169eb8)

    at GuiKnights/KApplication.cpp:93

#10 0x080d6dd3 in main (argc=2, argv=0xbfffd4d4) at Gui/main.cpp:152

#11 0x42017499 in __libc_start_main () from /lib/i686/libc.so.6

(gdb) where

#0  0x420daca4 in read () from /lib/i686/libc.so.6

#1  0x4093e990 in __JCR_LIST__ () from
/LinuxDisk/usr/home/rkamoji/GCC343_Project/qt-x11-commercial-3.3.8/lib/l
ibqt-mt.so.3

#2  0x40a0098b in CKAppLauncher::Invoke(QDir&, QString const&,
QStringList const&, bool) (dir=@0xbfffceb0,

    appName=@0xbfffce90, argv=@0xbfffcf70, trackOutput=true) at
Gui/KAppLauncher.cpp:90

#3  0x40a00834 in CKAppLauncher::Launch(QString const&, QStringList
const&, bool) (appName=@0xbfffcf20, argv=@0xbfffcf70,

    trackOutput=true) at Gui/KAppLauncher.cpp:71

#4  0x40ad6234 in CKAcmApplication::StartACM(QStringList)
(argv={<QValueList<QString>> = {sh = 0x81b1268}, <No data fields>})

    at Domain/KAcmApplication.cpp:236

#5  0x40ad5f8d in CKAcmApplication::GetInstance(QStringList) (argv=

        {<QValueList<QString>> = {sh = 0x81b1268}, <No data fields>}) at
Domain/KAcmApplication.cpp:107

#6  0x08071e14 in CKNetMasterEventController::Init() (this=0x81ae6f0) at
Domain/KNetMasterEventController.cpp:112

#7  0x409c1ccb in CKApplication::CreateMasterEventController()
(this=0xbfffd260) at GuiKnights/KApplication.cpp:177

#8  0x409bee2e in CKCmdAppStartup::Execute(int, void*) (this=0xbfffd1b0,
iMenuID=0, pData=0x0)

    at GuiKnights/KCmdAppStartup.cpp:98

#9  0x409c19b5 in CKApplication::KMain(int, char**) (this=0xbfffd260,
argc=2, argv=0x8169eb8)

    at GuiKnights/KApplication.cpp:93

#10 0x080d6dd3 in main (argc=2, argv=0xbfffd4d4) at Gui/main.cpp:152

#11 0x42017499 in __libc_start_main () from /lib/i686/libc.so.6

 

Thanks and Regards,

Rupa.

 


Message 2 in thread

Quoting Rupa Kamoji <rkamoji@xxxxxxxxxxxxxxxxxx>:


>
> I am trying to invoke a QT application from another QT application using
> QProcess. The parent process is getting hung when I call
> QProcess:start(). Below the trace stack from gdb. Some articles from
> internet say that there is deadlock happening in QT's main event loop.
> Can you please help me to identify the cause and solution if any.

Hi

Does the child write output to stdout? If so, you may get a hang when the pipe
buffer fills. The parent blocks waiting for the child to complete, and the child
blocks waiting for the pipe to clear. There are several possible solutions if
this is the case, e.g., don't print to stdout from the child, have the parent
read from the pipe.

A+
Paul

--
 [ signature omitted ] 

Message 3 in thread

Hi,

No, the child process is another Qt application with GUI. It is not
printing anything on stdout. 

Thanks and Regards,
Rupa.


-----Original Message-----
From: Paul Floyd [mailto:paulf@xxxxxxx] 
Sent: Wednesday, May 28, 2008 6:28 PM
To: Qt Interest List
Subject: Re: Invoking differrent process from within another process

Quoting Rupa Kamoji <rkamoji@xxxxxxxxxxxxxxxxxx>:


>
> I am trying to invoke a QT application from another QT application
using
> QProcess. The parent process is getting hung when I call
> QProcess:start(). Below the trace stack from gdb. Some articles from
> internet say that there is deadlock happening in QT's main event loop.
> Can you please help me to identify the cause and solution if any.

Hi

Does the child write output to stdout? If so, you may get a hang when
the pipe
buffer fills. The parent blocks waiting for the child to complete, and
the child
blocks waiting for the pipe to clear. There are several possible
solutions if
this is the case, e.g., don't print to stdout from the child, have the
parent
read from the pipe.

A+
Paul

--
 [ signature omitted ] 

Message 4 in thread

When I try to invoke the same application with system() function call,
the application gets invoked and the parent application also does not
hang. 

Thanks and Regards,
Rupa.


-----Original Message-----
From: Rupa Kamoji [mailto:rkamoji@xxxxxxxxxxxxxxxxxx] 
Sent: Wednesday, May 28, 2008 6:42 PM
To: Paul Floyd; Qt Interest List
Subject: RE: Invoking differrent process from within another process

Hi,

No, the child process is another Qt application with GUI. It is not
printing anything on stdout. 

Thanks and Regards,
Rupa.


-----Original Message-----
From: Paul Floyd [mailto:paulf@xxxxxxx] 
Sent: Wednesday, May 28, 2008 6:28 PM
To: Qt Interest List
Subject: Re: Invoking differrent process from within another process

Quoting Rupa Kamoji <rkamoji@xxxxxxxxxxxxxxxxxx>:


>
> I am trying to invoke a QT application from another QT application
using
> QProcess. The parent process is getting hung when I call
> QProcess:start(). Below the trace stack from gdb. Some articles from
> internet say that there is deadlock happening in QT's main event loop.
> Can you please help me to identify the cause and solution if any.

Hi

Does the child write output to stdout? If so, you may get a hang when
the pipe
buffer fills. The parent blocks waiting for the child to complete, and
the child
blocks waiting for the pipe to clear. There are several possible
solutions if
this is the case, e.g., don't print to stdout from the child, have the
parent
read from the pipe.

A+
Paul

--
 [ signature omitted ] 

Message 5 in thread

Did you checked for isRunning() before calling start()?

Regards,
Rehan

-----Original Message-----
From: Rupa Kamoji [mailto:rkamoji@xxxxxxxxxxxxxxxxxx] 
Sent: Thursday, May 29, 2008 11:16 AM
To: Qt Interest List
Subject: RE: Invoking differrent process from within another process

When I try to invoke the same application with system() function call,
the application gets invoked and the parent application also does not
hang. 

Thanks and Regards,
Rupa.


-----Original Message-----
From: Rupa Kamoji [mailto:rkamoji@xxxxxxxxxxxxxxxxxx] 
Sent: Wednesday, May 28, 2008 6:42 PM
To: Paul Floyd; Qt Interest List
Subject: RE: Invoking differrent process from within another process

Hi,

No, the child process is another Qt application with GUI. It is not
printing anything on stdout. 

Thanks and Regards,
Rupa.


-----Original Message-----
From: Paul Floyd [mailto:paulf@xxxxxxx] 
Sent: Wednesday, May 28, 2008 6:28 PM
To: Qt Interest List
Subject: Re: Invoking differrent process from within another process

Quoting Rupa Kamoji <rkamoji@xxxxxxxxxxxxxxxxxx>:


>
> I am trying to invoke a QT application from another QT application
using
> QProcess. The parent process is getting hung when I call
> QProcess:start(). Below the trace stack from gdb. Some articles from
> internet say that there is deadlock happening in QT's main event loop.
> Can you please help me to identify the cause and solution if any.

Hi

Does the child write output to stdout? If so, you may get a hang when
the pipe
buffer fills. The parent blocks waiting for the child to complete, and
the child
blocks waiting for the pipe to clear. There are several possible
solutions if
this is the case, e.g., don't print to stdout from the child, have the
parent
read from the pipe.

A+
Paul

--
 [ signature omitted ] 

Message 6 in thread

Yes. isRunning() returns 0. 

Thanks and Regards,
Rupa.


-----Original Message-----
From: Rehan [mailto:rehan@xxxxxxxxxxxxxxxxx] 
Sent: Thursday, May 29, 2008 11:41 AM
To: Rupa Kamoji; 'Qt Interest List'
Subject: RE: Invoking differrent process from within another process

Did you checked for isRunning() before calling start()?

Regards,
Rehan

-----Original Message-----
From: Rupa Kamoji [mailto:rkamoji@xxxxxxxxxxxxxxxxxx] 
Sent: Thursday, May 29, 2008 11:16 AM
To: Qt Interest List
Subject: RE: Invoking differrent process from within another process

When I try to invoke the same application with system() function call,
the application gets invoked and the parent application also does not
hang. 

Thanks and Regards,
Rupa.


-----Original Message-----
From: Rupa Kamoji [mailto:rkamoji@xxxxxxxxxxxxxxxxxx] 
Sent: Wednesday, May 28, 2008 6:42 PM
To: Paul Floyd; Qt Interest List
Subject: RE: Invoking differrent process from within another process

Hi,

No, the child process is another Qt application with GUI. It is not
printing anything on stdout. 

Thanks and Regards,
Rupa.


-----Original Message-----
From: Paul Floyd [mailto:paulf@xxxxxxx] 
Sent: Wednesday, May 28, 2008 6:28 PM
To: Qt Interest List
Subject: Re: Invoking differrent process from within another process

Quoting Rupa Kamoji <rkamoji@xxxxxxxxxxxxxxxxxx>:


>
> I am trying to invoke a QT application from another QT application
using
> QProcess. The parent process is getting hung when I call
> QProcess:start(). Below the trace stack from gdb. Some articles from
> internet say that there is deadlock happening in QT's main event loop.
> Can you please help me to identify the cause and solution if any.

Hi

Does the child write output to stdout? If so, you may get a hang when
the pipe
buffer fills. The parent blocks waiting for the child to complete, and
the child
blocks waiting for the pipe to clear. There are several possible
solutions if
this is the case, e.g., don't print to stdout from the child, have the
parent
read from the pipe.

A+
Paul

--
 [ signature omitted ]