Giter Site home page Giter Site logo

Comments (6)

hbeni avatar hbeni commented on May 27, 2024

Segfaults for me in every constellation....

I tried to debug it with gdb and got the following; segfaults and combinations are at line 24 following.
At least the version with the single user or session number, wrapped in a table, should work, or do i call wrongly?

  • client:sendPluginData("FGCOM:UPD_LOC", "CALLSIGN=test", {u}
  • client:sendPluginData("FGCOM:UPD_LOC", "CALLSIGN=test", {s}
mumble = require("mumble")  -- get the mumble API

local host = "localhost"
local port = 64738
local cert = "bot.pem"
local key  = "bot.key"

print("connecting to "..host.." on port "..port.." (cert: "..cert.."; key: "..key..")")
local client = assert(mumble.connect(host, port, cert, key))
client:auth("test")
print("  connect and bind: OK")


client:hook("OnServerSync", function(event)
    print("Sync done; server greeted with: ", event.welcome_text)
    
    print("send plugin message to all users ")
    users = client:getUsers()
    i=0
    for s,u in pairs(users) do
        i=i+1
        print("  "..i.." ("..s.."): "..u:getName())
        
        -- client:sendPluginData("FGCOM:UPD_LOC", "CALLSIGN=test", s) -- segfault at at mumble.c:375 / client.c:105
        -- client:sendPluginData("FGCOM:UPD_LOC", "CALLSIGN=test", {s})  --segfault at client.c:120
        -- client:sendPluginData("FGCOM:UPD_LOC", "CALLSIGN=test", u)  --segfault at at mumble.c:375 / client.c:105
        -- client:sendPluginData("FGCOM:UPD_LOC", "CALLSIGN=test", {u})  -- segfault at at client.c:117
    end
    
    --segfault client:sendPluginData("FGCOM:UPD_LOC", "CALLSIGN=test", client:getUsers()) 

    print("send ok")
end)

mumble.loop()

from lua-mumble.

bkacjios avatar bkacjios commented on May 27, 2024

There is something wrong with your build. For some reason it's crashing on lines that are erroring, such as.

-- client:sendPluginData("FGCOM:UPD_LOC", "CALLSIGN=test", s) -- segfault at at mumble.c:375 / client.c:105
and
-- client:sendPluginData("FGCOM:UPD_LOC", "CALLSIGN=test", u) --segfault at at mumble.c:375 / client.c:105

It's crashing in the error handler.. When you compile the module are you getting any warnings about a definition of luaL_traceback?

Anyway, I think I fixed the issue in 14b3724 with the other valid lines, mainly..

-- client:sendPluginData("FGCOM:UPD_LOC", "CALLSIGN=test", {s}) --segfault at client.c:120
and
-- client:sendPluginData("FGCOM:UPD_LOC", "CALLSIGN=test", {u}) -- segfault at at client.c:117

from lua-mumble.

hbeni avatar hbeni commented on May 27, 2024

Hi, no, i got no warnings. Compile was fine, like it is now (see below).
I just pulled to 14b3724 and recompiled using make clean; make debug, got no errors again.

Now the segfault is gone 😄 👍 , however the function does not seem to transmit anything over the wire, at least the otjher plugn instances can't see something.
You can also check with a very simple bot that justs checks for incoming messages and prints if so:

-- Sample Bot to check for incoming plugin messages
mumble = require("mumble")  -- get the mumble API

local host = "localhost"
local port = 64738
local cert = "bot.pem"
local key  = "bot.key"

print("connecting to "..host.." on port "..port.." (cert: "..cert.."; key: "..key..")")
local client = assert(mumble.connect(host, port, cert, key))
client:auth("test-rcv")
print("  connect and bind: OK")

client:hook("OnPluginData", function(event)
    --["sender"] = mumble.user sender, -- Who sent this data packet
	--["id"]     = Number id,          -- The data ID of this packet
	--["data"]   = String data,        -- The data sent (can be binary data)
	--["receivers"]				= {  -- A table of who is receiving this data
	--	[1] = mumble.user,
	--},
    print("DATA INCOMING FROM="..event.sender:getSession())

end)

mumble.loop()

However no message is printed, ever, from the bot sending stuff.
mumble client plugin messages are printed however, so the infrastructure basicly works, there is just something still wroing with the sending part...

Compile for current commit:

beni@segin:~/Dokumente/FGFS/work/lua-mumble$ make clean;make debug
rm *.o *.so proto/*.o proto/*.c proto/*.h
protoc-c --c_out=. proto/Mumble.proto
cc -c -I/usr/include/luajit-2.1 -I/usr/include/opus -fPIC -I. -DDEBUG -g -o proto/Mumble.o proto/Mumble.pb-c.c
cc -c -I/usr/include/luajit-2.1 -I/usr/include/opus -fPIC -I. -DDEBUG -g -o decoder.o decoder.c
cc -c -I/usr/include/luajit-2.1 -I/usr/include/opus -fPIC -I. -DDEBUG -g -o user.o user.c
cc -c -I/usr/include/luajit-2.1 -I/usr/include/opus -fPIC -I. -DDEBUG -g -o packet.o packet.c
cc -c -I/usr/include/luajit-2.1 -I/usr/include/opus -fPIC -I. -DDEBUG -g -o channel.o channel.c
cc -c -I/usr/include/luajit-2.1 -I/usr/include/opus -fPIC -I. -DDEBUG -g -o stb_vorbis.o stb_vorbis.c
cc -c -I/usr/include/luajit-2.1 -I/usr/include/opus -fPIC -I. -DDEBUG -g -o client.o client.c
cc -c -I/usr/include/luajit-2.1 -I/usr/include/opus -fPIC -I. -DDEBUG -g -o target.o target.c
cc -c -I/usr/include/luajit-2.1 -I/usr/include/opus -fPIC -I. -DDEBUG -g -o encoder.o encoder.c
cc -c -I/usr/include/luajit-2.1 -I/usr/include/opus -fPIC -I. -DDEBUG -g -o audio.o audio.c
cc -c -I/usr/include/luajit-2.1 -I/usr/include/opus -fPIC -I. -DDEBUG -g -o mumble.o mumble.c
cc -c -I/usr/include/luajit-2.1 -I/usr/include/opus -fPIC -I. -DDEBUG -g -o util.o util.c
cc -c -I/usr/include/luajit-2.1 -I/usr/include/opus -fPIC -I. -DDEBUG -g -o timer.o timer.c
cc -shared -fPIC -I. -DDEBUG -g -o mumble.so proto/Mumble.o decoder.o user.o packet.o channel.o stb_vorbis.o client.o target.o encoder.o audio.o mumble.o util.o timer.o -lssl -lluajit-5.1 -lprotobuf-c -lopus -lev 
beni@segin:~/Dokumente/FGFS/work/lua-mumble$

from lua-mumble.

bkacjios avatar bkacjios commented on May 27, 2024

Hmm, I don't really have any way to test this plugin system stuff since it requires mumble 1.4.0 and my server is on 1.3.1. It should be sending it, and I don't see a reason why it wouldn't be..

Nevermind, I think I know why! Will have a fix shortly!

from lua-mumble.

hbeni avatar hbeni commented on May 27, 2024

That last commit did the trick!
Its working!!!!!

Thank you very much for your efforts!!!!

from lua-mumble.

bkacjios avatar bkacjios commented on May 27, 2024

Nice. :) Glad it works.

from lua-mumble.

Related Issues (20)

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.