BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

About BasiliskII, a 68k Mac emulator for Windows, MacOSX, and Linux that can run System 7.x through MacOS 8.1.

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
stankaufman
Space Cadet
Posts: 8
Joined: Thu Dec 28, 2023 12:38 am

BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by stankaufman »

In a BasiliskII installation that worked flawlessly prior to update to latest MacOS Sonoma v14.2.1, BII now crashes at startup with a SIGSEGV error. From the crash log:

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

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xffffffffad16b500
Exception Codes: 0x0000000000000001, 0xffffffffad16b500

Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [47309]
...

The wiki (https://www.emaculation.com/doku.php/ba ... _osx_setup) advises checking the “Ignore Illegal Memory Accesses” setting in the 'System' tab of the GUI app for SIGSEGV errors and making sure that option is selected. It IS so set for the crashing app.

Is this a problem with MacOS 14.2.1? Does a new build need to be done from BasiliskII source?

Many thanks for any pointers!
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by Ronald P. Regensburg »

BasiliskII 10 August 2023 build runs fine here in macOS 14.2.1 (Sonoma), both natively on Apple Silicon and with Rosetta.

Which BasiliskII build do you use?
Does your host run on Intel or on Apple Silicon (M series) processor?
stankaufman
Space Cadet
Posts: 8
Joined: Thu Dec 28, 2023 12:38 am

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by stankaufman »

Thanks for the follow-up.

The BasiliskII build is the latest: SDL2 port, 10 August 2023, universal (x86_64 and arm64) (https://www.emaculation.com/basilisk/Ba ... 230810.zip)

Running an Intel MBP.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by Ronald P. Regensburg »

I only have a M1 Mac, so I cannot try BasiliskII in Sonoma on Intel myself. (Can anyone else here try BasiliskII in macOS 14.2.1 on Intel?)

In the meantime:
1. Did you update Sonoma from 14.2 to 14.2.1 and did BasiliskII run on 14.2?
2. Have you tried restarting your Mac and then try to launch BasiliskII again?
stankaufman
Space Cadet
Posts: 8
Joined: Thu Dec 28, 2023 12:38 am

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by stankaufman »

I went from 13.x straight to 14.2.1 (never risk the first released versions of a major "upgrade"), so I'm afraid I can't answer your first question.

A restart is often just what is needed, but not in this case. Same error; dang.

Thanks again for all your heroic work to keep the old Mac universe running!
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by Ronald P. Regensburg »

Where are your BasiliskII files located?
Did you do the macOS upgrade in place, leaving all your own files untouched?
stankaufman
Space Cadet
Posts: 8
Joined: Thu Dec 28, 2023 12:38 am

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by stankaufman »

Yes, the OS upgrade was done in place -- ie simply through the UI provided in the System Settings.

The BasiliskII files are all within a "Basilisk" folder in the "Documents" folder. Similarly, I've got a "Sheepshaver" folder containing the Sheepshaver app and all related files (for additional hard drives etc) as well as a folder for a variety of Mini vMac VMs, each in its own folder. Sheepshaver and the Mini vMacs all survived the latest MacOS upgrade in fine shape. Only BasiliskII now crashes.

What significance is the mode of MacOS upgrade or the location of the files?

If there is no simple solution to this, I'm going to try compiling BasiliskII from source at GitHub. I was hoping that there might be an easier way forward though.

Thanks again for your help!
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by Ronald P. Regensburg »

Some users keep the files in unusual locations. Not in your case.

I posted a new build from current source. See: viewtopic.php?t=7361
stankaufman
Space Cadet
Posts: 8
Joined: Thu Dec 28, 2023 12:38 am

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by stankaufman »

Thank you again for your prompt help with this!

Unfortunately, the new "SDL2 port, 29 December 2023, universal (x86_64 and arm64)" build you just posted still crashes on boot here:

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

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xffffffffca051b00
Exception Codes: 0x0000000000000001, 0xffffffffca051b00

Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [2854]
...

The GUI app runs just fine, but the BII app itself crashes both when launched via a double-click on the app itself as well as when launched via the "Start" button in the GUI app.

Weird. Any other ideas? Thanks again!
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by Ronald P. Regensburg »

I did not expect the new build to solve your issue as the older build should run fine.

Please post here the content of your prefs file:

Launch Terminal (in /Apps/Utilities/) and type at the prompt

Code: Select all

open ~/.basilisk_ii_prefs
followed by a return.
The file will open in your default text editor. Select all content and copy and paste it here in your reply.
stankaufman
Space Cadet
Posts: 8
Joined: Thu Dec 28, 2023 12:38 am

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by stankaufman »

Thanks again for your tenacity!

I've got two .basilisk_ii_prefs files -- one in the Basilisk folder and one in my root user folder.

Here is ~/.basilisk_ii_prefs:

disk /Users/skaufman/Documents/BasiliskII/SpinyDogfish
disk /Users/skaufman/Documents/BasiliskII/Heads
disk /Users/skaufman/Documents/BasiliskII/Kryton
extfs /Users/skaufman/Documents/BasiliskII/Shared
screen win/1280/800
seriala
serialb
ether slirp
udptunnel false
udpport 6066
rom /Users/skaufman/Documents/BasiliskII/PERFORMA.ROM
bootdrive 0
bootdriver 0
ramsize 536870912
frameskip 0
modelid 14
cpu 4
fpu true
nocdrom false
nosound false
noclipconversion false
nogui false
jit true
jitfpu true
jitdebug false
jitcachesize 8192
jitlazyflush true
jitinline true
keyboardtype 5
keycodes false
keycodefile
mousewheelmode 1
mousewheellines 3
dsp /dev/dsp
mixer /dev/mixer
ignoresegv true
idlewait true

Here is ~/Documents/BasiliskII/basiliskII_ii_prefs:

disk /Users/skaufman/Documents/BasiliskII2/SpinyDogfish
extfs /Users/skaufman/Documents/BasiliskII2/Shared
screen win/1280/800
seriala
serialb
ether slirp
udptunnel false
udpport 6066
rom /Users/skaufman/Documents/BasiliskII2/PERFORMA.ROM
bootdrive 0
bootdriver 0
ramsize 268435456
frameskip 0
modelid 14
cpu 4
fpu true
nocdrom false
nosound false
noclipconversion false
nogui false
jit true
jitfpu true
jitdebug false
jitcachesize 8192
jitlazyflush true
jitinline true
keyboardtype 5
keycodes false
mousewheelmode 1
mousewheellines 3
dsp /dev/dsp
mixer /dev/mixer
ignoresegv true
idlewait true

Turns out they are not identical, and I have no notion how or why -- other than perhaps several installs as I migrated the app from one machine to another, and maybe BII stored prefs in different locations as versions were updated.

Here are the diffs:

$ diff ~/.basilisk_ii_prefs ~/Documents/BasiliskII/.basilisk_ii_prefs
1,4c1,2
< disk /Users/skaufman/Documents/BasiliskII/SpinyDogfish
< disk /Users/skaufman/Documents/BasiliskII/Heads
< disk /Users/skaufman/Documents/BasiliskII/Kryton
< extfs /Users/skaufman/Documents/BasiliskII/Shared
---
> disk /Users/skaufman/Documents/BasiliskII2/SpinyDogfish
> extfs /Users/skaufman/Documents/BasiliskII2/Shared
11c9
< rom /Users/skaufman/Documents/BasiliskII/PERFORMA.ROM
---
> rom /Users/skaufman/Documents/BasiliskII2/PERFORMA.ROM
14c12
< ramsize 536870912
---
> ramsize 268435456
31d28
< keycodefile

The paths in ~/Documents/BasiliskII/.basilisk_ii_prefs are clearly wrong as there is no "BasiliskII2" folder. Also I'm unclear which ramsize is correct. The additional disks in ~/.basilisk_ii_prefs are indeed disks I've added.

So I presume that the root directory prefs file ~/.basilisk_ii_prefs takes precedence over the "local" prefs file ~/Documents/BasiliskII/.basilisk_ii_prefs. Removing the "local" files (both .basilisk_ii_prefs and .basilisk_ii_xpram) however still results in BII not launching and producing the same crash log. Even after (why not?) a full system reboot.

Weirder and weirder. Do you spot any other problems with ~/.basilisk_ii_prefs? Is it correct that it supersedes and prefs in the ~/Documents/BasiliskII/ location?

Sorry for all the bother, and many thanks again!
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by Ronald P. Regensburg »

I do not know how the additional prefs file got into your Documents folder. Maybe you played with an experimental setting in a previous beta version of the GUI app?

- Make sure you have the latest version of the GUI app: https://www.emaculation.com/basilisk/Ba ... I-0.22.zip
- Launch the GUI app and click the button next to the ? at the lower right corner.
- Make sure only the radio button "Basilisk II in same folder" and the check box "Quit GUI on Start" are selected
- Click Done and Save.
- Quit the GUI
- Trash ~/Documents/BasiliskII/basiliskII_ii_prefs
- Open again the GUI and check if the settings are as expected
- In the JIT tab, disable JIT compiler (removing only the check at the top suffices)
- Save the change and quit the GUI

Does BasiliskII run now?
stankaufman
Space Cadet
Posts: 8
Joined: Thu Dec 28, 2023 12:38 am

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by stankaufman »

Brilliant! It DOES launch correctly now! Hurrah!

I already had the latest GUI app but replaced it anyway. The only change in your GUI settings that is different from the existing settings was disabling the JIT compiler. But when disabled: et voilà! Success!

Why the JIT compiler would cause the crash is mysterious to me, not having gone into the weeds of the source code. But that appears to have been the solution.

Many, many thanks again not only for your help today but also for spearheading this critical effort to preserve the Mac!
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by Ronald P. Regensburg »

We found that JIT-compiler wil crash BasiliskII in Sonoma. I could reproduce it when I run BasiliskII with Rosetta in Sonoma on my M1 Mac.

JIT-compiler was already disabled on Apple Silicon, JIT-compiler settings are ignored there. Apparently it could be used on Intel up to Ventura, but not anymore in Sonoma. Maybe kanjitalk755 can make it so that it is disabled also in Sonoma (and later?) on Intel. It is not really needed on modern machines. BasiliskII is fast enough without it.
stankaufman
Space Cadet
Posts: 8
Joined: Thu Dec 28, 2023 12:38 am

Re: BasiliskII crashes at startup with SIGSEGV error - MacOS 14.2.1

Post by stankaufman »

Very interesting. Thanks for the explanation. Yes, BasiliskII is blindingly fast as it is. Boots in about one second. Remarkable.

Thanks again for all your work! One might think that as a trillion-dollar corporation, Apple would have a division specifically tasked to maintain VMs that replicate all stages of their hardware and OSes on all their new hardware and OSes. Even if their only real motivation is to make people buy new stuff, they could easily support this as an infinitesimal bit of their operation. Then again, the effort is purer and more heart-felt when accomplished by folks like you and kanjitalk755 -- and I'm sure that you guys do a better job anyway given all the cruft that's been in Apple releases lately.

So many thanks again!
Post Reply