Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

macOS autorelease

by IB2017 (Pilgrim)
on Oct 26, 2018 at 10:20 UTC ( [id://1224723]=perlquestion: print w/replies, xml ) Need Help??

IB2017 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks

I have an application with the following scenario:

  • macOS High Sierra version 10.13.4
  • Perl 24.1
  • Tcl::pTk
  • ActiveTcl 8.6.8.0 (but also 8.6.7)

Some users reports crashes with the following error (I cannot replicate the crash with a similar setting):

objc[1298]: Invalid or prematurely-freed autorelease pool 0x7fde6767e050

I searched the web to try to understand problem and solution to this, with no success. Actually, I am not sure which component of my program is causing the problem: is it Perl? Is it Tcl/Tk? IS it the module to call Tcl/Tk, i.e. Tcl::pTk?

Any suggestion to point me to the right direction?

Replies are listed 'Best First'.
Re: macOS autorelease
by localshop (Monk) on Oct 29, 2018 at 00:08 UTC
    Are you able to provide any more detail. It looks like ActiveTcl is a Microsoft Windows module so not sure how this relates to MacOS. As you are binding to C library calls as suggested with your Tcl reference, there are likely a lot of dependencies that could cause this kind of problem. It would be great if you could expand on your environment a little to guide the investigation.

    ED: As OP have advised ActivePerl is indeed available for Mac OSX - did not know that - thanks. I wonder if the Tk modules require a local running X Server like XQuartz perhaps? Not quite so game to install ActivePerl to find out but would def. be interested to know if others are using it with Tk.

    I assume you have installed ActiveTCL (https://www.activestate.com/activetcl/downloads ) and aren't just trying to use the Perl Module - the error smells to me like a missing library dependency.

      Hi. ActiveTcl is available for macOS too. Do not have much more details. I found the following error report which suggest the problem may be related with the Tk component (for the GUI). However, it is checked as "solved". I will post my problem there.

        I agree—this looks like an issue in Tcl/Tk, because the Tk Aqua code is where autorelease pools are being handled and presumably can cause errors relating to that. (Though Perl could still be doing something Tcl doesn't like.) Hopefully some specific actions that cause this error can be identified in order to diagnose this further. Quite a few changes are still being made to Tk Aqua. Has this already been reported anywhere else?

      FYI, ActiveTcl is a TCL distribution from ActiveState. They also offer ActivePerl.

      To clarify a few points: this isn't using the Perl/Tk module; this is instead using a wrapper to use Tcl/Tk instead. Tcl::pTk is pure Perl, and likely so is IB2017's program. The C bindings to Tcl/Tk are all contained in Tcl.pm. Also, recent ActiveTcl only provides Tk for Aqua, so there's no use of XQuartz in this case. The Perl/Tk module however only works with XQuartz, as it has not been updated to work on Aqua.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1224723]
Approved by Ratazong
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-03-28 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found