Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SketchUp crashes when launched with debugger on Monterey 12.01 and Apple silicon #34

Open
ruggieroguida opened this issue Dec 14, 2021 · 39 comments

Comments

@ruggieroguida
Copy link

ruggieroguida commented Dec 14, 2021

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

bugsplat.txt

@thomthom
Copy link
Member

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.

@ruggieroguida ruggieroguida changed the title SketchUp crash when launched with debugger on Monterey 12.01 and Apple silicon SketchUp crashes when launched with debugger on Monterey 12.01 and Apple silicon Dec 15, 2021
@ruggieroguida
Copy link
Author

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?

@thomthom
Copy link
Member

thomthom commented Jan 26, 2022

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.

@ruggieroguida
Copy link
Author

I can try! :-) Never done it before and Xcode is quite intimidating.

Will let you know how it goes

@thomthom
Copy link
Member

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)

@ruggieroguida
Copy link
Author

ruggieroguida commented Jan 26, 2022

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/

@thomthom
Copy link
Member

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.)

@ruggieroguida
Copy link
Author

Don't worry.

No luck unfortunately

SU2021 Crash #407556
SU2022 Crash #190

@thomthom
Copy link
Member

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.

@ruggieroguida
Copy link
Author

ruggieroguida commented Jan 26, 2022

Do you mean with this command?

open -a '/Applications/SketchUp 2022/SketchUp.app' --args -rdebug 'ide port=7000'

If so, yes.

@ruggieroguida
Copy link
Author

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?

@mariocha
Copy link

mariocha commented Feb 5, 2022

I have the same problem here. M1 Monterey
... opening the Xcode project ... euh what Xcode project ? may I ask, full of embarrassment.

@ruggieroguida
Copy link
Author

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

@mariocha
Copy link

mariocha commented Feb 8, 2022

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

@mariocha
Copy link

mariocha commented Feb 8, 2022

Opening the file SURubyDebugger.xcodeproj in XCode, 12 issues are indicated.
all the same as the one on the image.
issues

@ruggieroguida
Copy link
Author

@mariocha hava a look at @thomthom reply above

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

@DanRathbun
Copy link

@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.

@ruggieroguida
Copy link
Author

@DanRathbun Done. Much better. I had not realised you could attach files.

@mariocha
Copy link

mariocha commented Feb 16, 2022

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

@slbaumgartner
Copy link

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, std::__1::allocator > const&) + 968
15 SURubyDebugger.dylib 0x113ba21b7 SketchUp::RubyDebugger::Server::Start(std::__1::unique_ptr<SketchUp::RubyDebugger::IDebuggerUI, std::__1::default_deleteSketchUp::RubyDebugger::IDebuggerUI >, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) + 173
16 SURubyDebugger.dylib 0x113bcb930 InitDebugger + 534
17 SketchUp 0x1045326a7 InitRubyDebugger(atlast::utils::atlast_ustring const&) + 217

@slbaumgartner
Copy link

I tried building according to the directions. It still crashes. Attached is the full crash report

Debugger-crash.zip
.

@slbaumgartner
Copy link

I also tried local build of the 1.4.0.0 source. BugSplat Crash #3521

@slbaumgartner
Copy link

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.

@thomthom
Copy link
Member

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....

@zhukmj
Copy link

zhukmj commented Mar 27, 2022

Having the same issue on MacOS 12.3 (Monterey) on Intell

@mioruggieroguida
Copy link

@thomthom I was wondering whether there was some progress on this. I did not see any update in the forum. Thanks!

@thomthom
Copy link
Member

thomthom commented Nov 2, 2022

After upgrading to Monterey I'm seeing this on my own system as well.

@thomthom
Copy link
Member

thomthom commented Nov 2, 2022

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.

@ruggieroguida
Copy link
Author

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...

@thomthom
Copy link
Member

thomthom commented Nov 2, 2022

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?

@mioruggieroguida
Copy link

Nope

This is the output


