Skip to content
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

Segmentation fault on drop server #17

Open
TerehinAV opened this issue Oct 26, 2020 · 0 comments
Open

Segmentation fault on drop server #17

TerehinAV opened this issue Oct 26, 2020 · 0 comments

Comments

@TerehinAV
Copy link

TerehinAV commented Oct 26, 2020

Hi!
I've configured 2 ami hosts (both are works well)
When I try to Drop one of them, using ProxyAction=DropServer, astmanproxy fails on Segmentation fault

astmanproxy: Version 1.30.0, (C) David C. Troy 2005-2008

Here gdb log:

[root@MYHOST services]# gdb -args astmanproxy -ddddddddd
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-119.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/sbin/astmanproxy...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/local/sbin/astmanproxy -ddddddddd
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Oct 26 14:14:51: config: parsing configuration file: /etc/asterisk/astmanproxy.conf
Oct 26 14:14:51: config: host, AMI_HOST_TO_DROP,5038,admin,AMI_1ST_PASS,off,off
Oct 26 14:14:51: config: host, AMI_HOST_SECOND,5038,admin,AMI_2ND_PASS,off,off
Oct 26 14:14:51: config: retryinterval, 2
Oct 26 14:14:51: config: maxretries, 0
Oct 26 14:14:51: config: sslclienthellotimeout, 200
Oct 26 14:14:51: config: acceptencryptedconnection, yes
Oct 26 14:14:51: config: acceptunencryptedconnection, yes
Oct 26 14:14:51: config: asteriskwritetimeout, 100
Oct 26 14:14:51: config: clientwritetimeout, 200
Oct 26 14:14:51: config: listenaddress, *
Oct 26 14:14:51: config: listenport, 5039
Oct 26 14:14:51: config: authrequired, no
Oct 26 14:14:51: config: proc_user, asterisk
Oct 26 14:14:51: config: proc_group, asterisk
Oct 26 14:14:51: config: inputformat, http
Oct 26 14:14:51: config: outputformat, standard
Oct 26 14:14:51: config: autofilter, on
Oct 26 14:14:51: config: logfile, /var/log/asterisk/astmanproxy.log
Oct 26 14:14:51: SSL critical error: Failed to use the certificate file!
Oct 26 14:14:51: loading handlers
Oct 26 14:14:51: loading: module xml (/usr/lib/astmanproxy/modules/xml.so)
Oct 26 14:14:51: loading: note, xml_onconnect does not exist; ignoring
Oct 26 14:14:51: loading: module standard (/usr/lib/astmanproxy/modules/standard.so)
Oct 26 14:14:51: loading: module csv (/usr/lib/astmanproxy/modules/csv.so)
Oct 26 14:14:51: loading: note, csv_read does not exist; ignoring
Oct 26 14:14:51: loading: note, csv_onconnect does not exist; ignoring
Oct 26 14:14:51: loading: module http (/usr/lib/astmanproxy/modules/http.so)
Oct 26 14:14:51: loading: note, http_write does not exist; ignoring
Oct 26 14:14:51: loading: note, http_onconnect does not exist; ignoring
Oct 26 14:14:51: loaded handlers
Oct 26 14:14:51: config: parsing configuration file: /etc/asterisk/astmanproxy.users
Oct 26 14:14:51: Client SSL Context Initialized
Oct 26 14:14:51: asterisk@AMI_HOST_SECOND: Allocated server session
Oct 26 14:14:51: Set AMI_HOST_SECOND input format to standard
Oct 26 14:14:51: Set AMI_HOST_SECOND output format to standard
[New Thread 0x7ffff4abf700 (LWP 11478)]
Oct 26 14:14:51: launched ast AMI_HOST_SECOND thread!
Oct 26 14:14:51: asterisk@AMI_HOST_SECOND: Connecting (u=admin, p=AMI_2ND_PASS, ssl=off)
Oct 26 14:14:51: returning ast_connect with 9
Oct 26 14:14:51: Transmitting standard block of 4 lines, fd 9
Oct 26 14:14:51: asterisk@AMI_HOST_SECOND: attempting read...
Oct 26 14:14:51: get_input returned line 1, res 0, 
Oct 26 14:14:51: get_input returned line 1, res 1, Asterisk Call Manager/2.10.4
Oct 26 14:14:51: get_input returned line 2, res 0, 
Oct 26 14:14:51: get_input returned line 2, res 1, Response: Success
Oct 26 14:14:51: get_input returned line 3, res 1, Message: Authentication accepted
Oct 26 14:14:51: get_input returned line 4, res 1, 
Oct 26 14:14:51: Returning standard block of 3 lines, res 1
Oct 26 14:14:51: asterisk@AMI_HOST_SECOND got: Asterisk Call Manager/2.10.4
Oct 26 14:14:51: asterisk@AMI_HOST_SECOND got: Response: Success
Oct 26 14:14:51: asterisk@AMI_HOST_SECOND got: Message: Authentication accepted
Oct 26 14:14:51: asterisk@AMI_HOST_SECOND: connected successfully!
Oct 26 14:14:51: asterisk@AMI_HOST_SECOND: connected successfully (No Fullybooted)!
Oct 26 14:14:51: asterisk@AMI_HOST_SECOND: attempting read...
Oct 26 14:14:51: asterisk@AMI_HOST_TO_DROP: Allocated server session
Oct 26 14:14:51: Set AMI_HOST_TO_DROP input format to standard
Oct 26 14:14:51: Set AMI_HOST_TO_DROP output format to standard
[New Thread 0x7ffff3ebd700 (LWP 11480)]
Oct 26 14:14:51: launched ast AMI_HOST_TO_DROP thread!
Oct 26 14:14:51: Listening for connections
Oct 26 14:14:51: asterisk@AMI_HOST_TO_DROP: Connecting (u=admin, p=AMI_1ST_PASS, ssl=off)
Oct 26 14:14:51: returning ast_connect with 10
Oct 26 14:14:51: Transmitting standard block of 4 lines, fd 10
Oct 26 14:14:51: asterisk@AMI_HOST_TO_DROP: attempting read...
Oct 26 14:14:51: get_input returned line 1, res 0, 
Oct 26 14:14:51: get_input returned line 1, res 1, Asterisk Call Manager/2.10.4
Oct 26 14:14:51: get_input returned line 2, res 0, 
Oct 26 14:14:51: get_input returned line 2, res 1, Response: Success
Oct 26 14:14:51: get_input returned line 3, res 1, Message: Authentication accepted
Oct 26 14:14:51: get_input returned line 4, res 1, 
Oct 26 14:14:51: Returning standard block of 3 lines, res 1
Oct 26 14:14:51: asterisk@AMI_HOST_TO_DROP got: Asterisk Call Manager/2.10.4
Oct 26 14:14:51: asterisk@AMI_HOST_TO_DROP got: Response: Success
Oct 26 14:14:51: asterisk@AMI_HOST_TO_DROP got: Message: Authentication accepted
Oct 26 14:14:51: asterisk@AMI_HOST_TO_DROP: connected successfully!
Oct 26 14:14:51: asterisk@AMI_HOST_TO_DROP: connected successfully (No Fullybooted)!
Oct 26 14:14:51: asterisk@AMI_HOST_TO_DROP: attempting read...
Oct 26 14:14:56: is_encrypted: 0
Oct 26 14:14:56: Connection received from CLIENT_HOST
Oct 26 14:14:56: Set CLIENT_HOST input format to http
Oct 26 14:14:56: Set CLIENT_HOST output format to standard
[New Thread 0x7ffff32bb700 (LWP 11711)]
Oct 26 14:14:56: calling http_read...
Oct 26 14:14:56: res=0, line: 
Oct 26 14:14:56: res=1, line: GET /?ProxyAction=DropServer&Server=AMI_HOST_TO_DROP HTTP/1.1
Oct 26 14:14:56: Got http: GET /?ProxyAction=DropServer&Server=AMI_HOST_TO_DROP HTTP/1.1 (57 bytes)
Oct 26 14:14:56: res=1, line: Host: MYHOST:5039
Oct 26 14:14:56: Got http: Host: MYHOST:5039 (53 bytes)
Oct 26 14:14:56: res=1, line: Connection: keep-alive
Oct 26 14:14:56: Got http: Connection: keep-alive (22 bytes)
Oct 26 14:14:56: res=1, line: Cache-Control: max-age=0
Oct 26 14:14:56: Got http: Cache-Control: max-age=0 (24 bytes)
Oct 26 14:14:56: res=1, line: Upgrade-Insecure-Requests: 1
Oct 26 14:14:56: Got http: Upgrade-Insecure-Requests: 1 (28 bytes)
Oct 26 14:14:56: res=1, line: User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
Oct 26 14:14:56: Got http: User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 (117 bytes)
Oct 26 14:14:56: res=1, line: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Oct 26 14:14:56: Got http: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 (143 bytes)
Oct 26 14:14:56: res=1, line: Accept-Encoding: gzip, deflate
Oct 26 14:14:56: Got http: Accept-Encoding: gzip, deflate (30 bytes)
Oct 26 14:14:56: res=1, line: Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
Oct 26 14:14:56: Got http: Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7 (52 bytes)
Oct 26 14:14:56: res=1, line: 
Oct 26 14:14:56: http header: HTTP/1.1 200 OK
Date: Mon, 26 Oct 2020 14:14:56 +0300
Content-Type: text/plain
Connection: close
Server: Asterisk Call Manager Proxy/1.30.0

