Home > Archive > PerlTk > August 2006 > Perl program testing the widget "Messag"e hangs up Ubuntu GNU/Linux
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Perl program testing the widget "Messag"e hangs up Ubuntu GNU/Linux
|
|
|
| I have been using Ubuntu for over a year now and this is the first time
I have been able to consistantly freeze the system to the point that I
have to hit the reset button. I have Ubuntu 6.06 (Dapper). I am
running on a MSI Athlon motherboard.
The freeze occurs once you bring the message bearing widget up by
clicking on the message_but (the one that says "Messsage Button".
The message bearing widget appears but it has no upper bar with a close
button, it acts as if it has done a global grab. However clicking on
the message widget does not enable you to close it or even to get its
attention.
I have perl v5.8.7. I am not sure what version of Tk I have.
Below is the program that hangs up the system - the freeze behavior
started after I made the sub "message" so I know the rest of the
program works ok.
I would appreciate people looking over this but they should not run it
unless they are prepared to do a reset button based boot of thier
system.
Can anyone tell me what is happening here and/or how to get out of a
Perl Tk program that is seizing up the system. You cannot activate the
top Applications menu, you cannot stop the program with a command C to
the command line of the terminal that launched it, you cannot flip to a
different workspace. Occasionally my disk activity light goes on.
Even more bizarre - when I do a reset button reboot the system comes up
in its alternate OS mode, it skips rebooting by going into GRUB (the
alternate OS is an isolinux launched OS called Amithlon) - this is not
a windows-GNU/linux dual boot system).
### freezup code ###
#!/usr/bin/perl/
use Tk;
use strict;
my $mw = MainWindow->new;
$mw->title("0");
### GUI
## message_but is the dangerout button
my $message_but = $mw-> Button(-text =>"Message Button",
-anchor =>'s',
-command =>\&message);#
my $ex_but = $mw-> Button(-text =>"Exit all",
-anchor =>'w',
-command =>\&exitProgram);#
##Geometry ##
my $row=1;
$ex_but -> grid (-row => ++$row, -column => 1, -sticky=>'ws');
#exit
$message_but -> grid (-row => $row, -column => 2,
-sticky=>'es'); #about
#$help_but -> grid (-row => $row, -column => 3,
-sticky=>'es'); #help
MainLoop;
# sub message is the dangerou sub
sub message{
my $subw = MainWindow ->new();
my $msg = $subw -> Message(-text =>'This is a message')->pack();
my $close_but = $mw-> Button(-text =>"close",
-anchor =>'w',
)->pack();#
} #endsub
sub exitProgram{ # this message box part works ok
$mw -> messageBox(-message =>"So long,\n and thanks for all the
fish\! \n");
exit;
} #endsub
| |
| smallpond@juno.com 2006-08-23, 6:58 pm |
|
bdz wrote:
> I have been using Ubuntu for over a year now and this is the first time
> I have been able to consistantly freeze the system to the point that I
> have to hit the reset button. I have Ubuntu 6.06 (Dapper). I am
> running on a MSI Athlon motherboard.
>
> The freeze occurs once you bring the message bearing widget up by
> clicking on the message_but (the one that says "Messsage Button".
>
> The message bearing widget appears but it has no upper bar with a close
> button, it acts as if it has done a global grab. However clicking on
> the message widget does not enable you to close it or even to get its
> attention.
>
> I have perl v5.8.7. I am not sure what version of Tk I have.
>
> Below is the program that hangs up the system - the freeze behavior
> started after I made the sub "message" so I know the rest of the
> program works ok.
>
> I would appreciate people looking over this but they should not run it
> unless they are prepared to do a reset button based boot of thier
> system.
>
> Can anyone tell me what is happening here and/or how to get out of a
> Perl Tk program that is seizing up the system. You cannot activate the
> top Applications menu, you cannot stop the program with a command C to
> the command line of the terminal that launched it, you cannot flip to a
> different workspace. Occasionally my disk activity light goes on.
>
> Even more bizarre - when I do a reset button reboot the system comes up
> in its alternate OS mode, it skips rebooting by going into GRUB (the
> alternate OS is an isolinux launched OS called Amithlon) - this is not
> a windows-GNU/linux dual boot system).
>
> ### freezup code ###
> # sub message is the dangerou sub
> sub message{
> my $subw = MainWindow ->new();
> my $msg = $subw -> Message(-text =>'This is a message')->pack();
> my $close_but = $mw-> Button(-text =>"close",
> -anchor =>'w',
> )->pack();#
>
> } #endsub
Same on Fedora. It seems to be locking up X. I can kill X in another
virtual console and the system comes back.
Removing the close button from the subw window doesn't lock up.
Also, just creating a messageBox doesn't lock up.
Adding a command to the close button doesn't help - still locks up.
To check your Tk version, do:
perl -e 'use Tk; print $Tk::VERSION."\n";'
804.027
| |
| smallpond@juno.com 2006-08-23, 6:58 pm |
|
bdz wrote:
> I have been using Ubuntu for over a year now and this is the first time
> I have been able to consistantly freeze the system to the point that I
> have to hit the reset button. I have Ubuntu 6.06 (Dapper). I am
> running on a MSI Athlon motherboard.
>
> The freeze occurs once you bring the message bearing widget up by
> clicking on the message_but (the one that says "Messsage Button".
>
> The message bearing widget appears but it has no upper bar with a close
> button, it acts as if it has done a global grab. However clicking on
> the message widget does not enable you to close it or even to get its
> attention.
>
> I have perl v5.8.7. I am not sure what version of Tk I have.
>
> Below is the program that hangs up the system - the freeze behavior
> started after I made the sub "message" so I know the rest of the
> program works ok.
>
> I would appreciate people looking over this but they should not run it
> unless they are prepared to do a reset button based boot of thier
> system.
>
> Can anyone tell me what is happening here and/or how to get out of a
> Perl Tk program that is seizing up the system. You cannot activate the
> top Applications menu, you cannot stop the program with a command C to
> the command line of the terminal that launched it, you cannot flip to a
> different workspace. Occasionally my disk activity light goes on.
>
> Even more bizarre - when I do a reset button reboot the system comes up
> in its alternate OS mode, it skips rebooting by going into GRUB (the
> alternate OS is an isolinux launched OS called Amithlon) - this is not
> a windows-GNU/linux dual boot system).
>
> ### freezup code ###
>
> #!/usr/bin/perl/
> use Tk;
> use strict;
> my $mw = MainWindow->new;
> $mw->title("0");
> ### GUI
> ## message_but is the dangerout button
> my $message_but = $mw-> Button(-text =>"Message Button",
> -anchor =>'s',
> -command =>\&message);#
>
> my $ex_but = $mw-> Button(-text =>"Exit all",
> -anchor =>'w',
> -command =>\&exitProgram);#
>
>
>
> ##Geometry ##
> my $row=1;
> $ex_but -> grid (-row => ++$row, -column => 1, -sticky=>'ws');
> #exit
> $message_but -> grid (-row => $row, -column => 2,
> -sticky=>'es'); #about
> #$help_but -> grid (-row => $row, -column => 3,
> -sticky=>'es'); #help
>
>
> MainLoop;
> # sub message is the dangerou sub
> sub message{
> my $subw = MainWindow ->new();
> my $msg = $subw -> Message(-text =>'This is a message')->pack();
> my $close_but = $mw-> Button(-text =>"close",
> -anchor =>'w',
> )->pack();#
>
> } #endsub
>
> sub exitProgram{ # this message box part works ok
> $mw -> messageBox(-message =>"So long,\n and thanks for all the
> fish\! \n");
> exit;
> } #endsub
It's not related to Message, it does the same with ROText.
It's not because you have two mainwindows, it does the same with:
$subw = $mw->Toplevel
If you put the Message and Button inside a Frame, it works as
expected. I think that packing objects directly into a toplevel
object is not expected, although it doesn't generate any warning,
even with perl -w.
sub message{
my $text = 'This is a message';
my $subw = MainWindow ->new();
my $f=$subw->Frame()->pack();
my $msg = $f -> Message(-text =>$text)->pack();
my $close_but = $f-> Button(-text =>"close",
-anchor =>'w',
)->pack();
} #endsub
-- S
| |
|
| Thanks for looking into this - I don't know if this is a bug or a
feature. My feeling is that anything that completely hangs the GUI
rather than generating an error is a bug.
Should I report it somewhere?
just for a complete documentation of this:
my version of Tk is 804.027
|
|
|
|
|