Editor crashes on second play

I’m using Steamworks.NET on OSX and its been working fine until recently, the Editor will hard crash immediately when hitting play a second time. I haven’t done any recent script changes, and the most recent Steam related work I did was achievement hooks, which wrapped up without issues. It sounds to me like something in the plugin is not unloading correctly when the Editor stops playing. I can currently bypass it by keeping Steam closed, while the plugin throws some errors the project works fine.

Here are the most recent entries in Editor.log:

Receiving unhandled NULL exception
Obtained 43 stack frames.
#0  0x0000014be9b7fe in OSXHelpers::CIOPollingHelper::Register(unsigned long, OSXHelpers::CIOPollingHelper::IHelperCallback*, int)
#1  0x0000014b4eddd3 in CCrossProcessPipe::BConnectToPipe(char const*, bool, unsigned int, unsigned int, unsigned int)
#2  0x0000014b4eb281 in CClientPipe::BConnect(char const*, bool, int, unsigned int, unsigned int, unsigned int)
#3  0x0000014b4e20aa in CIPCClient::CreateIPCPipe(char const*, bool, bool)
#4  0x0000014b8f5c35 in CSteamClient::CreateSteamPipeInternal(bool)
#5  0x0000012d067377 in SteamAPI_Init
#6  0x0000012c9c1477 in Init
#7  0x0000012bc80abe in  (wrapper managed-to-native) Steamworks.NativeMethods:SteamAPI_Init () + 0xbe (0x12bc80a00 0x12bc80b0e) [0x10d587660 - Unity Child Domain]
#8  0x0000012bc809b0 in  Steamworks.SteamAPI:Init () + 0x80 (0x12bc80930 0x12bc809f1) [0x10d587660 - Unity Child Domain]
#9  0x0000012bc80214 in  SteamManager:Awake () + 0x5d4 (0x12bc7fc40 0x12bc8030a) [0x10d587660 - Unity Child Domain]
#10 0x0000012251d38a in  (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr) + 0xfa (0x12251d290 0x12251d4bd) [0x10d587660 - Unity Child Domain]
#11 0x0000010aa8785e in mono_get_runtime_build_info
#12 0x0000010abb211e in mono_runtime_invoke
#13 0x00000101dee24d in ScriptingInvocation::Invoke(MonoException**, bool)
#14 0x00000101dee153 in ScriptingInvocation::InvokeChecked(MonoException**)
#15 0x00000102293649 in MonoBehaviour::CallMethodInactive(ScriptingMethodMono)
#16 0x00000102297be6 in MonoBehaviour::AddToManager()
#17 0x000001022976b3 in MonoBehaviour::AwakeFromLoad(AwakeFromLoadMode)
#18 0x00000101dfe9d6 in AwakeFromLoadQueue::InvokePersistentManagerAwake(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode)
#19 0x00000101dadcbf in LoadSceneOperation::CompleteAwakeSequence()
#20 0x00000101dacf77 in LoadSceneOperation::IntegrateMainThread()
#21 0x00000101daeb39 in PreloadManager::UpdatePreloadingSingleStep(PreloadManager::UpdatePreloadingFlags, int)
#22 0x00000101daf57f in PreloadManager::WaitForAllAsyncOperationsToComplete()
#23 0x00000102327cd2 in EditorSceneManager::RestoreSceneBackups(std::vector<EditorSceneManager::SceneBackup, stl_allocator<EditorSceneManager::SceneBackup, (MemLabelIdentifier)94, 16> >&, EditorSceneManager::PlayModeChange, bool)
#24 0x000001026440ea in Application::EnterPlayMode(bool)
#25 0x0000010264091c in Application::SetIsPlaying(bool)
#26 0x0000010264022d in Application::TickTimer()
#27 0x007fff8f598f3f in __NSFireTimer
#28 0x007fff8db0fd04 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
#29 0x007fff8db0f98f in __CFRunLoopDoTimer
#30 0x007fff8db0f4ea in __CFRunLoopDoTimers
#31 0x007fff8db06c31 in __CFRunLoopRun
#32 0x007fff8db061c4 in CFRunLoopRunSpecific
#33 0x007fff8d067ebc in RunCurrentEventLoopInMode
#34 0x007fff8d067cf1 in ReceiveNextEventCommon
#35 0x007fff8d067b26 in _BlockUntilNextEventMatchingListInModeWithFilter
#36 0x007fff8b602e24 in _DPSNextEvent
#37 0x007fff8bd7e85e in -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
#38 0x007fff8b5f77ab in -[NSApplication run]
#39 0x007fff8b5c21de in NSApplicationMain
#40 0x000001026e4128 in EditorMain(int, char const**)
#41 0x000001026e4939 in main
#42 0x00000100002604 in start
Launching bug reporter

Just throwing in that I’m having the same problem. If I find a good fix I’ll post it here.

Edit: Alright, the crash is definitely coming from checking “SteamManager.Initialized”. It’s also only happening on my mac, for whatever reason.

Edit2: I made a stripped down version of this and submitted it in a crash report.

FYI I was having this issue yesterday. Today Steam client updated, and the crashes stopped.