Oct 26 14:14:56: n: ProxyAction=DropServer&Server=AMI_HOST_TO_DROP, v: DropServer&Server=AMI_HOST_TO_DROP
Oct 26 14:14:56: got hdr: ProxyAction: DropServer
Oct 26 14:14:56: n: Server=AMI_HOST_TO_DROP, v: AMI_HOST_TO_DROP
Oct 26 14:14:56: got hdr: Server: AMI_HOST_TO_DROP
Oct 26 14:14:56: http_read result = 1
Oct 26 14:14:56: client@CLIENT_HOST got: ProxyAction: DropServer
Oct 26 14:14:56: client@CLIENT_HOST got: Server: AMI_HOST_TO_DROP
Oct 26 14:14:56: Connection closed: AMI_HOST_TO_DROP
Oct 26 14:14:56: Freed entire stack.
Oct 26 14:14:56: Dropping Server AMI_HOST_TO_DROP
Oct 26 14:14:56: Transmitting standard block of 2 lines, fd 12
Oct 26 14:14:56: calling http_read...
Oct 26 14:14:57: http_read result = -1
Oct 26 14:14:57: Connection closed: CLIENT_HOST
Oct 26 14:14:57: Freed entire stack.
Oct 26 14:14:57: --- exiting session_do thread ---
Oct 26 14:14:57: get_input returned line 1, res -1, 
Oct 26 14:14:57: Read error -1 getting line
Oct 26 14:14:57: Returning standard block of 0 lines, res -1

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff3ebd700 (LWP 11480)]
0x0000000000405dab in HandleAsterisk ()
(gdb) 


