From alistair.gee at gmail.com  Wed Mar 17 15:16:21 2010
From: alistair.gee at gmail.com (Alistair Gee)
Date: Wed, 17 Mar 2010 07:16:21 -0700
Subject: [Rd] list_files() memory corruption?
In-Reply-To: <4B9F0585.409@userprimary.net>
References: <e63850351003121637rc13612et6fbd55fd453757f7@mail.gmail.com>
	<4B9EF5D2.8010107@userprimary.net>
	<e63850351003152037k1dbde4c1o2ba9c51ecd02fb4d@mail.gmail.com>
	<4B9F0585.409@userprimary.net>
Message-ID: <e63850351003170716h23e60328oce0d6ed7f61f45d7@mail.gmail.com>

On Mon, Mar 15, 2010 at 9:13 PM, Seth Falcon <seth at userprimary.net> wrote:

> I'm curious to know if this is a problem you have encountered while using R.
>
> My initial thought is that there isn't much benefit of making this part
> of the code smarter. ?If your patch simplifies things, I'd be more
> interested.
>
> + seth
>

Yes. I had noticed that R occasionally segfaults (especially when I
run many concurrent R processes), so I used valgrind to log every use
of R. In the valgrind logs, I tracked the problem to list_files().

I attached a patch to platform.c (for trunk). Unfortunately, I am
having trouble building R from the subversion trunk--it is taking a
very long time decompressing/installing the recommended packages--so I
haven't been able to verify the fix yet. But my version of platform.c
does compile, and it does simplify the code b/c count_files() is no
longer needed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: platform.c.patch
Type: text/x-patch
Size: 4257 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20100317/370733d4/attachment.bin>


[Rd] list_files() memory corruption?
Alistair Gee