DSchroer / dslcad

DSLCad is a programming language & interpreter for building 3D models.
https://dslcad.com
GNU Lesser General Public License v2.1
470 stars 14 forks source link

Open or New hang the system when 'autorender' is active (MacOS Ventura 13.1; Apple Silicon) #3

Closed selfsimilar closed 1 year ago

selfsimilar commented 1 year ago

Using the pre-compiled MacOSX binary, as well as compiling from scratch, when trying to use Open (o) or New (n) the application uses 100% CPU and becomes unresponsive (spinning beach ball), but only when 'Autorender' is active.

Sorry if the Sample Trace is too verbose and unhelpful.

Console Output 2023-02-10T16:43:00.376021Z INFO bevy_render::renderer: AdapterInfo { name: "Apple M1 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal } 1 HIToolbox 0x000000019c42c5c8 _ZN15MenuBarInstance22EnsureAutoShowObserverEv + 120 2 HIToolbox 0x000000019c42c188 _ZN15MenuBarInstance14EnableAutoShowEv + 60 3 HIToolbox 0x000000019c3cf310 SetMenuBarObscured + 372 4 HIToolbox 0x000000019c3ceee8 _ZN13HIApplication15HandleActivatedEP14OpaqueEventRefhP15OpaqueWindowPtrh + 172 5 HIToolbox 0x000000019c3c8fcc _ZN13HIApplication13EventObserverEjP14OpaqueEventRefPv + 296 6 HIToolbox 0x000000019c38fcd0 _NotifyEventLoopObservers + 176 7 HIToolbox 0x000000019c3c896c AcquireEventFromQueue + 432 8 HIToolbox 0x000000019c3b7c84 ReceiveNextEventCommon + 320 9 HIToolbox 0x000000019c3b7b2c _BlockUntilNextEventMatchingListInModeWithFilter + 72 10 AppKit 0x0000000195f64424 _DPSNextEvent + 632 11 AppKit 0x0000000195f635b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728 12 AppKit 0x0000000195f579e4 -[NSApplication run] + 464 13 dslcad 0x00000001008d8bf0 _ZN60_$LT$$LP$$RP$$u20$as$u20$objc..message..MessageArguments$GT$6invoke17h9b5c0315a7b8754bE + 76 14 dslcad 0x00000001008d7d00 _ZN4objc7message8platform15send_unverified17h680152bdc7c71304E + 132 15 dslcad 0x000000010086afe8 _ZN5winit13platform_impl8platform10event_loop18EventLoop$LT$T$GT$10run_return28_$u7b$$u7b$closure$u7d$$u7d$17h3c8165bc74f7cd35E + 740 16 dslcad 0x000000010086ab20 _ZN4objc2rc11autorelease15autoreleasepool17h634d006023ab4907E + 112 17 dslcad 0x000000010086aca0 _ZN5winit13platform_impl8platform10event_loop18EventLoop$LT$T$GT$10run_return17h52bb52ec0407db7eE + 296 18 dslcad 0x000000010086b234 _ZN5winit13platform_impl8platform10event_loop18EventLoop$LT$T$GT$3run17hb7c30b30d7397cd6E + 52 19 dslcad 0x000000010082d970 _ZN5winit10event_loop25EventLoop$LT$$LP$$RP$$GT$3new17h401de4875f7b36a6E + 0 20 dslcad 0x00000001008539d0 _ZN10bevy_winit10run_return17hb823906238059242E + 0 21 dslcad 0x00000001008540b8 _ZN10bevy_winit17winit_runner_with17hf3d4a55b277a0e85E + 1568 22 dslcad 0x0000000100853a48 _ZN10bevy_winit12winit_runner17h9adf8e2381abaa58E + 48 23 dslcad 0x0000000100849cb4 _ZN4core3ops8function2Fn4call17h5ddd653a615c8edeE + 56 24 dslcad 0x00000001020ed184 _ZN86_$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..Fn$LT$Args$GT$$GT$4call17h2b3abe02d2285857E + 112 25 dslcad 0x00000001020f2bdc _ZN8bevy_app3app3App3run17h0f038a45ccfd5890E + 312 26 dslcad 0x000000010048bc24 _ZN6dslcad6editor4main17h597d3d2f129053c4E + 760 27 dslcad 0x00000001004a124c _ZN6dslcad4main17hfc19b66d65f56a6fE + 120 28 dslcad 0x00000001004ebc84 _ZN4core3ops8function6FnOnce9call_once17h87928dcf257b878aE + 20 29 dslcad 0x000000010047c390 _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h8ad6032355c743daE + 24 30 dslcad 0x0000000100490ed0 _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17h95eb04a7d2bc5073E + 28 31 dslcad 0x0000000102f7db40 _ZN3std2rt19lang_start_internal17h0cdebe2c4a3b171eE + 616 32 dslcad 0x0000000100490e9c _ZN3std2rt10lang_start17haf7533eb9af913caE + 84 33 dslcad 0x00000001004a12a0 main + 36 34 dyld 0x00000001928dbe50 start + 2544 2023-02-10T16:54:40.878065Z WARN gilrs::ff::server: One iteration of a force feedback loop took more than 50ms!

Activity Monitor Sample

DSchroer commented 1 year ago

Thanks for the report. I don't have access to a Apple Silicon device at the moment but I will in about a week. So Ill be sure to test what is going wrong there.

DSchroer commented 1 year ago

My guess is that the file watcher callback is being triggered too often: https://github.com/DSchroer/dslcad/blob/e5e692f61fa5c3bfa03406b8cec7344c615568c6/crates/dslcad_app/src/editor/file_watcher.rs#L30

DSchroer commented 1 year ago

Hey. I still haven't had a chance to test it directly on hardware however I made a small change to that system that might help.

When you have a moment do you mind trying this new pre-release build to see if the issue is resolved?

https://github.com/DSchroer/dslcad/releases/tag/v0.0.2-pre.1

selfsimilar commented 1 year ago

That resolved the issue! Thanks!