[comp.sys.mac.programmer] LSC bizarre problem: SndPlay

ted@hpwrce.HP.COM ( Ted Johnson) (03/31/89)

I'm having a really bizarre problem.  The following 10 line LSC 2.13
program used to work fine, under System/Finder 4.1/5.5 and
                                 System/Finder 4.2/6.0

but now it blows up with ID = 12 (which I.M. II-364 says 
means "Unimplemented core routine: An unimplemented trap number encountered").
on 4.2/6.0.

Anyone have any clues?

#include <all the right stuff...>

main()
{
Handle SoundH;

	SoundH = GetResource('snd ', 4);/*the monkey screech*/
	if (soundH) {
		SndPlay(0L, SoundH, 1);
	}
	else {
		SysBeep(10);
	}
}


***As far as I can tell, NOTHING HAS CHANGED (famous last words, no?)
   with the 4.2/6.0 boot disk since this program used to work....

BTW, if I change the GetResource call to this line:

	GetNamedResource('snd ', "\pMonkey");, then it blows up with ID=12
 
on both System/Finder's.

Also, I tried initializing all of the managers before calling GetResource(),
but it didn't help.

Any and all help would be GREATLY APPRECIATED!!!

Thanks!

-Ted

P.S. This is on an SE HD20.

ted@hpwrce.HP.COM ( Ted Johnson) (04/04/89)

So far the response to this has been underwhelming.  :-(

Maybe I should ask a simpler question:  

	HAS ANYONE EVER GOT A CRASH WITH ID=12?

	If so, do you know what caused it...?

-Ted

billkatt@sol.engin.umich.edu (billkatt) (04/05/89)

In article <7430011@hpwrce.HP.COM> ted@hpwrce.HP.COM ( Ted Johnson) writes:
>
>I'm having a really bizarre problem.  The following 10 line LSC 2.13
>program used to work fine, under System/Finder 4.1/5.5 and
>                                 System/Finder 4.2/6.0
>
>but now it blows up with ID = 12 (which I.M. II-364 says 
>means "Unimplemented core routine: An unimplemented trap number encountered").
>on 4.2/6.0.
>
>Any and all help would be GREATLY APPRECIATED!!!
>
>Thanks!
>
>-Ted
>
>P.S. This is on an SE HD20.

The Sound Manager doesn't work on an SE with System 4.2 or System 4.1.  It
only works with System 6.0 or higher, or on a Mac II with any system.

-Steve Bollinger

bob@accuvax.nwu.edu (Bob Hablutzel) (04/06/89)

> So far the response to this has been underwhelming.  :-(
> Maybe I should ask a simpler question:  
>	HAS ANYONE EVER GOT A CRASH WITH ID=12?
>	If so, do you know what caused it...?

 An ID=12 is an unimplemented trap bomb. It can also be caused by
calls to the debugger when no debugger has been installed.

Bob Hablutzel	Wildwood Software	BOB@NUACC.ACNS.NWU.EDU

alexis@ccnysci.UUCP (Alexis Rosen) (04/14/89)

In article <7430012@hpwrce.HP.COM> ted@hpwrce.HP.COM ( Ted Johnson) writes:
>
>So far the response to this has been underwhelming.  :-(
>Maybe I should ask a simpler question:  
>
>	HAS ANYONE EVER GOT A CRASH WITH ID=12?
>
>	If so, do you know what caused it...?

ID 12 is supposed to be an "unimplemented core routine."

While I don't know what Apple might have meant by that, I have in fact seen
this error quite recently, in a Beta version of Liason. It was being used
for debugging purposes, but I don't know how or why. My guess (which is
probably wrong) is that while debugging, the author kept some stuff in the
system which is not normally around. He forgot to take these debugging
calls out of the Beta release, and so we got the bombs. Perhaps something
similar is happening to you.

BTW, that Liason bug is dead as a doornail. The shipping version looks quite
clean.

---
Alexis Rosen
alexis@ccnysci.{uucp,bitnet}

lsr@Apple.COM (Larry Rosenstein) (04/15/89)

In article <1579@ccnysci.UUCP> alexis@ccnysci.UUCP (Alexis Rosen) writes:
> While I don't know what Apple might have meant by that, I have in fact 
seen
> this error quite recently, in a Beta version of Liason. It was being used
> for debugging purposes, but I don't know how or why. My guess (which is

These are probably caused by calls to Debugger(), which are intended to 
enter Macsbug and (optionally) print a message.  The traps for doing this
are unimplemented, and will give an ID=12 error if a debugger is not
installed.

Larry Rosenstein, Apple Computer, Inc.
Object Specialist

Internet: lsr@Apple.com   UUCP: {nsc, sun}!apple!lsr
AppleLink: Rosenstein1

darin@Apple.COM (Darin Adler) (04/20/89)

In article <1579@ccnysci.UUCP> alexis@ccnysci.UUCP (Alexis Rosen) writes:
> In article <7430012@hpwrce.HP.COM> ted@hpwrce.HP.COM ( Ted Johnson) writes:
> >So far the response to this has been underwhelming.  :-(
> >Maybe I should ask a simpler question:  
> >
> >	HAS ANYONE EVER GOT A CRASH WITH ID=12?
> 
> ID 12 is supposed to be an "unimplemented core routine."

ID 12 is the system error you get when a trap call is made which is undefined
in the current ROM/System combination. Many unused traps point to a common
routine which generates this system error.

The most common reason to see the ID 12 error is that an application has calls
to the Debugger or DebugStr traps. These are only implemented when there is
a debugger installed (MacsBug, TMON, Jasik's, etc.), and cause this error,
otherwise.
-- 
Darin Adler, System Software Scapegoat, Apple Computer
	Internet: darin@Apple.com
	UUCP: {nsc,sun}!apple!darin