[Openmcl-devel] Fix in bleeding edge works under 10.3.0 on a G5

Raffael Cavallaro raffaelcavallaro at mac.com
Sat Mar 5 05:37:12 UTC 2005


Gary,
I've confirmed that:
1. 10.3.0 shows the bug on a G5 - if I make this change:
#define DarwinSigReturn(x)
(that is, make it a NOP)
Then the control-c bug manifests - you're dropped into the kernel 
debugger - I've appended all the openmcl kernel debugger output to this 
email just in case you want to look at it for some reason.

2. The current fix in bleeding edge source:
#if 1
#define DarwinSigReturn(x) (UC_MCONTEXT(x)->ss.xer)^=0x80
#else
#define DarwinSigReturn(x)  syscall(103,x)
#endif
fixes the control-c bug under 10.3.0 on a G5 - we just go down another 
break level each time:
Welcome to OpenMCL Version (Beta: Darwin) 0.14.2-050228!
? ^C
 > Break in process listener(1):
 > While executing: #<Anonymous Function #x6131206>
 > Type :GO to continue, :POP to abort.
 > If continued: Return from BREAK.
Type :? for other options.
1 > ^C
 > Break in process listener(1):
 > While executing: #<Anonymous Function #x6131206>
 > Type :GO to continue, :POP to abort.
 > If continued: Return from BREAK.
Type :? for other options.
2 > ^C
…and so on, which is as it should be.

So the current fix works under 10.3.0.

Hope this helps,

warmest regards,

Ralph


Raffael Cavallaro, Ph.D.
raffaelcavallaro at mac.com

P.S. here's the kernel debugger output that shows the control-c bug 
under 10.3.0 on a G5 *without* the fix currently in bleeding edge:

Welcome to OpenMCL Version (Beta: Darwin) 0.14.2-050228!
? ^C
 > Error: Unknown error #104391078 with arg: -268435775
 > While executing: "Unknown"
^CUnhandled exception 11 at 0x0001744c, context->regs at #xbfffdf28
Read operation to unmapped address 0x00000023
  In foreign code at address 0x0001744c
? for help
[731] OpenMCL kernel debugger: *** malloc: vm_allocate(size=131072) 
failed (error code=268435459)
*** malloc[731]: error: Can't allocate region

?
(S)  Set specified GPR to new value
(A)  Advance the program counter by one instruction (use with caution!)
(D)  Describe the current exception in greater detail
(R)  Show raw GPR/SPR register values
(L)  Show Lisp values of tagged registers
(F)  Show FPU registers
(B)  Show backtrace
(X)  Exit from this debugger, asserting that any exception was handled
(K)  Kill OpenMCL process
(?)  Show this help
[731] OpenMCL kernel debugger: (d)
[731] OpenMCL kernel debugger: Read operation to unmapped address 
0x00000023
[731] OpenMCL kernel debugger: [731] OpenMCL kernel debugger: (r)
[731] OpenMCL kernel debugger: r00 = 0x00000003  r08 = 0x00000002  r16 
= 0xBFFFFA30  r24 = 0x00000000
r01 = 0xBFFFE410  r09 = 0x00000000  r17 = 0x00000000  r25 = 0x00000000
r02 = 0x00000003  r10 = 0xF0002C50  r18 = 0x00001200  r26 = 0x00000000
r03 = 0x061762E6  r11 = 0x0008D930  r19 = 0x00000024  r27 = 0x00000000
r04 = 0xBFFFED90  r12 = 0x0001865C  r20 = 0x00000000  r28 = 0x00000008
r05 = 0x00000000  r13 = 0xBFFFF0B0  r21 = 0x00001503  r29 = 0x00000000
r06 = 0x90054158  r14 = 0xF0002C50  r22 = 0xF0002C50  r30 = 0xBFFFE410
r07 = 0x0638A5D6  r15 = 0x061762E6  r23 = 0x00096A8D  r31 = 0xA0006688

  PC = 0x0001744C   LR = 0x000173F0  CTR = 0x00096A8D  CCR = 0xF0002C53
