From simon.urbanek at r-project.org  Wed Jul 12 14:49:14 2006
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Wed, 12 Jul 2006 08:49:14 -0400
Subject: [Rd] invalid alignment error in R-2.4.0
In-Reply-To: <34CDD1D4-4F13-4411-8638-0E48451100D2@soc.soton.ac.uk>
References: <83E43F77-928F-4315-B311-0002B276A1F5@soc.soton.ac.uk>
	<17587.24696.569438.600090@stat.math.ethz.ch>
	<34CDD1D4-4F13-4411-8638-0E48451100D2@soc.soton.ac.uk>
Message-ID: <2BB25965-A0EA-49D5-882E-EB7C43D2407A@r-project.org>

Robin,

how did you compile your R? I know that old gcc 4 (as supplied by  
Apple) did indeed produce invalid code in quicksort that segfaulted,  
however, that was on an Intel Mac. You may want to use gcc 4.0.3 or  
later instead and see whether the problem is gone - R-devel from  
http://r.research.att.com/ is compiled with gcc 4.0.3 and it doesn't  
exhibit this behavior.

Cheers,
Simon

On Jul 11, 2006, at 5:04 AM, Robin Hankin wrote:

> Hi Martin
>
>
> On 11 Jul 2006, at 09:25, Martin Maechler wrote:
>
>> I assume this is specific to your installation of R-devel
>> (R-2.4.0 "unstable").  If I use your 'out',
>>    hist(out^4, col = "gray")
>> works just fine consistently.
>>
>> Could it be a compiler / linker mismatch
>> on your Mac?  Also, can you run "under the debugger"
>>    'R -d gdb' (from a commandline) ?
>>
>> This should allow a traceback ('backtrace', abbreviated 'bt' in  
>> "gdb")
>> of the C call stack.
>
>
>
> transcript follows:
>
>
> octopus:~/scratch% ./Rd/R.framework/Versions/2.4/Resources/bin/R -d  
> gdb
> GNU gdb 6.1-20040303 (Apple version gdb-434) (Wed Nov  2 17:28:16 GMT
> 2005)
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and
> you are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for
> details.
> This GDB was configured as "powerpc-apple-darwin"...Reading symbols
> for shared libraries ... done
>
> (gdb) R
> Starting program: /Users/rksh/scratch/Rd/R.framework/Versions/2.4/
> Resources/bin/exec/R
> Reading symbols for shared libraries ...................+ done
>
> R version 2.4.0 Under development (unstable) (2006-07-09 r38523)
> Copyright (C) 2006 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
>
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
>
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
>
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
>
> Reading symbols for shared
> libraries ..........................................................
> done
> Reading symbols for shared libraries . done
> Reading symbols for shared libraries . done
>> load("~/f")
>> hist(out^4)
>
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_PROTECTION_FAILURE at address: 0x00000012
> R_qsort (v=0x2855858, i=1, j=2) at qsort-body.c:126
> 126             vt = v[i + 1];
> (gdb) bt
> #0  R_qsort (v=0x2855858, i=1, j=2) at qsort-body.c:126
> #1  0x0111e5d4 in do_qsort (call=0x1d0ed04, op=0x1, args=0x1d0b7f8,
> rho=0x4) at qsort.c:89
> #2  0x010c9a1c in do_internal (call=0x1d0b7f8, op=0x1, args=0x0,
> env=0x1d0c494) at names.c:1091
> #3  0x01099bb4 in Rf_eval (e=0x1d0ec94, rho=0x1d0c494) at eval.c:425
> #4  0x0109ba10 in do_set (call=0x1d0fb78, op=0x180a390,
> args=0x1d0fb94, rho=0x1d0c494) at eval.c:1337
> #5  0x01099bb4 in Rf_eval (e=0x1d0fb78, rho=0x1d0c494) at eval.c:425
> #6  0x0109bc60 in do_begin (call=0x1d0fb40, op=0x180a2cc,
> args=0x1d0fb5c, rho=0x1d0c494) at eval.c:1101
> #7  0x01099bb4 in Rf_eval (e=0x1d0fb40, rho=0x1d0c494) at eval.c:425
> #8  0x01099bb4 in Rf_eval (e=0x1d0fa44, rho=0x1d0c494) at eval.c:425
> #9  0x0109ba10 in do_set (call=0x1d0f9f0, op=0x180a390,
> args=0x1d0fa0c, rho=0x1d0c494) at eval.c:1337
> #10 0x01099bb4 in Rf_eval (e=0x1d0f9f0, rho=0x1d0c494) at eval.c:425
> #11 0x0109bc60 in do_begin (call=0x1d0f5e4, op=0x180a2cc,
> args=0x1d0f9d4, rho=0x1d0c494) at eval.c:1101
> #12 0x01099bb4 in Rf_eval (e=0x1d0f5e4, rho=0x1d0c494) at eval.c:425
> #13 0x01099bb4 in Rf_eval (e=0x1d0f520, rho=0x1d0c494) at eval.c:425
> #14 0x0109bc60 in do_begin (call=0x1d10f18, op=0x180a2cc,
> args=0x1d0f504, rho=0x1d0c494) at eval.c:1101
> #15 0x01099bb4 in Rf_eval (e=0x1d10f18, rho=0x1d0c494) at eval.c:425
> #16 0x0109d0ac in Rf_applyClosure (call=0x1d1353c, op=0x1d10d58,
> arglist=0x1d0d2ec, rho=0x1d13830, suppliedenv=0x181d304) at eval.c:615
> #17 0x01099d94 in Rf_eval (e=0x1d1353c, rho=0x1d13830) at eval.c:456
> #18 0x0109b008 in Rf_DispatchOrEval (call=0x1d134cc, op=0x180b978,
> generic=0x11d74d0 "[", args=0x1d13504, rho=0x1d13830, ans=0xbfffa248,
> dropmissing=0, argsevald=0) at eval.c:1758
> #19 0x0115a828 in do_subset (call=0x1d134cc, op=0x180b978, args=0x0,
> rho=0x1d13830) at subset.c:527
> #20 0x01099bb4 in Rf_eval (e=0x1d134cc, rho=0x1d13830) at eval.c:425
> #21 0x01099a5c in Rf_eval (e=0x1d118a0, rho=0x1d1192c) at eval.c:402
> #22 0x0109ae04 in Rf_evalList (el=0x1b4f9dc, rho=0x1d1192c) at eval.c:
> 1417
> #23 0x010c9980 in do_internal (call=0x1b4f9dc, op=0x1,
> args=0x1b4fa14, env=0x1d1192c) at names.c:1087
> #24 0x01099bb4 in Rf_eval (e=0x1b4fa30, rho=0x1d1192c) at eval.c:425
> #25 0x0109d0ac in Rf_applyClosure (call=0x1d13424, op=0x1b4fa84,
> arglist=0x1d118bc, rho=0x1d13830, suppliedenv=0x181d304) at eval.c:615
> #26 0x01099d94 in Rf_eval (e=0x1d13424, rho=0x1d13830) at eval.c:456
> #27 0x0109ae7c in Rf_evalList (el=0x1d13408, rho=0x1d13830) at eval.c:
> 1427
> #28 0x01099c04 in Rf_eval (e=0x1d143b0, rho=0x1d13830) at eval.c:435
> #29 0x0109bc60 in do_begin (call=0x1d14378, op=0x180a2cc,
> args=0x1d14394, rho=0x1d13830) at eval.c:1101
> #30 0x01099bb4 in Rf_eval (e=0x1d14378, rho=0x1d13830) at eval.c:425
> #31 0x01099bb4 in Rf_eval (e=0x1d140f4, rho=0x1d13830) at eval.c:425
> #32 0x0109bc60 in do_begin (call=0x1d14654, op=0x180a2cc,
> args=0x1d140d8, rho=0x1d13830) at eval.c:1101
> #33 0x01099bb4 in Rf_eval (e=0x1d14654, rho=0x1d13830) at eval.c:425
> #34 0x0109d0ac in Rf_applyClosure (call=0x1fa96bc, op=0x1d15a7c,
> arglist=0x1d137dc, rho=0x1d39024, suppliedenv=0x181d304) at eval.c:615
> #35 0x01099d94 in Rf_eval (e=0x1fa96bc, rho=0x1d39024) at eval.c:456
> #36 0x0109ae7c in Rf_evalList (el=0x1fa96a0, rho=0x1d39024) at eval.c:
> 1427
> #37 0x01099c04 in Rf_eval (e=0x1fa9668, rho=0x1d39024) at eval.c:435
> #38 0x0109ba10 in do_set (call=0x1fa95c0, op=0x180a390,
> args=0x1fa95dc, rho=0x1d39024) at eval.c:1337
> #39 0x01099bb4 in Rf_eval (e=0x1fa95c0, rho=0x1d39024) at eval.c:425
> #40 0x0109bc60 in do_begin (call=0x1facdc0, op=0x180a2cc,
> args=0x1fa95a4, rho=0x1d39024) at eval.c:1101
> #41 0x01099bb4 in Rf_eval (e=0x1facdc0, rho=0x1d39024) at eval.c:425
> #42 0x0109d0ac in Rf_applyClosure (call=0x1d3a2c4, op=0x1fad6f4,
> arglist=0x1d3a040, rho=0x1d3a094, suppliedenv=0x1d3a21c) at eval.c:615
> #43 0x010cc7e0 in Rf_usemethod (generic=0x1f69540 "hist",
> obj=0x1fad6f4, call=0x2, args=0x4, rho=0x1d3a094, callrho=0x181d2e8,
> defrho=0x2aa59f8, ans=0xbfffe148) at objects.c:311
> #44 0x010ccb20 in do_usemethod (call=0x1d3af24, op=0x1,
> args=0x1d3af40, env=0x1d3a094) at objects.c:395
> #45 0x01099bb4 in Rf_eval (e=0x1d3af24, rho=0x1d3a094) at eval.c:425
> #46 0x0109d0ac in Rf_applyClosure (call=0x1d3b724, op=0x1d3ab88,
> arglist=0x1d3a040, rho=0x181d2e8, suppliedenv=0x181d304) at eval.c:615
> #47 0x01099d94 in Rf_eval (e=0x1d3b724, rho=0x181d2e8) at eval.c:456
> #48 0x010b7d30 in Rf_ReplIteration (rho=0x181d2e8, savestack=0,
> browselevel=0, state=0xbfffed88) at main.c:254
> #49 0x010b7e88 in R_ReplConsole (rho=0x181d2e8, savestack=0,
> browselevel=0) at main.c:302
> #50 0x010b8198 in run_Rmainloop () at main.c:913
> #51 0x00002cec in main (ac=42293336, av=0x1) at Rmain.c:33
> (gdb)
>
>
> --
> Robin Hankin
> Uncertainty Analyst
> National Oceanography Centre, Southampton
> European Way, Southampton SO14 3ZH, UK
>   tel  023-8059-7743
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>



[Rd] invalid alignment error in R-2.4.0
Simon Urbanek