You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently had a bug in my own code that was causing a crash, but it was difficult to debug because the stack traces were misleading due to function inlining. For example I was getting a thread crash with:
but I know for a fact that the actual crash was emanating from a different swift function, func getFrontmostAppWindowID(frontmostAppPid: Int) -> Int, which is invoked by the screen_capture(..) function.
I was able to improve the situation by adding the DEBUG=true env variable, which I noticed here:
NOTE that I also tried decorating the function in question with @inline(never), but it didn't seem to help. Maybe since it was defaulting to a release build it was ignoring those compiler hints.
I didn't see the DEBUG flag mentioned in the docs, but maybe I missed it. If it's not there, would you take a PR to update the README?
swift-rs has been working great for me, and thanks again @Brendonovich for creating this project!
The text was updated successfully, but these errors were encountered:
DEBUG is an env var set by cargo for build scripts, it should be true by default when compiling in debug mode. Were you compiling in debug or release mode?
I'm not familiar with @inline(never) and the like.
I recently had a bug in my own code that was causing a crash, but it was difficult to debug because the stack traces were misleading due to function inlining. For example I was getting a thread crash with:
but I know for a fact that the actual crash was emanating from a different swift function,
func getFrontmostAppWindowID(frontmostAppPid: Int) -> Int
, which is invoked by thescreen_capture(..)
function.I was able to improve the situation by adding the
DEBUG=true
env variable, which I noticed here:swift-rs/src-rs/build.rs
Lines 222 to 224 in 50a909d
The new and improved stack trace showed the crash emanating from the expected function:
NOTE that I also tried decorating the function in question with
@inline(never)
, but it didn't seem to help. Maybe since it was defaulting to a release build it was ignoring those compiler hints.I didn't see the
DEBUG
flag mentioned in the docs, but maybe I missed it. If it's not there, would you take a PR to update the README?swift-rs has been working great for me, and thanks again @Brendonovich for creating this project!
The text was updated successfully, but these errors were encountered: