Skip to content

Segfault when getting bleg_* time variables #2883

@greenbea

Description

@greenbea

Describe the bug
Segfault in switch_channel_get_variable_dup when getting bleg_* profile timing vars

To Reproduce
Steps to reproduce the behavior:

  1. Originate a call
  2. Run in console uuid_get_var {uuid} bleg_answered_time
  3. FreeSWITCH crashes

Trace logs
Provide freeswitch logs w/ DEBUG and UUID logging enabled

backtrace from core file
If applicable, provide the full backtrace from the core file.

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f54604560a9 in switch_caller_get_field_by_name (caller_profile=0x7f542c2d6b10, name=name@entry=0x7f542001c66a "answered_time") at src/switch_caller.c:299
299                     return switch_core_sprintf(caller_profile->pool, "%" SWITCH_TIME_T_FMT, caller_profile->times->answered);
[Current thread is 1 (Thread 0x7f545e7a9700 (LWP 751867))]

(gdb) bt

#0  0x00007f54604560a9 in switch_caller_get_field_by_name (caller_profile=0x7f542c2d6b10, name=name@entry=0x7f542001c66a "answered_time") at src/switch_caller.c:299
#1  0x00007f5460458eff in switch_channel_get_variable_dup (channel=channel@entry=0x7f5438079540, varname=0x7f542001c66a "answered_time", varname@entry=0x7f542001c665 "bleg_answered_time", dup=dup@entry=SWITCH_TRUE, idx=idx@entry=-1) at src/switch_channel.c:1004
#2  0x00007f545d9b0c2d in uuid_getvar_function (cmd=<optimized out>, session=<optimized out>, stream=0x7f545e7a7bd0) at mod_commands.c:6273
#3  0x00007f54604efe95 in switch_api_execute (cmd=cmd@entry=0x7f54200323b0 "uuid_getvar", arg=arg@entry=0x7f54200323bc "cd448f91-1b56-406e-85c0-a9037b3916e9 bleg_answered_time", session=session@entry=0x0, stream=stream@entry=0x7f545e7a7bd0) at src/switch_loadable_module.c:2968
#4  0x00007f5460465590 in switch_console_execute (xcmd=<optimized out>, rec=rec@entry=0, istream=istream@entry=0x7f545e7a7bd0) at src/switch_console.c:393
#5  0x00007f5460465437 in switch_console_execute (xcmd=<optimized out>, rec=rec@entry=0, istream=istream@entry=0x7f545e7a7bd0) at src/switch_console.c:359
#6  0x00007f545c56440c in api_exec (thread=thread@entry=0x0, obj=obj@entry=0x7f545e7a8550) at mod_event_socket.c:1551
#7  0x00007f545c569234 in parse_command (listener=listener@entry=0x7f5454022c28, event=event@entry=0x7f545e7a87e8, reply=reply@entry=0x7f545e7a8810 "", reply_len=512) at mod_event_socket.c:2321
#8  0x00007f545c56a84b in listener_run (thread=<optimized out>, obj=0x7f5454022c28) at mod_event_socket.c:2764
#9  0x00007f54607d3d6c in dummy_worker (opaque=0x7f541f62d868) at threadproc/unix/thread.c:151
#10 0x00007f54603c3ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#11 0x00007f54602e3acf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions