mario sangalli
05/19/2010 5:49 AM
post55098
|
Hi, I'm working on a MPC5200 system, using QNX6.4.1 and IDE 4.6.1.
When I debug a C++ program, if it is killed using the IDE debugger's
terminate (CTRL-F2), then the remote target will disappears from
the IDE: I've to kill qconn and restart it again using the local target consolle.
I've noted that the kill of program do not call all the class destructors
and on the consolle I've receive the following message:
-------------------------------------------------------------------------------------------
Program received signal SIGKILL, Killed.
0xfe33f544 in TimerTimeout () from D:/QNX641/target/qnx6/ppcbe/lib/libc.so.3
-------------------------------------------------------------------------------------------
If I gracefully terminate the program from inside it (calling exit), all works fine,
(all class desctructors are called)
It's seems a troble related to qconn , because one restarted, the IDE works fine...
Any idea?
M. Sangalli
|
|
|
Elena Laskavaia
05/19/2010 9:17 AM
post55125
|
If program is killed with SIGKILL it does not do anything before
termination, including calling destructors.
Why do you care about destructors in this case? To process termination
better it should be stopped with SIGTERM.
I don't know what is Ctrl-F2, If you open Debug view and press stop
button does it work better?
For your scenario can you have console to target and after you kill your
process do pidin and post results for qconn
and your process if it is still running here.
mario sangalli wrote:
> Hi, I'm working on a MPC5200 system, using QNX6.4.1 and IDE 4.6.1.
> When I debug a C++ program, if it is killed using the IDE debugger's
> terminate (CTRL-F2), then the remote target will disappears from
> the IDE: I've to kill qconn and restart it again using the local target consolle.
> I've noted that the kill of program do not call all the class destructors
> and on the consolle I've receive the following message:
> -------------------------------------------------------------------------------------------
> Program received signal SIGKILL, Killed.
> 0xfe33f544 in TimerTimeout () from D:/QNX641/target/qnx6/ppcbe/lib/libc.so.3
> -------------------------------------------------------------------------------------------
> If I gracefully terminate the program from inside it (calling exit), all works fine,
> (all class desctructors are called)
> It's seems a troble related to qconn , because one restarted, the IDE works fine...
> Any idea?
>
> M. Sangalli
>
>
>
>
>
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post55098
>
>
|
|
|
mario sangalli
05/19/2010 9:55 AM
post55141
|
>If program is killed with SIGKILL it does not do anything before
>termination, including calling destructors.
Yes, I known, I'm just surprise that will blocks the qconn also....
>Why do you care about destructors in this case? To process termination
>better it should be stopped with SIGTERM.
How can I do that ? in the IDE I' ve just the "terminate" option
that uses a SIGKILL...
>I don't know what is Ctrl-F2, If you open Debug view and press stop
>button does it work better?
It's the IDE (Windows versoion) short-cut for the "terminate" option...
see attached jpg.
>For your scenario can you have console to target and after you kill your
>process do pidin and post results for qconn
>and your process if it is still running here.
The process is not more running: it was terminated ok:
I've attached a text file... another thing, after the target is gone away
in the IDE, if I will stop qconn and restart it, all works fine again:
I've tryed to debug two processes and I'm able to recoivere the debug
session after I' ve restart qconn...
|
|
|
mario sangalli
05/19/2010 9:59 AM
post55143
|
Sorry, this is the text ...
|
|
|
Elena Laskavaia
05/19/2010 10:46 AM
post55155
|
I think you process does not die correctly - stop killed gdb but not
your process, can you select your process in Debug view and press stop
button (the
one that is "still running" in screenshot.
mario sangalli wrote:
> Sorry, this is the text ...
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post55143
>
|
|
|
mario sangalli
05/19/2010 11:03 AM
post55158
|
>I think you process does not die correctly - stop killed gdb but not
>your process, can you select your process in Debug view and press stop
>button (the one that is "still running" in screenshot.
Elena, I do not think so: The process is really terminated, I've checked on
consolle that it is not running... ( see the pidin file I've posted a message back) .
I think process seems to be running simply because the IDE has lost the
connection with target and is not able to show the correct info.
I'm supposing the qconn is lost somewhere ....
Mario
|
|
|
mario sangalli
05/20/2010 4:29 AM
post55214
|
Hi, I've recompiled a minimal C++ test for both x86 and ppc targets (6.4.1) with
same results.
qconn will hung up if in the IDE a process is terminated using the "terminate" button. I've tested also the IDE4.7 with
same result.
I've attached a minimal test that cause the trouble on my systems:
i've removed pratically everything from it and it still hung up the qconn...
---------------------------------------------------------------------------------------------------
Good termination (press 'Q' key to exit from program):
<terminated>test_cc convertedConfig (1) [C/C++ QNX QConn (IP)]
<terminated>QNX GDB Debugger (20/05/10 10.10) (Exited. Exit code = 0.)
<terminated, exit value: 0>/tmp/testcc_gMSangalli127434300837319 on 11.0.0.156 pid 352273 (20/05/10 10.10)
<terminated, exit value: 0>D:\QNX641\host\win32\x86\usr\bin\ntox86-gdb.exe (20/05/10 10.10)
qconn is still working ok....
---------------------------------------------------------------------------------------------------
Bad termination: program killed by IDE
test_cc convertedConfig (1) [C/C++ QNX QConn (IP)]
<terminated>QNX GDB Debugger (20/05/10 10.11) (Exited. Exit code = 0.)
/tmp/testcc_gMSangalli127434306157620 on 11.0.0.156 pid 372751 (20/05/10 10.11)
<terminated, exit value: -1>D:\QNX641\host\win32\x86\usr\bin\ntox86-gdb.exe (20/05/10 10.11)
I've have to kill qconn and restart it to meke it working again...
---------------------------------------------------------------------------------------------------
mario
|
|
|
Elena Laskavaia
05/20/2010 9:52 AM
post55249
|
Btw you can try to send SIGTERM instead using Send Signal menu from
System Information.
I tried you example - it works ok (just press debug on x86, it hits
main, I press continue, then I stop it)
Something is weird with configuration of target... Btw does hello world
terminates ok? Or it is specific to this example?
mario sangalli wrote:
> Hi, I've recompiled a minimal C++ test for both x86 and ppc targets (6.4.1) with
> same results.
> qconn will hung up if in the IDE a process is terminated using the "terminate" button. I've tested also the IDE4.7
with same result.
> I've attached a minimal test that cause the trouble on my systems:
> i've removed pratically everything from it and it still hung up the qconn...
>
> ---------------------------------------------------------------------------------------------------
> Good termination (press 'Q' key to exit from program):
>
> <terminated>test_cc convertedConfig (1) [C/C++ QNX QConn (IP)]
> <terminated>QNX GDB Debugger (20/05/10 10.10) (Exited. Exit code = 0.)
> <terminated, exit value: 0>/tmp/testcc_gMSangalli127434300837319 on 11.0.0.156 pid 352273 (20/05/10 10.10)
> <terminated, exit value: 0>D:\QNX641\host\win32\x86\usr\bin\ntox86-gdb.exe (20/05/10 10.10)
>
> qconn is still working ok....
>
> ---------------------------------------------------------------------------------------------------
> Bad termination: program killed by IDE
> test_cc convertedConfig (1) [C/C++ QNX QConn (IP)]
> <terminated>QNX GDB Debugger (20/05/10 10.11) (Exited. Exit code = 0.)
> /tmp/testcc_gMSangalli127434306157620 on 11.0.0.156 pid 372751 (20/05/10 10.11)
> <terminated, exit value: -1>D:\QNX641\host\win32\x86\usr\bin\ntox86-gdb.exe (20/05/10 10.11)
>
> I've have to kill qconn and restart it to meke it working again...
> ---------------------------------------------------------------------------------------------------
>
>
> mario
>
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post55214
|
|
|
mario sangalli
05/20/2010 11:04 AM
post55272
|
>Btw you can try to send SIGTERM instead using Send Signal menu from
>System Information.
Yes, in such case, program is terminated and I can remove it from IDE:
I've no trouble, and qconn seems to works fine, but is a bit tricky...
>I tried you example - it works ok (just press debug on x86, it hits
>main, I press continue, then I stop it)
I've noted that whwn qconn stops to works, I've the following error:
<terminated, exit value: -1>D:\QNX641\host\win32\x86\usr\bin\ntox86-gdb.exe (20/05/10 16.50)
>Something is weird with configuration of target... Btw does hello world
>terminates ok? Or it is specific to this example?
Just an "Hello world" with one trivial class works fine, no trouble here..
I'm not able to figure out what's wrong, because I've the same
behaviour both on ppc and x86 system....
With plain C programs I've never have such trouble...
maybe the qconn I have is out-of-date ?
Thanks,
Mario
|
|
|
Christian Damus(deleted)
05/20/2010 11:13 AM
post55276
|
Hi, Mario,
This happens only with C++ programs? Can you provide details of how they are linked? A common problem is accidentally
linking against more than one of the C++ run-time libraries, which causes all sorts of strange issues.
Cheers,
Christian
On 20/05/10 11:04 AM, mario sangalli wrote:
Btw you can try to send SIGTERM instead using Send Signal menu from
System Information.
Yes, in such case, program is terminated and I can remove it from IDE:
I've no trouble, and qconn seems to works fine, but is a bit tricky...
I tried you example - it works ok (just press debug on x86, it hits
main, I press continue, then I stop it)
I've noted that whwn qconn stops to works, I've the following error:
<terminated, exit value: -1>D:\QNX641\host\win32\x86\usr\bin\ntox86-gdb.exe (20/05/10 16.50)
Something is weird with configuration of target... Btw does hello world
terminates ok? Or it is specific to this example?
Just an "Hello world" with one trivial class works fine, no trouble here..
I'm not able to figure out what's wrong, because I've the same
behaviour both on ppc and x86 system....
With plain C programs I've never have such trouble...
maybe the qconn I have is out-of-date ?
Thanks,
Mario
_______________________________________________
General
http://community.qnx.com/sf/go/post55272
--
Christian W. Damus
Software Developer, IDE Team
QNX Software Systems <http://www.qnx.com/>
|
|
|
mario sangalli
05/21/2010 3:20 AM
post55336
|
>This happens only with C++ programs? Can you provide details of how they are >linked? A common problem is
accidentally
>linking against more than one of the C++ run-time libraries, which causes all sorts of >strange issues.
Thanks, I've checked the linker but nothing of strange here.
Trouble seems to be in the fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK)
statement, and only using qconn/6.4.1 system
Mario
|
|
|
Elena Laskavaia
05/20/2010 11:39 AM
post55286
|
I think it is because you directly work with terminal. i.e. making fcntl
calls on stdin. Because destructor is not running it leaves it some
weird state,
and qconn cannot recover (leaved block on pty).
mario sangalli wrote:
>> Btw you can try to send SIGTERM instead using Send Signal menu from
>> System Information.
>>
> Yes, in such case, program is terminated and I can remove it from IDE:
> I've no trouble, and qconn seems to works fine, but is a bit tricky...
>
>
>> I tried you example - it works ok (just press debug on x86, it hits
>> main, I press continue, then I stop it)
>>
>
> I've noted that whwn qconn stops to works, I've the following error:
> <terminated, exit value: -1>D:\QNX641\host\win32\x86\usr\bin\ntox86-gdb.exe (20/05/10 16.50)
>
>
>> Something is weird with configuration of target... Btw does hello world
>> terminates ok? Or it is specific to this example?
>>
> Just an "Hello world" with one trivial class works fine, no trouble here..
> I'm not able to figure out what's wrong, because I've the same
> behaviour both on ppc and x86 system....
> With plain C programs I've never have such trouble...
> maybe the qconn I have is out-of-date ?
>
> Thanks,
> Mario
>
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post55272
>
>
|
|
|
Elena Laskavaia
05/20/2010 12:59 PM
post55293
|
Hmm, I created a small example, but I cannot run or debug it... It
always fails to read if I do fcntl, if not it runs fine...
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
int main(int argc, char *argv[]) {
int n;
int ch = 0;
int rc = 0;
printf("Welcome to the QNX Momentics IDE\n");
rc = fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK);
if (rc != 0) {
perror("fcntl failed");
}
printf("enter text:\n");
/* read the outstanding chars, one by one, until newline or no more */
n = read(STDIN_FILENO, &ch, 1);
if (n>=0) {
printf("char -> %c\n",ch);
} else {
perror("read failed");
}
printf("done\n");
return EXIT_SUCCESS;
}
I get
Welcome to the QNX Momentics IDE
enter text:
read failed: Resource temporarily unavailable
done
|
|
|
mario sangalli
05/21/2010 3:02 AM
post55335
|
>Hmm, I created a small example, but I cannot run or debug it... It
>always fails to read if I do fcntl, if not it runs fine...
Elena, You are rigth... removing fctrl all works fine.
Because that was a fragment of code I've already used, I've
tested it again using the QNX 6.3.2/IDE4.0.1 version:
here all works fine and I've no debugging problems.
I've have also the "read failed: Resource temporarily unavailable"
message, but this do not block the IDE debugger or qconn.
So, its seems a problem of 6.4.1 qconn or of one of the system library...
Thank You
Mario
|
|
|
|