Hi All,
I do some nice GUI testing in my employment and ran into a strange problem recently. I was wondering if anyone else has seen this? I recently found a band-aid solution that seems to be doing just fine.
Here is the deal:
I am using ActivePerl on a windows XP machine, and have a perl script launch a GUI and do some testing on it, like so...
...
# launch the window
$pid = fork;
unless( $pid )
{
`MyGUI.exe`;
exit 1;
}
# much code to manipulate the GUI, etc here..
# now close the GUI..
&PressAButton( $gui_handle, "&Close" );
# should be done here
Looks pretty simple, huh?
The problem: When the GUI exits, the child process gets screwed up somewhere and crashes. I then either get a popup that perl.exe has tried to write to mem location 0x0, or I get some nice popup that informs me that Perl has crashed, and would I like to send a nice note to M$.
My previous solution: Since only the child process has crashed, I use the parent process to wait for these annoying popups and deal with them.
This solution did not work when we started testing in evil Windows 7. Instead, both processes would lock up, thereby preventing me from dealing with the popup.
After pulling what's left of my hair out the last few days, I came upon a band-aid solution:
...
# launch the window
$pid = fork;
unless( $pid )
{
`MyGUI.exe`;
exit 1;
}
sleep 10; # long enough for the GUI to launch
# here is the kicker:
kill 9, $pid;
# now continue with my usual testing...
Has anyone encountered this before? Are there any dire affects to killing my process?
Thanks in advance.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.