SketchUp crashes when launched with debugger on Monterey 12.01 and Apple silicon
I am trying to update my development environment to Apple Silicon (M1 Pro) with Monterey 12.0.1. Sketchup works fine, but when I launch Sketchup with the debugger it crashes immediately. The same debugger 1.3.0 works fine in BigSur with intel.
Bugsplat attached
There's yet to be a release of SketchUp that support Monterey, ditto for native M1 support. When that is released we'll be making another build of the debugger and make it available.
Just seen the updated debugger. It still crashes. I have tested it on SU21 and SU22 (Monterey and Apple Silicon). I have just sent the crash report (Crash #185).
I am using vscode. In tasks.json I have:
{
"label": "Debug SketchUp 2022",
"type": "shell",
"command": "open -a '/Applications/SketchUp 2022/SketchUp.app' --args -rdebug 'ide port=7000'",
"windows": {
"command": "&'C:/Program Files/SketchUp/SketchUp 2022/SketchUp.exe' -rdebug 'ide port=7000'"
}
},
and in launch.json
{
"name": "Sketchup 2022 Debug",
"type": "Ruby",
"request": "attach",
"cwd": "${workspaceRoot}",
"remoteHost": "127.0.0.1",
"remotePort": "7000",
"remoteWorkspaceRoot": "${workspaceRoot}"
}
Any change required?
hm... I'm not sure what's going on.
Could you try building it yourself, that should give you debug symbols? And then lunching SU with a debugger attached? In the crash report we're getting it doesn't collect symbols for the debugger since it's a separate library.
Should be only a matter of opening the Xcode project and building. No external dependencies.
I can try! :-) Never done it before and Xcode is quite intimidating.
Will let you know how it goes
Xcode is quite intimidating.
I know, macOS is not within my comfort zone either. (I'm going to double check on my end here, though I don't have a Monterey machine)
OK. I managed to compile it, but it still crashes. I have sent the two report (2021 and 2022) Crash #407529 Crash #189
I have used the file from the folder
/Users/xxx/Library/Developer/Xcode/DerivedData/SURubyDebugger-gigrtipdowtnfidsolwkhtppphzs/Build/Products/Debug/
I'm not sure if you can load the Debug dylib in a Release app.
Refer to this page for how to use xcodebuild to build a Release build: https://github.com/SketchUp/sketchup-ruby-debugger/blob/main/Development.md
(Sorry, I should have mentioned this.)
Don't worry.
No luck unfortunately
SU2021 Crash #407556 SU2022 Crash #190
Are you able to launch SU with the debugger attached, so you can break on the crash?
We won't get the debug symbols reported in our tracker, so you'd have to report here.
Do you mean with this command?
open -a '/Applications/SketchUp 2022/SketchUp.app' --args -rdebug 'ide port=7000'
If so, yes.
We won't get the debug symbols reported in our tracker, so you'd have to report here.
Do you want me to copy the content of the crash report here?
I have the same problem here. M1 Monterey
... opening the Xcode project ... euh what Xcode project ? may I ask, full of embarrassment.
You need to download the repository. It is in the Build directory.
Curious to see if works for you. It still doesn't for me
Boy! this is a lot of work installing & configuring all the required apps. I found a good guide, up to date. https://mac.install.guide/ruby/index.html
Opening the file SURubyDebugger.xcodeproj in XCode, 12 issues are indicated.
all the same as the one on the image.