(gdb) 
(gdb) 
(gdb) 
(gdb) thread apply all bt

Thread 4 (Thread 0x7ffff32bb700 (LWP 11711)):
#0  read_sleb128 (p=0x7ffff40bc215 "x\020\001\033\f\a\b\220\001", val=val@entry=0x7ffff327a950) at ../../../libgcc/unwind-pe.h:154
#1  0x00007ffff40b7dad in extract_cie_info (fs=0x7ffff327a9b0, context=0x7ffff327ab60, cie=0x7ffff40bc208) at ../../../libgcc/unwind-dw2.c:443
#2  uw_frame_state_for (context=context@entry=0x7ffff327ab60, fs=fs@entry=0x7ffff327a9b0) at ../../../libgcc/unwind-dw2.c:1262
#3  0x00007ffff40b86ed in uw_init_context_1 (context=context@entry=0x7ffff327ab60, outer_cfa=outer_cfa@entry=0x7ffff327ad90, outer_ra=0x7ffff7757322 <__GI___pthread_unwind+66>)
    at ../../../libgcc/unwind-dw2.c:1566
#4  0x00007ffff40b8cd6 in _Unwind_ForcedUnwind (exc=0x7ffff32bbd70, stop=stop@entry=0x7ffff77571a0 <unwind_stop>, stop_argument=0x7ffff32bae30) at ../../../libgcc/unwind.inc:201
#5  0x00007ffff7757322 in __GI___pthread_unwind (buf=<optimized out>) at unwind.c:129
#6  0x00007ffff7751eb7 in __do_cancel () at pthreadP.h:285
#7  __pthread_exit (value=<optimized out>) at pthread_exit.c:28
#8  0x0000000000405496 in session_do ()
#9  0x00007ffff7750e65 in start_thread (arg=0x7ffff32bb700) at pthread_create.c:307
#10 0x00007ffff747988d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 3 (Thread 0x7ffff3ebd700 (LWP 11480)):
#0  0x0000000000405dab in HandleAsterisk ()
#1  0x00007ffff7750e65 in start_thread (arg=0x7ffff3ebd700) at pthread_create.c:307
#2  0x00007ffff747988d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7ffff4abf700 (LWP 11478)):
#0  0x00007ffff746ebed in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x000000000040790e in get_input ()
#2  0x00007ffff54d9a34 in _read () from /usr/lib/astmanproxy/modules/standard.so
#3  0x0000000000405af2 in HandleAsterisk ()
#4  0x00007ffff7750e65 in start_thread (arg=0x7ffff4abf700) at pthread_create.c:307
#5  0x00007ffff747988d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7ffff7fe4840 (LWP 11473)):
#0  0x00007ffff7470953 in select () at ../sysdeps/unix/syscall-template.S:81
#1  0x000000000040aa5d in is_encrypt_request ()
#2  0x0000000000403ee3 in main ()

Maybe I'm doing something wrong with proxy action?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant