skumar434
4th March 2009, 17:18
Hi All,
I have designed a page which will take the script name and run it . I am currently using Qprocess to run the script and printing the out put on the textEdit.
The code works fine when I give a small script , but the GUI hungs and I saw SEGV when I tried to run a simple script which only do "ls" in a loop for 300 times .
I belive all the error is at the time of reading / printing of the data on the text Edit.
I have very less knowledge on both debugging and QT , I tried alot to find the issue but when run with GDB I found this
gdb) where
#0 0x00aa27a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x03e00a41 in ___newselect_nocancel () from /lib/tls/libc.so.6
#2 0x0060b1cd in QProcessManager::run (this=0x9fdbb88) at io/qprocess_unix.cpp:301
#3 0x0053b768 in QThreadPrivate::start (arg=0x9fdbb88) at thread/qthread_unix.cpp:185
#4 0x00464371 in start_thread () from /lib/tls/libpthread.so.0
#5 0x03e07ffe in clone () from /lib/tls/libc.so.6
(gdb) f 0
#0 0x00aa27a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) f 1
#1 0x03e00a41 in ___newselect_nocancel () from /lib/tls/libc.so.6
(gdb) f 2
#2 0x0060b1cd in QProcessManager::run (this=0x9fdbb88) at io/qprocess_unix.cpp:301
301 int nselect = select(qt_qprocess_deadChild_pipe[0] + 1, &readset, 0, 0, 0);
Current language: auto; currently c++
As my above approch is blocking the GUI , Now I am need a way to read the out put of the process through a thread ... Can any body tell me how to create a thread which will take the script name as a argument and run it .
I have designed a page which will take the script name and run it . I am currently using Qprocess to run the script and printing the out put on the textEdit.
The code works fine when I give a small script , but the GUI hungs and I saw SEGV when I tried to run a simple script which only do "ls" in a loop for 300 times .
I belive all the error is at the time of reading / printing of the data on the text Edit.
I have very less knowledge on both debugging and QT , I tried alot to find the issue but when run with GDB I found this
gdb) where
#0 0x00aa27a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x03e00a41 in ___newselect_nocancel () from /lib/tls/libc.so.6
#2 0x0060b1cd in QProcessManager::run (this=0x9fdbb88) at io/qprocess_unix.cpp:301
#3 0x0053b768 in QThreadPrivate::start (arg=0x9fdbb88) at thread/qthread_unix.cpp:185
#4 0x00464371 in start_thread () from /lib/tls/libpthread.so.0
#5 0x03e07ffe in clone () from /lib/tls/libc.so.6
(gdb) f 0
#0 0x00aa27a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
(gdb) f 1
#1 0x03e00a41 in ___newselect_nocancel () from /lib/tls/libc.so.6
(gdb) f 2
#2 0x0060b1cd in QProcessManager::run (this=0x9fdbb88) at io/qprocess_unix.cpp:301
301 int nselect = select(qt_qprocess_deadChild_pipe[0] + 1, &readset, 0, 0, 0);
Current language: auto; currently c++
As my above approch is blocking the GUI , Now I am need a way to read the out put of the process through a thread ... Can any body tell me how to create a thread which will take the script name as a argument and run it .