Giter Club home page Giter Club logo

Comments (4)

ignacio avatar ignacio commented on June 20, 2024

Any update on this?

from luatrace.

geoffleyland avatar geoffleyland commented on June 20, 2024

Sorry, last time I looked at this I was pushed for time and couldn't work anything out because the stack traces in the two are exactly the same. Turns out that the problem is that both traces trace off the top of the trace stack (I'm not quite sure how this happens because when the trace starts there's an attempt to build the full current stack), but a the failing trace records a line with non-zero time when were "above" the top of the stack. The quick and dirty solution is to just ignore time that occurs in a stack frame we don't know about.
I'll have a look at the initial stack build and see if there's anything obvious, but I'm not hopeful.

from luatrace.

geoffleyland avatar geoffleyland commented on June 20, 2024

Nope, that wasn't it at all.
trace-out-failing.txt includes a line that records time on a line that isn't in the current function's set of lines. I don't know why that might be.
When this happens, profile guesses that it's LuaJIT forgetting to tell us about a return (this used to happen, I don't know if it still does) and adds an extra return before continuing.
In this case, it's the wrong thing to do. The extra return means that we jump off the top of the stack when we should be returning to test_json.lua.
So now, when we find time attributed to a line that's not in the current function, we look and see if the line is in the caller of the current function. If it is, then we guess the missing return as before. If it's not, we give up, complain, but don't add the extra return.
Which, in this case, prevents the stack getting out-of-whack by one frame.

from luatrace.

ignacio avatar ignacio commented on June 20, 2024

Well, with your latest changes I can't reproduce the issue, so it seems to be fixed :)

Thanks a lot!

from luatrace.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.