My new 26 July 2020 build crashes often at shut down

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

My new 26 July 2020 build crashes often at shut down

Post by Ronald P. Regensburg »

My new 26 July 2020 build crashes often at shut down. About half the times I shut down the emulator it crashes instead of shutting down. This is on my iMac with macOS 10.15.6 (Catalina).
Does it happen only here or see others the same issue with this build?
Last edited by Ronald P. Regensburg on Mon Jul 27, 2020 12:16 pm, edited 2 times in total.
Reason:  
Elyus
Tinkerer
Posts: 94
Joined: Wed Mar 21, 2012 12:35 am

Re: My new 26 July 2020 build crashes often at shut down

Post by Elyus »

I'm not able to reproduce it here on Mojave, 10.14.6. Are there any particular steps or settings you've noticed that lead to the crash or does it seem random?

In my PR, thanks to kanjitalk's prompting, I fixed a couple optimization bugs to make release builds more stable. They've all been resolved as far as I know, but maybe there's something Catalina-specific with optimization: if you try a debug build, is there no crashing?

I'll try to do some testing in Catalina later and see if I can reproduce it.

On an unrelated but interesting note, I saw that VMWare is having issues with 10.15.6. Of course, Sheep's problem isn't with virtualization, although I wonder the extent of the bug they found with sandboxing.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: My new 26 July 2020 build crashes often at shut down

Post by Ronald P. Regensburg »

The crashes are random. They happen often but not always when you shut down the emulator.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: My new 26 July 2020 build crashes often at shut down

Post by emendelson »

This doesn't happen here. You might try my build (different icon, but otherwise ordinary code, I think), in the SheepShaver Wrapper:

http://www.columbia.edu/~em36/sheepshaverwrapper.html

