Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Perl Tk crashes when mem usage exceeds 4G on Win10

by kcott (Archbishop)
on Sep 23, 2022 at 22:29 UTC ( [id://11147093]=note: print w/replies, xml ) Need Help??


in reply to Perl Tk crashes when mem usage exceeds 4G on Win10

G'day boleary,

I ran a few tests and can confirm your findings.

I made a very small change to your code to confirm completion:
Was: if (time() - $lastUpdate > 1) {
Now: if (time() - $lastUpdate > 1 or $_ == 5000000) {
And added the shebang: #!/usr/bin/env perl
Other than that, I ran exactly the code you posted
(modified code: C:\Users\ken\tmp\pm_11147080_tk_mem.pl).

I have Cygwin running on Win10:

$ uname -a CYGWIN_NT-10.0-19044 titan 3.3.6-341.x86_64 2022-09-05 11:15 UTC x86_6 +4 Cygwin

I have Perlbrew with a variety of Perl versions, each with Tk installed. I ran

ken@titan /cygdrive/c/Users/ken/tmp $ ./pm_11147080_tk_mem.pl

successfully to completion, without any error or warning messages, with these Perl & Tk combinations: 5.30.0/804.034, 5.32.0/804.035 & 5.36.0/804.036 (each using ~5.5GB memory, from visual inspection of Task Manager).

I don't use the MSWin side of my machine very often, doing nearly all of my work with Cygwin; however, I did have an old Strawberry Perl version with Tk:

Microsoft Windows [Version 10.0.19044.2075] (c) Microsoft Corporation. All rights reserved. C:\Users\ken\tmp>perl -v This is perl 5, version 26, subversion 3 (v5.26.3) built for MSWin32-x +64-multi-thread ... C:\Users\ken\tmp>perl -E "use Tk; say $Tk::VERSION" 804.034

I ran the script three times:

C:\Users\ken\tmp>perl pm_11147080_tk_mem.pl C:\Users\ken\tmp>perl pm_11147080_tk_mem.pl Free to wrong pool 25e3ed0 not 10e38400 at pm_11147080_tk_mem.pl line +43. C:\Users\ken\tmp>perl pm_11147080_tk_mem.pl Free to wrong pool 25c3ed0 not 2ee60830 at pm_11147080_tk_mem.pl line +43.

Each run died at about 4GB memory usage (from visual inspection of Task Manager) with the Tk application completely shutting down. Like you, I either got "Free to wrong pool ..." or no output at all. With the added shebang and a blank line after it, my line 43 should be the same as your line 41:

$MAIN_WINDOW->update();

I had a look in "Active bugs for Tk" but nothing really looked like it was relevant to this. There's apparently 144 in the list; I could have missed something; a second pair of eyes wouldn't hurt.

I would definitely advise raising a bug report. Before you do that, though, I'd await further reports from other monks. The more specific information you can supply, the easier it will be for maintainers to track down the problem. The type of such information could be, but is not limited to:

  • Occurs on MSWin only or others.
  • Occurs on Win10 only or others.
  • Occurs on Strawberry Perl only or others.
  • Occurs with Perl versions earlier than 5.26.3.
  • Occurs with Tk versions ealier than 804.034.

I acknowledge that you may already know this. You can consider it as a useful checklist for others.

— Ken

Replies are listed 'Best First'.
Re^2: Perl Tk crashes when mem usage exceeds 4G on Win10
by boleary (Scribe) on Sep 26, 2022 at 23:27 UTC

    Thanks for the detailed analysis Ken. I tried to reply last Friday, but forgot to send it and lost my writeup

    I'm pretty sure it happens only on Windows. I can try on Win11 as well but I would expect the same. I don't have my Win7 hosts anymore

    I really only have access to Strawberry Perl v5.30.x and the linux version I am running... I use perl2exe to distribute my code and I'm locked in on those versions

    I did take a look at the active bugs and the 11679 Tk not 64-bit clean was pretty interesting... I do think if that were the issue, it would crash on Linux hosts as well... The code the in tkGlue.c that the bug highlighted has been around for a very long time!

    thanks again for the feedback!

      I'd suggest waiting until 1st October before submitting the bug report. That'll give about a week (from the time of the original post) for any further feedback: PM tends to be quieter over the weekend, so there may be more to come.

      In your bug report, I'd stick to what you know: problem on these (list) Perl & Tk combinations; but no problem on these (other list) combinations. I would avoid conjecture altogether: "I'm pretty sure ..."; "I would expect ..."; and similar. It's likely that maintainers have their own testing environments: they can confirm what you report as well as testing other scenarios.

      I'd also include a link to this thread: your report can summarise findings; with the link back to here for details. It shows that you made an effort before raising the bug report. There may be additional information by the time someone gets around to looking at the problem.

      — Ken

Re^2: Perl Tk crashes when mem usage exceeds 4G on Win10
by boleary (Scribe) on Oct 24, 2022 at 21:04 UTC

    G'day Ken

    I just got back from a very nice 2 week visit to Melbourne, Australia. Not sure if you are Aussie or Kiwi? (Unfortunately, all I got to see of NZ was the inside of Auckland Airport)

    I've never raised an official bug report... (I did add an issue in the Spreadsheet Module Git Repo once, but that seemed to go nowhere)

    Are you be talking about submitting this to Perl.org, Strawberry Perl, or going directly to TK?

    Thanks for your help,

    Bill

      "I just got back from a very nice 2 week visit to Melbourne, Australia. Not sure if you are Aussie or Kiwi?"

      See the Location: in my home node. :-)

      "Are you be talking about submitting this to Perl.org, Strawberry Perl, or going directly to TK?"

      In the first instance, I'd raise this as a Tk bug. In "Active bugs for Tk", and similarly for other distributions, you find menus: "About rt.cpan.org" -> "How do I ...?" — which leads to "How to use rt.cpan.org" where you'll find information about bug reporting (amongst other things).

      — Ken

        "See the Location: in my home node. :-)" Nice!

        I will report this by emailing bug-Tk@rt.cpan.org

        No... that sounds terrifying, but thanks for the tip

        For one thing, I'm using many TK modules with XS implementations which are not supported by this module

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11147093]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (None)
    As of 2024-04-25 01:33 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found