From j|ox @end|ng |rom mcm@@ter@c@  Sun Jun  7 16:46:39 2020
From: j|ox @end|ng |rom mcm@@ter@c@ (Fox, John)
Date: Sun, 7 Jun 2020 14:46:39 +0000
Subject: [Rd] use of the tcltk package crashes R 4.0.1 for Windows
In-Reply-To: <CABFfbXuT+hs2uAQuGtvJ_-c1xQPwx6Z+kfiUUwHJkvd4jzY6dg@mail.gmail.com>
References: <ACD1644AA6C67E4FBD0C350625508EC88CF55DA3@FHSDB2D11-2.csu.mcmaster.ca>
 <CABFfbXuT+hs2uAQuGtvJ_-c1xQPwx6Z+kfiUUwHJkvd4jzY6dg@mail.gmail.com>
Message-ID: <7342C4BD-C5E8-45EC-93E9-4F0E7A02D335@mcmaster.ca>

Dear Jeroen,

Thank you for tracking down the source of the problem.

You probably saw that Peter Dalgaard reported that the tcltk package apparently is working fine in R 4.0.1 on macOS. I haven't confirmed that myself because the Mac binary for R 4.0.1 isn't yet on CRAN.

Best,
 John

> On Jun 7, 2020, at 10:00 AM, Jeroen Ooms <jeroenooms at gmail.com> wrote:
> 
> On Sun, Jun 7, 2020 at 3:13 AM Fox, John <jfox at mcmaster.ca> wrote:
>> 
>> Hi,
>> 
>> The following code, from the examples in ?TkWidgets , immediately crashes R 4.0.1 for Windows:
>> 
>> --------------------- snip --------------------
>> library("tcltk")
>> tt <- tktoplevel()
>> label.widget <- tklabel(tt, text = "Hello, World!")
>> button.widget <- tkbutton(tt, text = "Push",
>>         command = function()cat("OW!\n"))
>> tkpack(label.widget, button.widget) # geometry manager
>> --------------------- snip --------------------
> 
> 
> I can reproduce this. The backtrace shows the crash happens in
> dotTclObjv  [/src/library/tcltk/src/tcltk.c at 243 ]. This looks like a
> bug that was introduced by commit 78408/78409 about a month ago. I
> think the problem is that this commit changes 'calloc' to 'Calloc'
> without changing the corresponding 'free' to 'Free'.
> 
> This has nothing to do with the Windows build or installation. Nothing
> has changed in the windows build procedure between 4.0.0 and 4.0.1.



[Rd] use of the tcltk package crashes R 4.0.1 for Windows
Fox, John