[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] bug report: code empty in an *at method

I should have been a QE!

TestClass {
classvar <>all;
*at { arg which; ^all[which] }

Add this class to your library, compile, and then do


You'll see:

Code empty.

And then, if you do:


... sclang will crash.

If you change the class to:

TestClass {
classvar <>all;
*at { arg which; 1; ^all[which] }

... then you will see correct bytecodes generated. Looks like methods with only a return but no preceding expressions get "over-optimized."

Here's the console log:

Date/Time: 2004-08-06 22:29:40 -0400
OS Version: 10.2.8 (Build 6R73)
Host: Isabelle.local.

Command: SuperCollider
PID: 13304

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0xbf1b2adb

Thread 0 Crashed:
#0 0x0004502c in Interpret(VMGlobals*) (PyrInterpreter3.cpp:2040)
#1 0x00045070 in Interpret(VMGlobals*) (PyrInterpreter3.cpp:2048)
#2 0x00049a0c in runLibrary (PyrLexer.cpp:2154)
#3 0x000114f8 in -[MyDocument sendSelection:] (MyDocument.M:662)
#4 0x00015d20 in -[SCTextView keyDown:] (SCTextView.M:75)
#5 0x930c1694 in -[NSWindow sendEvent:]
#6 0x930a8e20 in -[NSApplication sendEvent:]
#7 0x930b1dac in -[NSApplication run]
#8 0x9315fc58 in NSApplicationMain
#9 0x00002818 in _start (crt.c:267)
#10 0x0000268c in start

Thread 1:
#0 0x9002560c in recvfrom
#1 0x000783f0 in SC_UdpInPort::Run() (SC_ComPort.cpp:296)
#2 0x90020c28 in _pthread_body

Thread 2:
#0 0x90006a28 in clock_sleep_trap
#1 0x9000672c in nanosleep
#2 0x90006670 in sleep
#3 0x0006bd48 in resyncThread(void*) (PyrSched.cpp:359)
#4 0x90020c28 in _pthread_body

Thread 3:
#0 0x9003e9a8 in semaphore_wait_signal_trap
#1 0x9003e7c4 in _pthread_cond_wait
#2 0x97e34088 in -[NSConditionLock lockWhenCondition:]
#3 0x930819a0 in -[NSUIHeartBeat _heartBeatThread:]
#4 0x97e2cc38 in forkThreadForFunction
#5 0x90020c28 in _pthread_body

Thread 4:
#0 0x9003e9a8 in semaphore_wait_signal_trap
#1 0x9003e7c4 in _pthread_cond_wait
#2 0x0006c7c4 in TempoClock::Run() (PyrSched.cpp:805)
#3 0x90020c28 in _pthread_body

Thread 5:
#0 0x9003e9a8 in semaphore_wait_signal_trap
#1 0x9003e7c4 in _pthread_cond_wait
#2 0x0006bdfc in schedRunFunc(void*) (PyrSched.cpp:384)
#3 0x90020c28 in _pthread_body

PPC Thread State:
srr0: 0x0004502c srr1: 0x0000f030 vrsave: 0x00000000
xer: 0x20000000 lr: 0x00045070 ctr: 0x00044fc8 mq: 0x00000000
r0: 0x0000000b r1: 0xbffff150 r2: 0x02a498d0 r3: 0x00000002
r4: 0x00075b0c r5: 0x00075b0c r6: 0x00000000 r7: 0xbf1b2ac3
r8: 0x0253c708 r9: 0x00000000 r10: 0x0000c300 r11: 0x00001860
r12: 0x02a498d0 r13: 0x00000000 r14: 0x00200000 r15: 0x00000000
r16: 0x00000000 r17: 0x00000000 r18: 0x00000000 r19: 0x00000000
r20: 0x00000000 r21: 0x00000000 r22: 0x00000000 r23: 0x00130000
r24: 0x00040000 r25: 0x00147668 r26: 0x001448ac r27: 0x02534438
r28: 0x02534440 r29: 0x02530408 r30: 0xbf1b2ac3 r31: 0x0431ddac


H. James Harkins /// dewdrop_world

"If attacked by a lion, thrust your arm down his throat.
This takes some practice." -- Cyril Connolly