Page 1 of 1

Some applications crash on a sparsebundle disk image?

Posted: Mon Jul 23, 2018 2:09 am
by emendelson
Following a suggestion here a few weeks ago about using the sparsebundle format for SheepShaver disk images, I replaced the disk image in one of my projects with a sparsebundle - and then found (as I had discovered earlier but had forgotten) that some programs crash when run from a sparsebundle disk image, so I've had to go back to the old .dsk/.img format.

The program that caused a crash in my project was the macps2pdf script in the MacGhostView32 application. SheepShaver crashed even when i compiled an AppleScript that ran macps2pdf. it doesn't cause any problems on a traditional disk image.

I have no idea why this should happen, but I remember that I encountered similar problems when I first tried using sparsebundles in my projects some years ago. I don't remember the exact detail, but I remember going back to the standard disk image, as I did just now.

Probably no one else will have this kind of problem, but I thought it was worthwhile to post a message about it.

Re: Some applications crash on a sparsebundle disk image?

Posted: Tue Jul 31, 2018 9:39 pm
by adespoton
Thanks; I'll keep an eye on it. I had similar issues years ago when sparsebundle support was first added, but did something to fix it at some later date, and I'm not sure what that was now. It's possibly that I modified my bundles to have 1MB files instead of the default 8MB, or it could be something else.

Re: Some applications crash on a sparsebundle disk image?

Posted: Wed Aug 01, 2018 11:33 am
by emendelson
If you remember what you did to fix it, please let us know.

Re: Some applications crash on a sparsebundle disk image?

Posted: Wed Aug 01, 2018 2:55 pm
by mabam
When I tried a few years ago, I wasn't even able to install OS 9 in SheepShaver using a sparsebundle image. Would indeed be great to know how to fix this.

Re: Some applications crash on a sparsebundle disk image?

Posted: Wed Aug 01, 2018 7:38 pm
by Ronald P. Regensburg
I vaguely remember that that the initial assigned size of the sparsebundle image mattered. There must be an old discussion about that somewhere in the forum.

Re: Some applications crash on a sparsebundle disk image?

Posted: Wed Aug 01, 2018 10:08 pm
by emendelson
Couldn't find anything in old messages after a quick search, but I may not have looked deeply enough.

Re: Some applications crash on a sparsebundle disk image?

Posted: Wed Aug 01, 2018 10:14 pm
by adespoton
I think it may not have been on the forum; we may have been discussing it directly with Vasi or on the mail list.

Re: Some applications crash on a sparsebundle disk image?

Posted: Thu Aug 02, 2018 4:12 am
by adespoton
Here's the script I use to prep my images as sparsebundles:

Code: Select all

#!/bin/sh

echo $1
hdiutil convert "$1" -format UDSB -tgtimagekey sparse-band-size=2048 -o "$1-1Mb.sparsebundle"
I use this on a regular 2GB disk image after installing 9.0.4.

Re: Some applications crash on a sparsebundle disk image?

Posted: Thu Aug 02, 2018 12:54 pm
by emendelson
adespoton wrote:Here's the script I use to prep my images as sparsebundles:

Code: Select all

#!/bin/sh

echo $1
hdiutil convert "$1" -format UDSB -tgtimagekey sparse-band-size=2048 -o "$1-1Mb.sparsebundle"
That seems to work! Thank you! It's good to have it on record here for future reference. The macpcl2pdf app doesn't crash the system now.

Re: Some applications crash on a sparsebundle disk image?

Posted: Thu Aug 16, 2018 6:32 am
by emendelson
And here is an AppleScript wrapper for adespoton's script that includes error handling:

Code: Select all

on open theDrop
	repeat with thisItem in theDrop
		set thisPath to POSIX path of thisItem
		set outPath to thisPath & "-1Mb.sparsebundle"
		try
			do shell script "hdiutil convert" & space & quoted form of thisPath & space & "-format UDSB -tgtimagekey sparse-band-size=2048 -o" & space & quoted form of outPath
		on error err
			if err contains "recognized" then
				display dialog "Please change the extension of the disk image to .img and try again." buttons {"OK"}
			end if
		end try
	end repeat
end open
Certainly adespoton can improve on this but it seems to work.

Re: Some applications crash on a sparsebundle disk image?

Posted: Thu Aug 16, 2018 4:27 pm
by adespoton
I'll add the git repo to this thread too:

https://github.com/adespoton/sparserbundler

Re: Some applications crash on a sparsebundle disk image?

Posted: Fri Aug 17, 2018 7:31 am
by emendelson
adespoton wrote:I'll add the git repo to this thread too:

https://github.com/adespoton/sparserbundler
Could you check the 7z file in the repository? I can't extract it either on Windows (with 7-Zip) or macOS (with BetterZip). And various other programs say the file is invalid.

Re: Some applications crash on a sparsebundle disk image?

Posted: Fri Aug 17, 2018 4:03 pm
by adespoton
Hmm; I'll check it over the next couple of days; it's possible the upload never completed correctly (the original decompresses for me with Keka and The Unarchiver).

Re: Some applications crash on a sparsebundle disk image?

Posted: Fri Aug 17, 2018 9:53 pm
by emendelson
Slightly improved code for the AppleScript wrapper (and, for anyone doing this for the first time, you must save it in the File Format "Application" (not "Script"):

Code: Select all

on open theDrop
	repeat with thisItem in theDrop
		set thisPath to POSIX path of thisItem
		set outPath to thisPath & "-1Mb.sparsebundle"
		try
			do shell script "hdiutil convert" & space & quoted form of thisPath & space & "-format UDSB -tgtimagekey sparse-band-size=2048 -o" & space & quoted form of outPath
		on error err
			if err contains "recognized" then
				display dialog "Please change the extension of the disk image to .img and try again." buttons {"OK"}
			else
				display dialog "Error:" & space & err buttons {"OK"}
			end if
		end try
	end repeat
end open

Re: Some applications crash on a sparsebundle disk image?

Posted: Sat Aug 18, 2018 7:51 pm
by adespoton
Github repo fixed; somehow I pushed the alias instead of the archive. It should be accessible now.