XER = 0x80066688  MSR = 0x0000D930  DAR = 0x00000023  DSISR = 0x40000000
[731] OpenMCL kernel debugger: [731] OpenMCL kernel debugger: (l)
[731] OpenMCL kernel debugger: rcontext = 0x00000003 (INVALID)
[731] OpenMCL kernel debugger: [731] OpenMCL kernel debugger: (f)
[731] OpenMCL kernel debugger: f00 : 0xFFF8000082008093 (nan)
f01 : 0x4051A5A580000000 (70.588226)
f02 : 0x3FF2D2D2C0000000 (1.176471)
f03 : 0x412E848000000000 (1000000.000000)
f04 : 0x4164FC7CC0000000 (11002854.000000)
f05 : 0x3FD52047FD287B5E (0.330095)
f06 : 0x000000000005096F (0.000000)
f07 : 0x3FD5555555555587 (0.333333)
f08 : 0x0000000000000000 (0.000000)
f09 : 0xBFE0000000000000 (-0.500000)
f10 : 0x3FF0000000000000 (1.000000)
f11 : 0x3C7ABC9E3B39803F (0.000000)
f12 : 0x3C7ABC9E3B39803F (0.000000)
f13 : 0x3FD5555555555587 (0.333333)
f14 : 0xC24BC19587859393 (-238423838475.152924)
f15 : 0x4330000080000000 (4503601774854144.000000)
f16 : 0x0000000000000000 (0.000000)
f17 : 0x0000000082008093 (0.000000)
f18 : 0x2482242220000000 (0.000000)
f19 : 0x020CE63C020C41AE (0.000000)
f20 : 0x0000000000000000 (0.000000)
f21 : 0xFFF8000082008093 (nan)
f22 : 0x4051A5A580000000 (70.588226)
f23 : 0x3FF2D2D2C0000000 (1.176471)
f24 : 0x412E848000000000 (1000000.000000)
f25 : 0x4164FC7CC0000000 (11002854.000000)
f26 : 0x3FD52047FD287B5E (0.330095)
f27 : 0x000000000005096F (0.000000)
f28 : 0x3FD5555555555587 (0.333333)
f29 : 0x0000000000000000 (0.000000)
f30 : 0xBFE0000000000000 (-0.500000)
f31 : 0x3FF0000000000000 (1.000000)
FPSCR = 00000000
[731] OpenMCL kernel debugger: [731] OpenMCL kernel debugger: (b)
[731] OpenMCL kernel debugger:

(#xbfffe410) #x00000000 : (null) + 0
(#xbfffe480) #x000173F0 : _callback_for_trap + 224
(#xbfffe4e0) #x00017BE4 : _handle_error + 120
(#xbfffe540) #x00017058 : _handle_fpux_binop + 232
(#xbfffe5b0) #x00016CF0 : _handle_sigfpe + 96
(#xbfffe600) #x00016DF4 : _PMCL_exception_handler + 232
(#xbfffe660) #x00017E80 : _signal_handler + 72
(#xbfffe8c0) #x000189BC : _pseudo_signal_handler + 52
(#xbfffe910) #x00020208 : _pseudo_sigreturn + 0
(#xbfffee90) #x000199C0 : _wait_on_semaphore + 60
(#xbfffef10) #x000053A8 : _SPffcall + 200
(#xBFFFEF50) #x020F674C : #<Function %WAIT-ON-SEMAPHORE-PTR #x060f2a86> 
+ 120
(#xBFFFEF60) #x021150CC : #<Function PROCESS-WAIT #x0611abfe> + 216
(#xBFFFEF70) #x02115064 : #<Function PROCESS-WAIT #x0611abfe> + 112
(#xBFFFEF80) #x02102B30 : #<Function %ACQUIRE-SHARED-RESOURCE 
#x06101cbe> + 708
(#xBFFFEF90) #x0211CE94 : #<Function BREAK-LOOP-HANDLE-ERROR 
#x061257be> + 320
(#xBFFFEFA0) #x0214CCFC : #<Function %ERROR #x06175756> + 104
(#xBFFFEFB0) #x0214E09C : #<Anonymous Function #x0617696e> + 1536
(#xBFFFEFC0) #x00004D7C : (subprimitive _ret1valn)
(#xBFFFEFD0) #x021295FC : #<Function 
FUNCALL-WITH-ERROR-REENTRY-DETECTION #x06140196> + 72
(#xBFFFEFE0) #x00004D7C : (subprimitive _ret1valn)
(#xBFFFEFF0) #x0214E188 : #<Anonymous Function #x061769f6> + 188
(#xBFFFF000) #x0214E40C : #<Function %XERR-DISP #x06176a46> + 632
(#xBFFFF010) #x0214E420 : #<Function %XERR-DISP #x06176a46> + 652
(#xBFFFF020) #x00006CB4 : (subprimitive _SPcallback)
(#xbffff030) #x00017518 : _callback_to_lisp + 276
(#xBFFFFBE0) #x02104140 : #<Function %NANOSLEEP #x06103966> + 268
(#xBFFFFBF0) #x0210F578 : #<Anonymous Function #x06112f4e> + 300
(#xBFFFFC00) #x0210F59C : #<Anonymous Function #x06112f4e> + 336
(#xBFFFFC10) #x0210F5A4 : #<Anonymous Function #x06112f4e> + 344
(#xBFFFFC20) #x0210F5D8 : #<Anonymous Function #x06112f4e> + 396
(#xBFFFFC30) #x0000883C : (subprimitive toplevel_loop)
(#xBFFFFC40) #x00008848 : (subprimitive toplevel_loop)
(#xbffffc50) #x00008914 : _start_lisp + 180


cstack area #x003040b0


(#xF0135B10) #x020F2A04 : #<Function FD-INPUT-AVAILABLE-P #x060ef606> + 
344
(#xF0135B20) #x020F2EBC : #<Function PROCESS-INPUT-WAIT #x060efb36> + 
240
(#xF0135B30) #x020F8370 : #<Function FD-STREAM-ADVANCE #x060f5e06> + 460
(#xF0135B40) #x020ECD9C : #<Function %IOBLOCK-TYI #x060dc6b6> + 384
(#xF0135B50) #x00004D7C : (subprimitive _ret1valn)
(#xF0135B60) #x020F1428 : #<Method-Function STREAM-READ-CHAR 
(BUFFERED-CHARACTER-INPUT-STREAM-MIXIN) #x060e82de> + 204
(#xF0135B70) #x020F13BC : #<Method-Function STREAM-READ-CHAR 
(BUFFERED-CHARACTER-INPUT-STREAM-MIXIN) #x060e82de> + 96
(#xF0135B80) #x021168EC : #<Function %NEXT-CHAR-AND-ATTR #x0611c136> + 
88
(#xF0135B90) #x00004D7C : (subprimitive _ret1valn)
(#xF0135BA0) #x02116830 : #<Function %NEXT-NON-WHITESPACE-CHAR-AND-ATTR 
#x0611c096> + 52
(#xF0135BB0) #x02121594 : #<Function %READ-FORM #x0612ad16> + 200
(#xF0135BC0) #x00004D7C : (subprimitive _ret1valn)
(#xF0135BD0) #x02121C68 : #<Function READ #x0612b226> + 212
(#xF0135BE0) #x020F6B1C : #<Method-Function READ-TOPLEVEL-FORM 
(INPUT-STREAM T) #x060f2f9e> + 64
(#xF0135BF0) #x00004D7C : (subprimitive _ret1valn)
(#xF0135C00) #x020CA304 : #<Function 
%%BEFORE-AND-AFTER-COMBINED-METHOD-DCODE #x0609bea6> + 616
(#xF0135C10) #x00004D7C : (subprimitive _ret1valn)
(#xF0135C20) #x020CAAA8 : #<Function %%STANDARD-COMBINED-METHOD-DCODE 
#x0609c516> + 148
(#xF0135C30) #x00004D7C : (subprimitive _ret1valn)
(#xF0135C40) #x00004CE0 : (subprimitive _nvalret)
(#xF0135C50) #x00004D7C : (subprimitive _ret1valn)
(#xF0135C60) #x0211D968 : #<Function READ-LOOP #x0612635e> + 684
(#xF0135C70) #x0211DA40 : #<Function READ-LOOP #x0612635e> + 900
(#xF0135C80) #x0211DA6C : #<Function READ-LOOP #x0612635e> + 944
(#xF0135C90) #x0211DA98 : #<Function READ-LOOP #x0612635e> + 988
(#xF0135CA0) #x0211E7C8 : #<Function TOPLEVEL-LOOP #x061276f6> + 44
(#xF0135CB0) #x0211E7D0 : #<Function TOPLEVEL-LOOP #x061276f6> + 52
(#xF0135CC0) #x0210F710 : #<Anonymous Function #x06113026> + 68
(#xF0135CD0) #x00004D7C : (subprimitive _ret1valn)
(#xF0135CE0) #x0213599C : #<Anonymous Function #x06152c46> + 592
(#xF0135CF0) #x0213579C : #<Anonymous Function #x06152c46> + 80
(#xF0135D00) #x0210DB54 : #<Function RUN-PROCESS-INITIAL-FORM 
#x0610ea36> + 400
(#xF0135D10) #x0210DB90 : #<Function RUN-PROCESS-INITIAL-FORM 
#x0610ea36> + 460
(#xF0135D20) #x0210DCA4 : #<Function RUN-PROCESS-INITIAL-FORM 
#x0610ea36> + 736
(#xF0135D30) #x00004D7C : (subprimitive _ret1valn)
(#xF0135D40) #x0210DE24 : #<Anonymous Function #x0610eb6e> + 152
(#xF0135D50) #x0210DE0C : #<Anonymous Function #x0610eb6e> + 128
(#xF0135D60) #x02103348 : #<Anonymous Function #x0610293e> + 172
(#xF0135D70) #x0000883C : (subprimitive toplevel_loop)
(#xF0135D80) #x00008848 : (subprimitive toplevel_loop)
(#xf0135d90) #x00008914 : _start_lisp + 180
(#xf0135e50) #x0001A870 : _lisp_thread_entry + 224
(#xf0135eb0) #x900247E8 : __pthread_body + 40
(#xf0135f00) #x00000000 : (null) + 0
[731] OpenMCL kernel debugger: [731] OpenMCL kernel debugger: (K)
[731] OpenMCL kernel debugger: Killed

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 10007 bytes
Desc: not available
URL: <http://lists.clozure.com/pipermail/openmcl-devel/attachments/20050305/b34d1174/attachment.bin>


More information about the Openmcl-devel mailing list