[1102/170459.415881:WARNING:dns_config_service_posix.cc(185)] dns_config has unhandled options!
[1102/170459.596133:WARNING:dns_config_service_posix.cc(185)] dns_config has unhandled options!
2022-11-02 17:05:00.064 SketchUp[10436:17399755] Initializing Bugsplat
objc[10436]: Class SkpTimerCaller is implemented in both /Applications/SketchUp 2021/SketchUp.app/Contents/MacOS/SketchUp (0x103431f40) and /Applications/SketchUp 2021/SketchUp.app/Contents/Frameworks/LayOutAPI.framework/Versions/A/Libraries/libSketchUpViewerAPI.dylib (0x11e9ddd58). One of the two will be used. Which one is undefined.
objc[10436]: Class SKTextPath is implemented in both /Applications/SketchUp 2021/SketchUp.app/Contents/MacOS/SketchUp (0x103431fb8) and /Applications/SketchUp 2021/SketchUp.app/Contents/Frameworks/LayOutAPI.framework/Versions/A/Libraries/libSketchUpViewerAPI.dylib (0x11e9dddd0). One of the two will be used. Which one is undefined.
objc[10436]: Class SKTextPath is implemented in both /Applications/SketchUp 2021/SketchUp.app/Contents/MacOS/SketchUp (0x103431fb8) and /Applications/SketchUp 2021/SketchUp.app/Contents/Frameworks/SketchUpAPI.framework/Versions/A/SketchUpAPI (0x11c726340). One of the two will be used. Which one is undefined.
2022-11-02 17:05:00.567 SketchUp[10436:17399755] INFO: Start CrashManager processing
2022-11-02 17:05:01.068 SketchUp[10436:17399755] [HockeySDK] -[BITCrashManager invokeDelayedProcessing]/974 [HockeySDK] WARNING: Another exception handler was added. If this invokes any kind exit() after processing the exception, which causes any subsequent error handler not to be invoked, these crashes will NOT be reported to HockeyApp!
[1102/170503.842374:INFO:CONSOLE(7)] "Error accessing file:///Applications/SketchUp%202021/SketchUp.app/Contents/Resources/welcomescreen/../en.lproj//welcomescreen/en.json--[object ProgressEvent]", source: file:///Applications/SketchUp%202021/SketchUp.app/Contents/Resources/welcomescreen/regularlaunchpage.bundle.js (7)
[1102/170503.843018:INFO:CONSOLE(7)] "Unable to find resource file for language en", source: file:///Applications/SketchUp%202021/SketchUp.app/Contents/Resources/welcomescreen/regularlaunchpage.bundle.js (7)
[1102/170503.843080:INFO:CONSOLE(7)] "In location file:///Applications/SketchUp%202021/SketchUp.app/Contents/Resources/welcomescreen/../en.lproj//welcomescreen/en.json", source: file:///Applications/SketchUp%202021/SketchUp.app/Contents/Resources/welcomescreen/regularlaunchpage.bundle.js (7)
[1102/170504.064050:INFO:CONSOLE(27)] "Uncaught (in promise) NavigationDuplicated: Navigating to current location ("/home") is not allowed", source: file:///Applications/SketchUp%202021/SketchUp.app/Contents/Resources/welcomescreen/regularlaunchpage.bundle.js (27)

@thomthom
Copy link
Member

thomthom commented Nov 2, 2022

Just to double check what version of SU and what version of the SURubyDebugger build are you using?

@ruggieroguida
Copy link
Author

@thomthom Ignore previous message. I think I was still using one of the builds mentioned in the previous messages.

I have downloaded the latest version https://github.com/SketchUp/sketchup-ruby-debugger/releases/download/1.4.0.0/SURubyDebugger.dll from 25/01/2022 and it seems to work fine.

Thanks for your help!!

@slbaumgartner
Copy link

When using a different port, SketchUp will now launch for me with the Ruby debugger installed.

However, the tutorial pages for setting up VSCode are horribly out of date and don't correspond to the current release (at least on Mac, don't know about Windows but I'd expect it is the same)! Any chance of getting them updated? That would save us a lot of time searching help for how to do the required setups.

@thomthom
Copy link
Member

thomthom commented Nov 3, 2022

Yea, the docs deserve a refresh. (This should improve when we get the new position filled: https://forums.sketchup.com/t/were-hiring-technical-support-engineer/212177)

Meanwhile, the VSCode project example is probably the most up to date.

@thomthom
Copy link
Member

thomthom commented Nov 3, 2022

I'm leaving this issue open until we added improvement to the RubyDebugger such that it doesn't crash when a connection fails.

@jeroentheuns
Copy link

Hi Thomas, I read all of the above. Any news on this? We need this debugger so badly... Before reading this I was testing on Ventura 13.0 with SU alpha version, 2022 an 2022, trying to get de debugger working, running into all of the same crashes.

@thomthom
Copy link
Member

@jeroentheuns - have you checked if the port you are using is not already in use? The debugger will crash if it cannot connect.

@jeroentheuns
Copy link

jeroentheuns commented Nov 24, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants