Re: [Rd] use of the tcltk package crashes R 4.0.1 for Windows

2020-06-07 Thread peter dalgaard
So this wasn't tested for a month?

Anyways, Free() is just free() with a check that we're not freeing a null 
pointer, followed by setting the pointer to NULL. At that point of tcltk.c, we 
have

   for (objc = i = 0; i < length(avec); i++){
const char *s;
char *tmp;
if (!isNull(nm) && strlen(s = translateChar(STRING_ELT(nm, i{
//  tmp = calloc(strlen(s)+2, sizeof(char));
tmp = Calloc(strlen(s)+2, char);
*tmp = '-';
strcpy(tmp+1, s);
objv[objc++] = Tcl_NewStringObj(tmp, -1);
free(tmp);
}
if (!isNull(t = VECTOR_ELT(avec, i)))
objv[objc++] = (Tcl_Obj *) R_ExternalPtrAddr(t);
}

and I can't see how tmp can be NULL at the free(), nor can I see it mattering 
if it is not set to NULL (notice that it goes out of scope with the for loop). 

-pd
 

> On 7 Jun 2020, at 16:00 , Jeroen Ooms  wrote:
> 
> On Sun, Jun 7, 2020 at 3:13 AM Fox, John  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@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.
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] use of the tcltk package crashes R 4.0.1 for Windows

2020-06-07 Thread Duncan Murdoch

On 07/06/2020 10:00 a.m., Jeroen Ooms wrote:

On Sun, Jun 7, 2020 at 3:13 AM Fox, John  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@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'.


The same commit made the same kind of change to unix/sys-std.c as well.

Duncan Murdoch



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.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] use of the tcltk package crashes R 4.0.1 for Windows

2020-06-07 Thread Fox, John
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  wrote:
> 
> On Sun, Jun 7, 2020 at 3:13 AM Fox, John  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@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.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] use of the tcltk package crashes R 4.0.1 for Windows

2020-06-07 Thread Jeroen Ooms
On Sun, Jun 7, 2020 at 3:13 AM Fox, John  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@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.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] use of the tcltk package crashes R 4.0.1 for Windows

2020-06-07 Thread Fox, John
Dear Peter,

First, thank you for following up on this problem.

Unless I somehow inexplicably missed it, as I just confirmed, the R 4.0.1 
Windows installer *doesn't* ask to install support files for Tcl/Tk.

Nor am I only one to notice this problem. I was made aware of it when several 
Rcmdr users wrote to me yesterday to say that the package was crashing R when 
it loads.

Finally, even if Tcl/Tk support is now a non-default option in R for Windows, R 
shouldn't crash if Tcl/Tk isn't installed.

Best,
 John

> On Jun 7, 2020, at 2:44 AM, peter dalgaard  wrote:
> 
> John,
> 
> The Windows installation instructions document has the following. So, one 
> obvious question is whether you did select it. (I haven't installed on 
> WIndows for ages, so I don't know whether this was changed recently or even 
> whether the selection is on or off by default).
> 
> -pd
> 
> Using package tcltk
> ===
> 
> The package tcltk supports building graphical interfaces with Tcl/Tk.
> "Support Files for Package tcltk" needs to be selected from the
> installer for this to work; alternatively you can use an existing
> installation of Tcl/Tk 8.6.x by following the instructions in the
> rw-FAQ.
> 
> 
> 
> 
>> On 7 Jun 2020, at 08:27 , peter dalgaard  wrote:
>> 
>> Not happening on Mac, so likely a Windows build issue.
>> 
>> (There's no 4.0.1 CRAN package yet, and no nightly build of 4.0.1 Patched, 
>> but the only thing changed in the sources since r78644 is the VERSION file.)
>> 
>> -pd
>> 
>>> On 7 Jun 2020, at 03:13 , Fox, John  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 
>>> 
>>> Session info (prior to the crash):
>>> 
>>> - snip 
 sessionInfo()
>>> R version 4.0.1 (2020-06-06)
>>> Platform: x86_64-w64-mingw32/x64 (64-bit)
>>> Running under: Windows 10 x64 (build 18363)
>>> 
>>> Matrix products: default
>>> 
>>> locale:
>>> [1] LC_COLLATE=English_United States.1252 
>>> [2] LC_CTYPE=English_United States.1252   
>>> [3] LC_MONETARY=English_United States.1252
>>> [4] LC_NUMERIC=C  
>>> [5] LC_TIME=English_United States.1252
>>> 
>>> attached base packages:
>>> [1] tcltk stats graphics  grDevices utils datasets  methods  
>>> [8] base 
>>> 
>>> loaded via a namespace (and not attached):
>>> [1] compiler_4.0.1 tools_4.0.1   
>>> - snip 
>>> 
>>> I observe this behaviour both in the Rgui and when I run R in a terminal. I 
>>> think the problem is general to the use of the tcltk package.
>>> 
>>> Best,
>>> John
>>> 
>>> -
>>> John Fox
>>> Professor Emeritus
>>> McMaster University
>>> Hamilton, Ontario, Canada
>>> Web: https://socialsciences.mcmaster.ca/jfox/
>>> 
>>> __
>>> R-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>> 
>> -- 
>> Peter Dalgaard, Professor,
>> Center for Statistics, Copenhagen Business School
>> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
>> Phone: (+45)38153501
>> Office: A 4.23
>> Email: pd@cbs.dk  Priv: pda...@gmail.com
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
> 
> -- 
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Office: A 4.23
> Email: pd@cbs.dk  Priv: pda...@gmail.com
> 
> 
> 
> 
> 
> 
> 
> 
> 

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] use of the tcltk package crashes R 4.0.1 for Windows

2020-06-06 Thread peter dalgaard
John,

The Windows installation instructions document has the following. So, one 
obvious question is whether you did select it. (I haven't installed on WIndows 
for ages, so I don't know whether this was changed recently or even whether the 
selection is on or off by default).

-pd

Using package tcltk
===

The package tcltk supports building graphical interfaces with Tcl/Tk.
"Support Files for Package tcltk" needs to be selected from the
installer for this to work; alternatively you can use an existing
installation of Tcl/Tk 8.6.x by following the instructions in the
rw-FAQ.




> On 7 Jun 2020, at 08:27 , peter dalgaard  wrote:
> 
> Not happening on Mac, so likely a Windows build issue.
> 
> (There's no 4.0.1 CRAN package yet, and no nightly build of 4.0.1 Patched, 
> but the only thing changed in the sources since r78644 is the VERSION file.)
> 
> -pd
> 
>> On 7 Jun 2020, at 03:13 , Fox, John  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 
>> 
>> Session info (prior to the crash):
>> 
>> - snip 
>>> sessionInfo()
>> R version 4.0.1 (2020-06-06)
>> Platform: x86_64-w64-mingw32/x64 (64-bit)
>> Running under: Windows 10 x64 (build 18363)
>> 
>> Matrix products: default
>> 
>> locale:
>> [1] LC_COLLATE=English_United States.1252 
>> [2] LC_CTYPE=English_United States.1252   
>> [3] LC_MONETARY=English_United States.1252
>> [4] LC_NUMERIC=C  
>> [5] LC_TIME=English_United States.1252
>> 
>> attached base packages:
>> [1] tcltk stats graphics  grDevices utils datasets  methods  
>> [8] base 
>> 
>> loaded via a namespace (and not attached):
>> [1] compiler_4.0.1 tools_4.0.1   
>> - snip 
>> 
>> I observe this behaviour both in the Rgui and when I run R in a terminal. I 
>> think the problem is general to the use of the tcltk package.
>> 
>> Best,
>> John
>> 
>> -
>> John Fox
>> Professor Emeritus
>> McMaster University
>> Hamilton, Ontario, Canada
>> Web: https://socialsciences.mcmaster.ca/jfox/
>> 
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> -- 
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Office: A 4.23
> Email: pd@cbs.dk  Priv: pda...@gmail.com
> 
> 
> 
> 
> 
> 
> 
> 
> 

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] use of the tcltk package crashes R 4.0.1 for Windows

2020-06-06 Thread peter dalgaard
Just to be clear, I was talking about Mac binary packages. The one available 
and tested was 

R-4.0-branch
4.0.1 RC
(2020/05/30, r78644)

from mac.r-project.org. (Simon Urbanek out of office for the weekend, I 
suppose.)

-pd

> On 7 Jun 2020, at 08:27 , peter dalgaard  wrote:
> 
> Not happening on Mac, so likely a Windows build issue.
> 
> (There's no 4.0.1 CRAN package yet, and no nightly build of 4.0.1 Patched, 
> but the only thing changed in the sources since r78644 is the VERSION file.)
> 
> -pd
> 
>> On 7 Jun 2020, at 03:13 , Fox, John  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 
>> 
>> Session info (prior to the crash):
>> 
>> - snip 
>>> sessionInfo()
>> R version 4.0.1 (2020-06-06)
>> Platform: x86_64-w64-mingw32/x64 (64-bit)
>> Running under: Windows 10 x64 (build 18363)
>> 
>> Matrix products: default
>> 
>> locale:
>> [1] LC_COLLATE=English_United States.1252 
>> [2] LC_CTYPE=English_United States.1252   
>> [3] LC_MONETARY=English_United States.1252
>> [4] LC_NUMERIC=C  
>> [5] LC_TIME=English_United States.1252
>> 
>> attached base packages:
>> [1] tcltk stats graphics  grDevices utils datasets  methods  
>> [8] base 
>> 
>> loaded via a namespace (and not attached):
>> [1] compiler_4.0.1 tools_4.0.1   
>> - snip 
>> 
>> I observe this behaviour both in the Rgui and when I run R in a terminal. I 
>> think the problem is general to the use of the tcltk package.
>> 
>> Best,
>> John
>> 
>> -
>> John Fox
>> Professor Emeritus
>> McMaster University
>> Hamilton, Ontario, Canada
>> Web: https://socialsciences.mcmaster.ca/jfox/
>> 
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> -- 
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Office: A 4.23
> Email: pd@cbs.dk  Priv: pda...@gmail.com
> 
> 
> 
> 
> 
> 
> 
> 
> 

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] use of the tcltk package crashes R 4.0.1 for Windows

2020-06-06 Thread peter dalgaard
Not happening on Mac, so likely a Windows build issue.

(There's no 4.0.1 CRAN package yet, and no nightly build of 4.0.1 Patched, but 
the only thing changed in the sources since r78644 is the VERSION file.)

-pd

> On 7 Jun 2020, at 03:13 , Fox, John  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 
> 
> Session info (prior to the crash):
> 
> - snip 
>> sessionInfo()
> R version 4.0.1 (2020-06-06)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 10 x64 (build 18363)
> 
> Matrix products: default
> 
> locale:
> [1] LC_COLLATE=English_United States.1252 
> [2] LC_CTYPE=English_United States.1252   
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C  
> [5] LC_TIME=English_United States.1252
> 
> attached base packages:
> [1] tcltk stats graphics  grDevices utils datasets  methods  
> [8] base 
> 
> loaded via a namespace (and not attached):
> [1] compiler_4.0.1 tools_4.0.1   
> - snip 
> 
> I observe this behaviour both in the Rgui and when I run R in a terminal. I 
> think the problem is general to the use of the tcltk package.
> 
> Best,
> John
> 
> -
> John Fox
> Professor Emeritus
> McMaster University
> Hamilton, Ontario, Canada
> Web: https://socialsciences.mcmaster.ca/jfox/
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


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

2020-06-06 Thread Fox, John
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 

Session info (prior to the crash):

- snip 
> sessionInfo()
R version 4.0.1 (2020-06-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C  
[5] LC_TIME=English_United States.1252

attached base packages:
[1] tcltk stats graphics  grDevices utils datasets  methods  
[8] base 

loaded via a namespace (and not attached):
[1] compiler_4.0.1 tools_4.0.1   
- snip 

I observe this behaviour both in the Rgui and when I run R in a terminal. I 
think the problem is general to the use of the tcltk package.

Best,
 John

-
John Fox
Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
Web: https://socialsciences.mcmaster.ca/jfox/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel