-
Notifications
You must be signed in to change notification settings - Fork 191
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
Debugging lua scripts within mpv , crashes #63
Comments
You can try getting a stack trace to see where it fails. You can also add |
That sounds a good idea! Here is the backtrace using ddd mpv and inside run FoFg.mp4, then bt Thread 9 "mpv/lua script " received signal SIGSEGV, Segmentation fault. When i put print as suggested in local function start(controller_host, controller_port) New foo.lua:` function script_path() local script_path = script_path() -- implement in your host golang program --relocate mobdebug localy to hijack it with some print print(package.path) function catch(what) function try(what) try { catch { lineforthebreakpoint=1` |
@sosie-js, thank yor for the details.
Given the stack trace, this looks like a luasocket issue (and the fact that a socket connection is initiated from the I'd suggest a couple of things. Try using the most recent version of mobdebug, as there are several changes I implemented to address this issue. You can also try to update the version of luasocket to the one with the proposed patch (it's referenced in the ticket I mentioned). Another option would be to comment out |
Paul you are welcome. I tried already the latest mobdebug 0.801 after lancing zbstudio, if i do then no problem to debug, no crash. Now, if zbstudio is closed, then It is then when Zbstudio is open and the hook set that it crashes. |
I put some print in local function debug_hook(event, line) PS: I dont have the luasocket issue in 5.1/luajit you mentioned. Http/https works fine |
I don't know about your hook bur maybe https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/test-hooks.lua can give a clue of incompatibility debug.sethook(debug_hook, HOOKMASK) |
Hi Paul,
-I copied the mobdebug.lua under /usr/local/share/lua/5.1
-Created foo.lua in /opt/ZeroBraneStudio-1.90/myprograms so it is reachable by zbstudio with this content
require('mobdebug').start()
lineforthebreakpoint=1
I installed the plugin autostart from https://github.com/pkulchenko/ZeroBranePackage/blob/master/autostartdebug.lua
cp autostartdebug.lua /opt/ZeroBraneStudio-1.90/packages
then launched zbstudio
i put the dummy breakpoint on lineforthebreakpoint and it works when I run , it switches into debug and halts on this line
BUT if i trigger this from mpv latest relying on LuaJIT 2.1.0-beta3
mpv 0.33.0-209-gf2afae55e9 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
built on Sun Jul 4 14:32:32 CEST 2021
FFmpeg library versions:
libavutil 56.70.100
libavcodec 58.134.100
libavformat 58.76.100
libswscale 5.9.100
libavfilter 7.110.100
libswresample 3.9.100
FFmpeg version: n4.4-78-g031c0cb0b4
then the call mpv --script=foo.lua bar.mp4 gives me Segmentation fault
Any idea Sir?
The text was updated successfully, but these errors were encountered: