Max5 crashes on save

T Bruce's icon

I've had this problem for years with a VERY large (74Mb) patch that I use for live performance. It has built up over the years as I add things, The patch definitely pushes the limits of what my dual core Mac mini can handle, but in approx 10 years of playing it has never crashed during a performance, only during editing.

It only happens when saving after doing more than 2 or 3 edits (4 or 5 if I'm lucky). It doesn't seem to matter what kind of edits, just the number. I've gotten into the habit of saving after every edit, and restarting Max after 2 or 3. I get busted pretty often. I never lose data.

OS X 10.10.5
Mac mini Server
i7 dual 2GHz
RAM 16Gb

I have a crash log. Doesn't seem to attach here.

Thanks, T Bruce

T Bruce's icon

Here's the text from the top of the log. Please excuse my ignorance, but I couldn't get the ".crash" file to attach.

Process: MaxMSP [630]
Path: /Applications/Max5/MaxMSP.app/Contents/MacOS/MaxMSP
Identifier: com.cycling74.MaxMSP
Version: 5.1.9 [48561] (5.1.9)
Code Type: X86 (Native)
Parent Process: ??? [1]
Responsible: MaxMSP [630]
User ID: 502

Date/Time: 2018-02-17 22:31:32.575 -0600
OS Version: Mac OS X 10.10.5 (14F1909)
Report Version: 11
Anonymous UUID: 3BDC594C-558A-DD28-7CBE-49BC08E72B08

Time Awake Since Boot: 4700 seconds

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000fd152000

VM Regions Near 0xfd152000:
MALLOC_LARGE 00000000f9f65000-00000000fd152000 [ 49.9M] rw-/rwx SM=PRV
-->
Submap 00000000ffff0000-00000000ffff1000 [ 4K] r--/r-- SM=PRV process-only VM submap

T Bruce's icon

Clarification. I DO lose the most current data I am trying to save. The previous file save is fine, and I never get a corrupted file.

Source Audio's icon

At first look one would say that You have memory access problem,
that could be RAM or virtual memory access.
But it is very difficult to trace the problem.
SIGSEGV is segment violation, can be caused by app
accessing memory other than what was allocated to it by the operating system.
I would try step by step, starting from hard disk check
with proper SMART report tool, scan for bad blocks and all the rest.
Then real RAM test etc to make sure that none of the above
is the source of the problem.
But if HD or RAM were the problem, You would experience Crashes
also when using other apps than Max.
Next would be, checking Max side - deleting Preferences
checking exec rights, and of course the patch.
Sometimes patches of that size get corrupt.
What is so big inside to make 75 MB ?
Embedded graphics or so ?
And how about 3rd party externals which might have memory leak ?
Do You have opportunity to try Your to edit this patch
on another Mac ?


Source Audio's icon

Another thing - max 5 introduced multiple level of undo,
which means every edit You do makes some kind of copy
to be able to step back.It seems that You exceed some limits
on Your system when having more than 1 or 2 edits in undo
history.

T Bruce's icon

Thanks so much for the very thorough answers and questions.

I think these issues ones are the most likely

1) "75 MB ? Embedded graphics or so ? " - Very likely.
Is there a way to determine the amount of patch file space dedicated to graphics? I know I have saved graphics in sub patches (control panel skins and such). I believe there is a way for the patch to read the graphic from a separate file. Would this reduce the main patch size?
2) "Another thing - max 5 introduced multiple level of undo" - Also something I have been thinking about. Is there a way to purge undo memory before a save?

The following issues (and questions) would seem likely to cause a lot of other problems than the one I am experiencing, so I will pursue them only if the first group yields no results.

1) "hard disk check with proper SMART report tool" What app would I use for this?
2) "real RAM test" I can do both of these using Apple tools, but you seem to be suggesting something stronger or more sophisticated.
3) I looked through Max preferences and don't see anything mentioning "deleting preferences". so I'm not sure what you are suggesting there.
4) Also not sure exactly what you mean by "exec rights, and of course the patch"

T Bruce's icon

I offloaded a bunch of panel skin fpic files, and brought it down to 69 Mb from 74. There may be more, but I think most of the patch file is serious DSP, like pitch detection, reverb, compression and EQ. There a lot of them.

I'm thinking the only possible solution is to purge the undo cache before save, but I don't see anything in the "messages to Max" messages to do that, and nothing in the UI Edit menu.

Or, possibly seeing if someone can dig real deep and see why Max 5 is addressing illegal addresses.

T Bruce's icon

FYI, the crash on save is really dependent on the number of edits I've done. I can paste in a subpatcher with some fairly serious DSP demands (one edit step), and save afterward with no problem. Then I can do 10 simple patch cord edits in the Max environment (no DSP) and have a crash on save.

Source Audio's icon

Here are few answers :
1- deleting max 5 preferences - just trash the whole folder
"Max 5 Preferences Folder" which is in user Library/Preferences folder.
That would help if crashes are related to prefs corruption.
2- checking if anything is wrong with HD & RAM
I use driveDX to check SMART Status of the HD, there are probably other tools
memtest should do for testing RAM
at the end scanning for bad blocks on HD - I use Drive Genius for that.
All above would just make sure that RAM & HD where temp files get written
etc is healthy and not causing the trouble.
- exec rights - system permissions can sometimes become corrupt
and prevent some apps or similar to write to certain places, like private/var/folders
and the like.
You could check if Max has proper exec rights by droping it onto terminal
after typing ls -l (space at end)
example on my MacBook :
Mac$ ls -l /Users/Mac/Desktop/Max\ 519/MaxMSP.app
total 0
drwxrwxrwx 7 Mac staff 238 Jul 5 2014 Contents
Outputs states that Max is owned by Mac (user account), group staff and
that all have read, write and exec rights rwx

-----------
Next would be checking Max and the patch.
If the crashes happen only when that particular patch gets saved,
something could be wrong with it, or some external that causes problem.
I would try that patch on some other computer and also maybe
other version of Max ?
I'd really like to help You more, but without having that patch
it is just guessing and listing possible causes.


T Bruce's icon

OK, it turns out to be pretty simple, at least with Max 5. It can not save a 74 Mb patch dependably. I broke out one 41 Mb sub patch, saved it separately, and all my crash on saves have disappeared. Now I need to work out how to reconnect all of the data and audio between them.

Thanks, everyone, for your help,