[Asterisk-code-review] res_hiredis: REDIS DeviceState and Dialplan functions (asterisk[master])

Alec Davis asteriskteam at digium.com
Tue Aug 2 16:46:38 CDT 2022


Attention is currently required from: Sean Bright, N A.
Alec Davis has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/18829 )

Change subject: res_hiredis: REDIS DeviceState and Dialplan functions
......................................................................


Patch Set 18:

(1 comment)

Patchset:

PS18: 
Patchset 18:

Progress, but broken.

Took Joshua's advice, don't allow unload_module, asterisk crashed with double free errors if a phonecall hungup after module was unloaded.

However (but unrelated to these changes) after every thread cleanup (when caller hangs-up) I'm getting 

[Aug  3 09:34:55] DEBUG[824496]: res_hiredis.c:323 hiredis_thread_cleanup: socket_fd[32] released
double free or corruption (out)
Aborted (core dumped)

Thread 1 (Thread 0x7feeb0382640 (LWP 824496) (Exiting)):
#0  __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#1  0x00007feeb279b546 in __GI_abort () at abort.c:79
#2  0x00007feeb27f2ed8 in __libc_message (action=action at entry=do_abort, fmt=fmt at entry=0x7feeb2910c2f "%sn") at ../sysdeps/posix/libc_fatal.c:155
#3  0x00007feeb27fa93a in malloc_printerr (str=str at entry=0x7feeb2913140 "double free or corruption (out)") at malloc.c:5628
#4  0x00007feeb27fc1c0 in _int_free (av=0x7feeb2947b80 <main_arena>, p=0x5631795ad780, have_lock=<optimized out>, have_lock at entry=0) at malloc.c:4547
#5  0x00007feeb27ff9d4 in __GI___libc_free (mem=<optimized out>) at malloc.c:3309
#6  0x00007fee90656d65 in hiredis_thread_cleanup (data=0x5631795ad790) at res_hiredis.c:325
#7  0x00007feeb31bef11 in __nptl_deallocate_tsd () at pthread_create.c:311
#8  0x00007feeb31bfda1 in __nptl_deallocate_tsd () at pthread_create.c:266
#9  start_thread (arg=0x7feeb0382640) at pthread_create.c:492
#10 0x00007feeb2873baf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

What I don't know is how on thread creation how to properly allocate enough threadstorage the size of redisContext, I must be clobbering something when I memcpy the newly allocated memory from redisConnectWithTimeout to threadstorage.

Any guidance would be appreciated.

Alec



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18829
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ifdf4d33d2a2a5fd044fac13b201c7437de34ba6a
Gerrit-Change-Number: 18829
Gerrit-PatchSet: 18
Gerrit-Owner: Alec Davis <alec at bdt.co.nz>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-Attention: Sean Bright <sean at seanbright.com>
Gerrit-Attention: N A <mail at interlinked.x10host.com>
Gerrit-Comment-Date: Tue, 02 Aug 2022 21:46:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220802/994dcc11/attachment.html>


More information about the asterisk-code-review mailing list