Jump to content

Continuous 'Virtual Memory' crashes?


Recommended Posts

In cutting and pasting various examples to play/learn in the demo, I keep having full on crashes of Opusmodus. Here is one partial example:

 

Process:         dx86cl64 [23214]
Path:            /Applications/Opusmodus.app/Contents/MacOS/dx86cl64
Identifier:      com.opusmodus.Opusmodus
Version:         1.2.22559M (???)
Code Type:       X86-64 (Native)
Parent Process:  launchd [203]
Responsible:     dx86cl64 [23214]
User ID:         501

Date/Time:       2017-11-06 16:44:45.541 -0800
OS Version:      Mac OS X 10.9.5 (13F1911)
Report Version:  11
Anonymous UUID:  39614AC9-7EC1-8B08-095E-FBB03C0F32A2

Sleep/Wake UUID: 0B42E315-D1F9-46AB-99C0-4038549CFD6A

Crashed Thread:  13

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x000000002d415ff8

VM Regions Near 0x2d415ff8:
    dylib (reserved)       000000002cb20000-000000002d415000 [ 9172K] rw-/rwx SM=NUL  reserved VM address space (unallocated)
--> shared memory          000000002d415000-000000002d416000 [    4K] r-x/rwx SM=ZER  
    VM_ALLOCATE            000000002d416000-000000002d630000 [ 2152K] rwx/rwx SM=COW  

 

Here is the score that causes it:

 

(setf pitches (gen-repeat 1024 '(c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3)))

(setf transposed-pitches (gen-repeat 5 (pitch-transpose -12 pitches)))

(setf lengthsa (span pitches (gen-length-cartesian 1 1 'm 'n 4 '(2 3) '(13 4) '(1 2 3 4 5 6))))

(setf lengthsb (span pitches (gen-length-cartesian 1 1 'm 'n 4 '(2 3) '(13 4) '(6 5 4 3 2 1))))

(setf lengths-rests1 (length-weight lengthsa :weight '(3 1) :seed 1))

(setf lengths-rests2 (length-weight lengthsb :weight '(5 1) :seed 2))

(setf pitches-rgrade (gen-retrograde pitches))

 

 

 

(setf piano-righthand

      (make-omn

       :length lengths-rests1

       :pitch pitches-rgrade

       :velocity'(mf mp)))

 

(setf piano-lefthand

      (make-omn

       :length lengths-rests2

       :pitch transposed-pitches

       :velocity '(mp mf f)))

 

(setf timesigs (get-time-signature lengths-rests1))

 

(def-score Stage-4

           (:key-signature 'chromatic

            :time-signature '(5 8)

            :tempo 128

            :layout (piano-layout 'piano-rh 'piano-lh))

  

  (piano-rh

   :omn piano-righthand

   :channel 1

   :sound 'gm

   :program 'acoustic-grand-piano)

  

  (piano-lh

   :omn piano-lefthand)

 

When I 'Evaluate All' for above, I get (excerpted for pertinent step):

 

2 > make-omn

2 > make-omn

> Error: Stack overflow on value stack.

> While executing: (:internal f flatten), in process Listener-1(5).

 

If I try changing parameters (like either the lefthand velocity count or the 'even/odd' nature of the 'gen-repeat' value) and 'Evaluate All' again, then I get a full app quit with the crash report at top of this post.

 

If I restart Opusmodus I can variously change the 'gen-repeat' integer to 256 (always successful with all other code exactly the same) and only sometimes 512 (if done immediately after a fresh start) to finally be able to 'Evaluate and Display MIDI' and thus export MIDI. I was trying to get a overall longer 'master' file for later variations in editing the MIDI, but it seems my thinking of just doubling this gen-repeat number would work? Also, many of my attempts to change the numbers involved 'gen-length-cartesian' lines also cause these 'VM errors?? 

 

I am really just trying things out at tis point (these are really 'scratch/throwaway files just to test possible workflows), so no ONE instance of inserting an inappropriate variable range concerns me, but having this 'VM' type of crash over many DIFFERENT functions and files seems like there is something going on where memory allocation is not functioning correctly? In other words, over different scores and functions I am continually crashing and seeing references to VM allocation in the resulting crash report. Is this what should happen (I would expect an error in 'Listener', not a full crash)?? I have 16 gigs RAM and over 100 GB free system disk.

 

Full crash reports can be sent if you provide a desired/proper address that you would like me to use. 

 

Thanks in advance

Link to comment
Share on other sites

Where did you found the score?

All Opusmodus examples (scores, tutorial) should work without any crash.

 

No wonder you have crashes, in the example above you create 1000's of notes in one bar.
I would start with short scores first to understand how all is working together.

 

Spanning length to pitch as it is in your example brake the lengths to unfinished tuplets, the rewrite will crash, naturally :-)
I suggest to create more lengths bars first.

 

Example:

(setf size (gen-repeat 12 '(13 4)))

(setf lengthsa (gen-length-cartesian 1 1 'm 'n 4 '(2 3) size '(1 2 3 4 5 6)))
(setf lengthsb (gen-length-cartesian 1 1 'm 'n 4 '(2 3) size '(6 5 4 3 2 1)))

(setf pitches (gen-repeat 24 '(c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3)))
(setf transposed-pitches (pitch-transpose -12 pitches))

(setf lengths-rests1 (length-weight lengthsa :weight '(3 1) :seed 1))
(setf lengths-rests2 (length-weight lengthsb :weight '(5 1) :seed 2))

(setf pitches-rgrade (gen-retrograde pitches))

(setf piano-righthand
      (make-omn
       :length lengths-rests1
       :pitch pitches-rgrade
       :velocity'(mf mp)))
 
(setf piano-lefthand
      (make-omn
       :length lengths-rests2
       :pitch transposed-pitches
       :velocity '(mp mf f)))

(setf time-sig (get-time-signature piano-righthand))
 
(def-score Stage-4
           (:key-signature 'chromatic
            :time-signature time-sig
            :tempo 128
            :layout (piano-layout 'piano-rh 'piano-lh))
  
  (piano-rh
   :omn piano-righthand
   :channel 1
   :sound 'gm
   :program 'acoustic-grand-piano)
  
  (piano-lh
   :omn piano-lefthand)
)


GEN-REPEAT
see the difference:

(gen-repeat 3 '(c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3))
=> (c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3 c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3 c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3)


(gen-repeat 3 (list '(c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3)))
=> ((c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3)
    (c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3)
    (c3 cs3 d3 ds3 e3 f3 fs3 g3 gs3 a3 as3 b3))

 

 

Link to comment
Share on other sites

Thank you for verifying 'pilot error' as being the issue...obviously I am in over my head and missing some real basics then, I will slow down and try and fill in the gaps to how things really work before bothering you with anymore silly questions (I am only on day five of my demo FWIW ;-))

 

Truth is I got excited by seeing some of the possibilities and couldn't wait to try out some of the more advanced (for me) features,  but obviously need to get more basics under my belt first and try to keep the notes under a hundred per measure then lol

 

Thank you for your correction and example, and of course your patience :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy