Stack trace?

Hi all,

After upgrading a month (or two?) ago, I’m no longer getting a full stack trace on error:

image

I.e. it’s only giving me the line it’s errored upon rather than the calling function(s) - I think it used to trace back 2 additional levels?
Is this known? Can it be resolved?
Thanks!

Nick

1 Like

Hi.

Yeah, it’s been brought up a few times in Discord and in a GitHub issue.

There are some new profiling capabilities that were added. These have some begin / end state in the case of event dispatchers (like enterFrame, in particular), so need to be robust in case there’s an error in the middle.

Unfortunately, just doing a pcall() and then rethrowing the error skips the catch-all that gives you more error information. :frowning:

I’m trying to work out a fix but still need to reason out some corner cases (pcall()ing a listener that calls another listener; coroutines).

3 Likes

Thank you for letting me know :slight_smile:

I might have this working. I can dump profiling stats and get a traceback when I trigger a crash. Relaunches seem to be okay.

I no longer try to intercept the error in the dispatcher logic. Rather, I’ve made some minor modifications to Lua itself. In normal situations, I’m manually adding / removing the profiling state before and after the dispatching calls. But if an error happens within a pcall() (and there is one big one of these around everything, to catch unhandled errors) or during coroutine resumes and yields, some of this state is fixed up.

I’ll need to hammer at this for a while to convince myself it handles various cases, but shouldn’t be too long for a PR.

2 Likes

That is awesome news, well done!
Thanks very much for working on a resolution!!
:sunglasses:

Thanks also, look forward to getting stack trace back. Debugging is guess work right now!

1 Like

Any progress here? Lack of stacktrace makes development slow.

What version should we go back to get stacktrace in the meantime?

A suggested fix was put in via a PR a few weeks ago:

The current profiler issues began with version 3692, so you’d want an earlier version than that.