Extract SheepShaver from inside the wrapper (it's in the Files folder) and give it a try.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: My new 26 July 2020 build crashes often at shut down

Post by Ronald P. Regensburg »

Your SheepShaver build crashes here often at shut down just the same.

None of my previous builds have this issue, it is only my latest (26 July) build (and this 25 July build by you).

Do you also run macOS 10.15.6 ?

How does my build behave on your side?
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: My new 26 July 2020 build crashes often at shut down

Post by emendelson »

I put your build into my SheepShaver Wrapper (with ROM and OS 9) and ran it five times. It never crashed on shutdown. Yes, running 10.15.6.

Perhaps something is wrong with your disk system or settings? Have you tried (1) replacing your build with an earlier build to see if you still get the crashes and (2) replacing the settings and disk image with known-good settings and disk image?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: My new 26 July 2020 build crashes often at shut down

Post by Ronald P. Regensburg »

My settings are as they have been for a long time. I once made a copy of the prefs file and after experimenting with settings I simply copy the content of that copy and paste it back to the actual prefs file.

I used Time Machine to get the HD image as it was a year ago.
I replaced my shared folder.
I restarted the host.
Makes no difference

i tried each of my previous 8 builds since april 2019. None of them have this issue.

The crash does not happen always, but often enough to be disturbing. It happens with any way one can shut down the emulator:

With the emulator running:
- Choose Shut down from the Special menu in the Finder (in both window mode and full screen mode)
- Close SheepShaver window and choose Shut Down from the dialog
- Quit SheepShaver and choose Shut Down from the dialog
- "Save and Quit" in preferences and choose Shut Down from the dialog
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: My new 26 July 2020 build crashes often at shut down

Post by emendelson »

I tried all those shutdown methods with your build in my SheepShaver Wrapper, and got no crashes at all. This is very strange, and I wish I had a better answer.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: My new 26 July 2020 build crashes often at shut down

Post by kanjitalk755 »

Ronald P. Regensburg wrote:i tried each of my previous 8 builds since april 2019. None of them have this issue.
Which commit is the most recent non-crash build?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: My new 26 July 2020 build crashes often at shut down

Post by Ronald P. Regensburg »

I did not build after each commit. My previous build was 15 March 2020 (with etherhelper support).
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: My new 26 July 2020 build crashes often at shut down

Post by kanjitalk755 »

To isolate the issue, I made a branch without the bin/cue support.

https://github.com/kanjitalk755/macemu/ ... _wo_bincue

Will this crash?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: My new 26 July 2020 build crashes often at shut down

Post by Ronald P. Regensburg »

I cannot make it crash with 25+ attempts.
Yesterdays build again crashes twice with only five attempts.
Elyus
Tinkerer
Posts: 94
Joined: Wed Mar 21, 2012 12:35 am

Re: My new 26 July 2020 build crashes often at shut down

Post by Elyus »

I'm glad it's been isolated to something that came in with bin/cue support; that's at least some direction, but I'll keep trying to reproduce it and see if there's some small fix that can be put in.

Do you get any output in the Console after the crash or a crash report?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: My new 26 July 2020 build crashes often at shut down

Post by Ronald P. Regensburg »

Typical crash report: https://www.emaculation.com/sheepshaver ... report.txt

Edit: "Ignore Illegal Memory Accesses" is enabled

Code: Select all

ignoresegv true
Last edited by Ronald P. Regensburg on Wed Jul 29, 2020 3:21 pm, edited 1 time in total.
Reason:  
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: My new 26 July 2020 build crashes often at shut down

Post by Ronald P. Regensburg »

Apparently no one else experienced the crash at shutdown issue so far.

To exclude the possibility that it is somehow related to the user account on my Mac, I created a fresh new user account and set up SheepShaver there.

The 29 July build without bin/cue does not crash at shutdown.
The 26 July build crashed at first attempt.

So the issue is not related to the user account.
Elyus
Tinkerer
Posts: 94
Joined: Wed Mar 21, 2012 12:35 am

Re: My new 26 July 2020 build crashes often at shut down

Post by Elyus »

From the crash log, it's the sys_unix bindings for getting CD volume that caused the crash.

Which OS version do you use? Do you have any CD ROMs mounted, either as disk, cdrom, or bincues? It's odd that there's a call to get CD audio volume when the system is shutting down.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: My new 26 July 2020 build crashes often at shut down

Post by Ronald P. Regensburg »

- Late 2013 iMac running macOS 10.15.6 (Catalina).
- No CDs of any kind mounted, not even a CD/DVD player connected to the Mac
- Also no CD image files mounted, not on the host and not in SheepShaver.

The crash happens with only my (Fusion drive) "HD" volume* mounted on the host Mac and with only the MacOS 9.0.4 boot image and the "Unix' drive (shared folder) mounted in SheepShaver.

* In Catalina the startup drive consists several partitions, hidden to the user.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: My new 26 July 2020 build crashes often at shut down

Post by Ronald P. Regensburg »

Well, we come closer.

In the prefs file is a line

Code: Select all

cdrom /dev/poll/cdrom
If I remove that line, there is no crash
However, each time settings in SheepShaver preferences ar saved, that line is written back.

There is also the line

Code: Select all

nocdrom false
If this line ie replaced by

Code: Select all

nocdrom true
there is also no crash
The setting is changed from false to true by selecting "Disable CD-ROM" in SheepShaver preferences.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: My new 26 July 2020 build crashes often at shut down

Post by Ronald P. Regensburg »

Thought:

As the current SheepShaver for macOS builds are intended for macOS versions in which SheepShaver cannot mount physical CD-ROMs anyway, the line

Code: Select all

cdrom /dev/poll/cdrom
could probably better be removed from the prefs file. (In OSX 10.8 and later.)
Last edited by Ronald P. Regensburg on Sun Aug 02, 2020 10:18 am, edited 1 time in total.
Reason:  
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: My new 26 July 2020 build crashes often at shut down

Post by Ronald P. Regensburg »

Another thought:

Wasn't it so (with pre-OSX 10.8) that a CD that was mounted in BasiliskII or SheepShaver was ejected from the drive when the emulator was shut down?
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: My new 26 July 2020 build crashes often at shut down

Post by kanjitalk755 »

@Elyus
At cdrom.cpp#L541,#L1074:

Code: Select all

info = get_drive_info(last_drive_num);
Here, get_drive_info() may return drives.end() and cause crash.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: My new 26 July 2020 build crashes often at shut down

Post by kanjitalk755 »

I fixed it.

@Ronald
Try latest source.

@Elyus
Make a PR if there is a better fix.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: My new 26 July 2020 build crashes often at shut down

Post by Ronald P. Regensburg »

Crash at shut down is solved. I will post a new build.

BTW: Does bin/cue support also apply to BasiliskII? Then I will also build and post a new BasiliskII build.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: My new 26 July 2020 build crashes often at shut down

Post by kanjitalk755 »

Ronald P. Regensburg wrote:BTW: Does bin/cue support also apply to BasiliskII?
Yes.
Elyus
Tinkerer
Posts: 94
Joined: Wed Mar 21, 2012 12:35 am

Re: My new 26 July 2020 build crashes often at shut down

Post by Elyus »

Thank you for fixing it, kanjitalk! I'm sorry to have added that stability issue :oops:

I tested a couple hours last weekend and was able to reproduce the issue at least once, although without a conclusive fix or PR. In my case, it seemed like finding the available drive num was perhaps the root cause since it returned unexpected values for /dev/poll/cdrom. I think defaulting to the first available drive or returning an error as you've done is quite reasonable.
Post Reply