@mariocha hava a look at @thomthom reply above
Refer to this page for how to use
xcodebuildto build a Release build: https://github.com/SketchUp/sketchup-ruby-debugger/blob/main/Development.md
@ruggieroguida Do you want me to copy the content of the crash report here?
Please, with such long files (like in the 1st post,) do not copy and paste them.
Instead attach them as text file. If GitHub does not like the file extension, just wrap it up in a zip file.
@DanRathbun Done. Much better. I had not realised you could attach files.
Ok , I managed to build a dylb. But the 12 errors mentioned above are still indicated, so .... I am rather sceptic . Anyway here it is SURubyDebugger.dylib.zip
I am also getting crashes when I launch SketchUp, whether directly from the Terminal or from VS Code. My system is a 2019 16" MacBook Pro running macOS Monterey 12.2.1. One example BugSplat #3412. The head of the crash report looks like this, which appears to indicate an exception from the code that tries to open a socket for the debug connection?
Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x7ff81ec61112 __pthread_kill + 10
1 libsystem_pthread.dylib 0x7ff81ec97214 pthread_kill + 263
2 libsystem_c.dylib 0x7ff81ebe3d10 abort + 123
3 CrashReporter 0x10522a0a9 uncaught_exception_handler.cold.1 + 24
4 CrashReporter 0x10520dcb2 uncaught_exception_handler + 39
5 ExceptionHandling 0x7ff922997cc0 NSExceptionHandlerUncaughtExceptionHandler + 34
6 BugsplatMac 0x104e39af8 uncaught_cxx_exception_handler + 70
7 BugsplatMac 0x104e469f2 BITCrashUncaughtCXXTerminateHandler() + 409
8 libc++abi.dylib 0x7ff81ec534d7 std::__terminate(void ()()) + 8
9 libc++abi.dylib 0x7ff81ec55d55 __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception) + 27
10 libc++abi.dylib 0x7ff81ec55d1c __cxa_throw + 116
11 SURubyDebugger.dylib 0x113bb2d7e void boost::throw_exceptionboost::system::system_error(boost::system::system_error const&) + 56
12 SURubyDebugger.dylib 0x113bc3015 boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::execution::any_executor<boost::asio::execution::context_as_tboost::asio::execution_context&, boost::asio::execution::detail::blocking::never_t<0>, boost::asio::execution::prefer_only<boost::asio::execution::detail::blocking::possibly_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::tracked_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::untracked_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::fork_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::continuation_t<0> > > >::basic_socket_acceptorboost::asio::io_context(boost::asio::io_context&, boost::asio::ip::basic_endpointboost::asio::ip::tcp const&, bool, std::__1::enable_if<is_convertible<boost::asio::io_context&, boost::asio::execution_context&>::value, void>::type*) + 601
13 SURubyDebugger.dylib 0x113babd49 SketchUp::RubyDebugger::RDIP::Impl::Impl(SketchUp::RubyDebugger::IDebugServer*, int) + 179
14 SURubyDebugger.dylib 0x113bb20ce SketchUp::RubyDebugger::RDIP::Initialize(SketchUp::RubyDebugger::IDebugServer*, std::__1::basic_string<char, std::__1::char_traits
I tried building according to the directions. It still crashes. Attached is the full crash report
I also tried local build of the 1.4.0.0 source. BugSplat Crash #3521
My C++ is a bit rusty, but it looks to me as if the boost library is throwing an exception after failing to bind the socket for the ruby debugger to listen on.
hm... yea, seems to be a boost error being thrown there... I need to get my hands on a machine with matching OS for this one I think....
Having the same issue on MacOS 12.3 (Monterey) on Intell
@thomthom I was wondering whether there was some progress on this. I did not see any update in the forum. Thanks!
After upgrading to Monterey I'm seeing this on my own system as well.
Turns out macOS Monterey is using port 7000. And RubyDebugger doesn't handle a failed connection - it just crashes. (https://developer.apple.com/forums/thread/682332)
Try with a different port and let me know.
The good news is that it does not crash using port 7354. This port is not used according to lsof -i -P | grep -i "listen".
The bad news is that the breakpoints are not triggered. It has been a while, but from memory, SketchUp used to hang until the debugger was launched. Now it does not happen.
When you execute the script being debugged, vscode appears briefly, but then the focus goes back to SketchUp and nothing happens.
I have also tried with the wait option
open -a '/Applications/SketchUp 2021/SketchUp.app' --args -rdebug 'ide port=7354 wait'
same thing...
If you launch without using open, but open SU directly:
/Applications/SketchUp\ 2022/SketchUp.app/Contents/MacOS/SketchUp -rdebug "ide port=6123"
Does the terminal output say anything like Initializing ruby-debug-ide protocol?