signalwire / freeswitch

FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.
https://freeswitch.com/#getting-started
Other
3.61k stars 1.43k forks source link

crash in mod_python3 with freeswitch 1.10.7 on debian 11/bullseye #1526

Open abma opened 2 years ago

abma commented 2 years ago

Describe the bug freeswitch "randomly" crashes

To Reproduce no clue atm.

backtrace from core file

backtrace2.log

abma commented 2 years ago

oh, as the dialplan is not this difficult, i guess i try with mod_python3 next

abma commented 2 years ago

similar crash in mod_python3.c:340 with

1.10.7~release~19~883d2cb662~bullseye-1~bullseye+1

on debian 11:

backtrace.txt

abma commented 1 year ago

this python code made it crash

def hangup_hook(session, what, args=''):
        if what != "transfer":
                logerr("hangup hook for '%s' %s" % (what, session.cause()))
                return
        rawnr = session.getVariable("destination_number")
        caller = session.getVariable("caller_id_number")

removing the logerr line fixed the crash: it seems accessing "session" when what != "transfer" makes freeswitch crash!

to fix i guess freeswitch should set session=None when its not a transfer.