From murdoch.duncan at gmail.com  Mon Sep 21 20:01:23 2015
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Mon, 21 Sep 2015 14:01:23 -0400
Subject: [Rd] segfault with readDCF on R 3.1.2 on AIX 6.1 when using
 install.packages
In-Reply-To: <CA+2DmwgZ6XKW9Py7bEx9EC-gQtjmR9yJr-JMHW731gxJKarTfg@mail.gmail.com>
References: <CA+2Dmwgowjk9+qKcVQOPXRaGpER5wu+UtqZ=pJrJmaNS1DDpdw@mail.gmail.com>
	<CA+2DmwigXqx_ymW85qzgL7JvyM6tHyzyqSNjWcazow+JROZZ+g@mail.gmail.com>
	<CA+2DmwgZ6XKW9Py7bEx9EC-gQtjmR9yJr-JMHW731gxJKarTfg@mail.gmail.com>
Message-ID: <560045F3.1060503@gmail.com>

On 21/09/2015 1:49 PM, Vinh Nguyen wrote:
> Here's an update:
> 
> I checked the ChangeLog for R, and it seems like readDCF was changed
> in 3.0.2.  I went on a whim and copied src/main/dcf.c from R 2.15.3
> over to 3.2.2, and R compiled fine and install.packages now work for
> me.
> 
> This is probably not ideal, but it at least makes R usable on AIX for
> me.  Would definitely like to help figure out what's wrong with the
> new dcf.c on AIX.

I don't know if anyone on the core team has access to AIX, so you're
likely on your own for this.

I'd suggest running R in a debugger (gdb or whatever you have), and
identifying exactly which line in dcf.c fails, and why.  If you tell us
that, we might be able to spot what is going wrong.

Duncan Murdoch

> 
> Thanks.
> 
> -- Vinh
> 
> 
> On Mon, Sep 21, 2015 at 10:01 AM, Vinh Nguyen <vinhdizzo at gmail.com> wrote:
>> Hi there,
>>
>> I just wanted to follow up on this readDCF issue with install.packages
>> on AIX on R 3.*.  I'm happy to help try potential solutions or debug
>> if anyone could point me in the right direction.
>>
>> To re-cap, it appears readDCF is segfault'ing since R 3.* on AIX.
>> This was not the case up until R 2.15.3.  This makes install.packages
>> not usable.  Thanks.
>>
>> -- Vinh
>>
>>
>> On Tue, Nov 11, 2014 at 10:23 AM, Vinh Nguyen <vinhdizzo at gmail.com> wrote:
>>> Dear list (re-posting from r-help as r-devel is probably more appropriate),
>>>
>>> I was able to successfully compile R on our AIX box at work using the
>>> GNU compilers following the instructions on the R Administration
>>> guide.  The output can be seen at here
>>> (https://gist.github.com/nguyenvinh/504321ea9c89d8919bef) and yields
>>> no errors .
>>>
>>> However, I get a segfault whenever I try to use the install.packages
>>> function to install packages.  Using debug, I was able to trace it to
>>> the readDCF function:
>>>
>>> Browse[2]>
>>> debug: if (!all) return(.Internal(readDCF(file, fields, keep.white)))
>>> Browse[2]>
>>> debug: return(.Internal(readDCF(file, fields, keep.white)))
>>> Browse[2]>
>>>
>>>  *** caught segfault ***
>>> address 4, cause 'invalid permissions'
>>>
>>> Possible actions:
>>> 1: abort (with core dump, if enabled)
>>> 2: normal R exit
>>> 3: exit R without saving workspace
>>> 4: exit R saving workspace
>>> Selection:
>>>
>>> Was curious if anyone has a clue on why such error exists or what I
>>> could do to fix it?  I'm able to install packages via R CMD INSTALL,
>>> but I would hate to have to manually determine dependencies, download
>>> the source for each package, and install them "by hand" via R CMD
>>> INSTALL.
>>>
>>> I went back and compiled older versions of R to see if this error
>>> exists.  On R 3.0.3, I get:
>>>
>>> debug(available.packages)
>>> install.packages('ggplot2', dep=TRUE, repo='http://cran.stat.ucla.edu')
>>> ...
>>> Browse[2]>
>>> debug: z <- res0 <- tryCatch(read.dcf(file = tmpf), error = identity)
>>> Browse[2]>
>>> Error: segfault from C stack overflow
>>>
>>> On R 2.15.3, I do not see the error.
>>>
>>> Would be great to get this resolved.  Thank you for your help.
>>>
>>> -- Vinh
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] segfault with readDCF on R 3.1.2 on AIX 6.1 when using install.packages
Duncan Murdoch