[CM] fun with CM + Linux

Dave Phillips dlphilp@bright.net
Mon, 09 Dec 2002 08:00:39 -0500

Bill Schottstaedt wrote:
> It might be significant that the segfault happens at:
>                        #.(SYSTEM:INT-SAP #x3FFFEAE0))
> This is in CMUCL, and is called only in ffi.lisp when I'm trying to
> pass an array from Lisp to C (or vice versa?). But that doesn't happen
> at all in start-snd!  In the best of all worlds, you'd be able to run
> cmucl under gdb, fall into gdb upon the segfault, then look at the
> stack and locals to see what has gone awry (there's an example in
> clm.html), but that trick rarely works in cmucl -- you'll just see a
> bunch of question marks or completely bogus entries.

Hi Bill:

  I tried a suggestion from Rick that works perfectly, and I think it
might narrow down the problem source.

  I did the following:

	1. I commented out the 'save'cm' lines from cm.lisp as per Rick's
	2. I load CLM, CMN, CM, in that order, without quitting between.
	3. Then I add this stuffL

		in-package :cm)

		(set-midi-output-hook! #'oss-play-midi-file)

		(defun cmn-load (file &rest args)
		   (load file))
		(set-cmn-output-hook! #'cmn-load)

		(setf *readtable* *cm-readtable*)

	4. At this point everything works flawlessly: CLM .ins files
compile/load/play correctly with with-sound or with-psound, CMN .cmn
files load and display correctly, and the various CM examples work.
	5. I can now load the CLM/CMN/CM fast-load files (again in that order),
add in the stuff from step #3 again, and again everything works fine.

  So the problem appears only when I save everything in the cm.core
image. Rick suggested that it shouldn't be too hard to debug from there,
but I'm truly a novice at debugging Lisp apps. I'll try your method
today and see what I come up with.

  Btw, the combined environment of CLM/CMN/CM/Snd just rocks ! Today
I'll try adding a flag to the TiMidity call (in CM's midi2.lisp and
midi2.scm) that will output a WAV file as well as producing the realtime
audio rendering. That way I can call Snd and load the new file into it
via Lisp. I know it's a kludgy approach, I just want to see if I can do
it. :)

Best regards,

== Dave Phillips

	The Book Of Linux Music & Sound at http://www.nostarch.com/lms.htm
	The Linux Soundapps Site at http://linux-sound.org