From ripley at stats.ox.ac.uk  Fri Jan  5 20:39:56 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri, 5 Jan 2007 19:39:56 +0000 (GMT)
Subject: [Rd] help for memory problem with 64-bit machines
In-Reply-To: <200701051300.16117.vdergachev@rcgardis.com>
References: <E1H2rmC-0005nz-00@DMjcadima> <459E81DD.6060707@cimr.cam.ac.uk>
	<459E868A.2080302@biostat.ku.dk>
	<200701051300.16117.vdergachev@rcgardis.com>
Message-ID: <Pine.LNX.4.64.0701051937030.4384@gannet.stats.ox.ac.uk>

The problem with the misuse of 'long' in package 'subselect' was reported 
to Mr Cadima in February 2005 (along with a number of other package 
maintainers).


On Fri, 5 Jan 2007, Vladimir Dergachev wrote:

> On Friday 05 January 2007 12:10 pm, Peter Dalgaard wrote:
>> Hin-Tak Leung wrote:
>>> I got the same error with 64-bit R 2.4.1 on FC6 x86_64, and 32-bit
>>> R 2.4.1 on the same machine is okay. There is definitely something wrong
>>> with your code.
>>>
>>> I would suggest fixing all the compier warnings - there are piles of
>>> them about uninitialized variables, and about doing comparison
>>> between signed and unsigned expressions, etc first. Put -Wall in
>>> CFLAGS CXXFLAGS and FFLAGS and you'll see.
>
> Also, the issue I most commonly see is the difference in size for "long" data
> type. On 32 bit sizeof(long)=sizeof(int)=32, but on 64bit sizeof(long)=64
> while sizeof(int)=32.
>
> This reverses a formerly safe practice of using long for 32 bit (and insuring
> the code compiles correctly on 16 bit machines).
>
>                            best
>
>                                Vladimir Dergachev
>
>>>
>>> good luck.
>>>
>>> Hin-Tak Leung
>>
>> Good advice. Also, the most common culprit for 64/32 problem is pointers
>> stored as integers so watch out for any of those. And notice that you
>> can set a breakpoint at randsk1_ and start poking around to see what is
>> inside various variables and singlestep to the point of the crash (it's
>> a bit painful and confusing in Fortran code, though.)
>>
>>     -pd
>>
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] help for memory problem with 64-bit machines
Prof Brian Ripley