I’m not sure what’s going on with your setup, but this is what I get on my machine when I press Ctrl-C just after the R prompt comes up when started with “R -d gdb":

Program received signal SIGINT, Interrupt.
0x00007fff874179aa in select$DARWIN_EXTSN ()
(gdb) bt
#0  0x00007fff874179aa in select$DARWIN_EXTSN ()
#1  0x0000000100178bcf in R_SelectEx (n=1, readfds=0x100316bc0, writefds=0x0, exceptfds=0x0, timeout=0x0, intr=0x100178800 <handleInterrupt>) at sys-std.c:154
#2  0x000000010017960b in R_checkActivityEx [inlined] () at :331
#3  0x000000010017960b in Rstd_ReadConsole (prompt=0x7fff73ea07a8 "P\003�s�", buf=0x7fff5fbfe820 "`�_�", len=1606412320, addtohistory=1606407976) at sys-std.c:920
#4  0x00000001000c4d19 in Rf_ReplIteration (rho=0x1018345f8, savestack=1606412384, browselevel=0, state=0x7fff5fbfd728) at main.c:209
#5  0x00000001000c5643 in R_ReplConsole [inlined] () at :307
#6  0x00000001000c5643 in run_Rmainloop () at main.c:984
#7  0x0000000100000e5b in main ()

Version info:

OS X: 10.9.1 (Mavericks)
R: 3.0.2 (from CRAN)
gdb: 6.3.50-20050815 (Apple version gdb-1824)
Xcode: 5.0.2

Davor


On Jan 19, 2014, at 10:58 AM, Gábor Csárdi <csardi.gabor@gmail.com> wrote:

> On Sun, Jan 19, 2014 at 1:53 PM, Davor Cubranic <cubranic@stat.ubc.ca> wrote:
> On Jan 17, 2014, at 6:17 AM, Gábor Csárdi <csardi.gabor@gmail.com> wrote:
> 
> > Small note: if you are using a recent version of OSX, then gdb is
> > essentially useless, but you can use llvm, which is nicer in many respects,
> > anyway.
> 
> 
> What do you mean by this? Gdb is a debugger, and LLVM is a compiler infrastructure. Perhaps you mean “lldb”?
> 
> Yes, I meant lldb, sorry. 
> 
> 
> Why do you say gdb is useless anyways? I haven’t seen any problems with it on Mavericks.
> 
> Depends what compiler you use, I guess. On a CRAN version of R, this is what I get with gdb, after just pressing CTRL+C:
> 
> Program received signal SIGINT, Interrupt.
> 0x00007fff8fc449aa in ?? ()
> (gdb) bt
> #0  0x00007fff8fc449aa in ?? ()
> #1  0x0000000100178bcf in ?? ()
> #2  0x0000040000000400 in ?? ()
> #3  0x0000000079fa5350 in ?? ()
> #4  0x0000000100178800 in ?? ()
> #5  0x00007fff79fa57a8 in ?? ()
> #6  0x0000000000000000 in ?? ()
> (gdb) 
> 
> which is not very useful. This is what I get with lldb:
> 
> Process 52794 stopped
> * thread #1: tid = 0x2c0802, 0x00007fff8fc449aa libsystem_kernel.dylib`select$DARWIN_EXTSN + 10, queue = 'com.apple.main-thread, stop reason = signal SIGSTOP
>     frame #0: 0x00007fff8fc449aa libsystem_kernel.dylib`select$DARWIN_EXTSN + 10
> libsystem_kernel.dylib`select$DARWIN_EXTSN + 10:
> -> 0x7fff8fc449aa:  jae    0x7fff8fc449b4            ; select$DARWIN_EXTSN + 20
>    0x7fff8fc449ac:  movq   %rax, %rdi
>    0x7fff8fc449af:  jmpq   0x7fff8fc4119a            ; cerror
>    0x7fff8fc449b4:  ret    
> (lldb) bt
> * thread #1: tid = 0x2c0802, 0x00007fff8fc449aa libsystem_kernel.dylib`select$DARWIN_EXTSN + 10, queue = 'com.apple.main-thread, stop reason = signal SIGSTOP
>     frame #0: 0x00007fff8fc449aa libsystem_kernel.dylib`select$DARWIN_EXTSN + 10
>     frame #1: 0x0000000100178bcf libR.dylib`R_SelectEx(n=1, readfds=0x0000000100316bc0, writefds=0x0000000000000000, exceptfds=0x0000000000000000, timeout=<unavailable>, intr=<unavailable>) + 207 at sys-std.c:154
>     frame #2: 0x000000010017960b libR.dylib`Rstd_ReadConsole [inlined] R_checkActivityEx(ignore_stdin=0) + 266 at sys-std.c:331
>     frame #3: 0x0000000100179501 libR.dylib`Rstd_ReadConsole(prompt=0x00007fff79fa57a8, buf=0x00007fff5fbfe910, len=1606412560, addtohistory=<unavailable>) + 1825 at sys-std.c:920
>     frame #4: 0x00000001000c4d19 libR.dylib`Rf_ReplIteration(rho=0x00000001008549f8, savestack=1606412624, browselevel=0, state=<unavailable>) + 185 at main.c:209
>     frame #5: 0x00000001000c5643 libR.dylib`run_Rmainloop [inlined] R_ReplConsole(browselevel=0, savestack=0, rho=0x00000001008549f8) + 116 at main.c:307
>     frame #6: 0x00000001000c55cf libR.dylib`run_Rmainloop + 79 at main.c:984
>     frame #7: 0x0000000100000e5b R`main + 27
>     frame #8: 0x0000000100000e34 R`start + 52
> (lldb) 
> 
> I admit, "useless" was an overreaction, and maybe you can fix gdb somehow. I just did not spend any time on trying to fix it.
> 
> Gabor
>  
> 
> Davor
> 


	[[alternative HTML version deleted]]

