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

[bug]: segmentation fault without bundled pjsip #671

Open
1 task done
wbx-github opened this issue Mar 27, 2024 · 12 comments
Open
1 task done

[bug]: segmentation fault without bundled pjsip #671

wbx-github opened this issue Mar 27, 2024 · 12 comments
Labels
bug support-level-extended Functionality with extended support level

Comments

@wbx-github
Copy link

wbx-github commented Mar 27, 2024

Severity

Trivial

Versions

20.7.0

Components/Modules

pjsip

Operating Environment

Hi,
I am using latest Buildroot on a Raspberry PI4 (64 Bit). I am maintaining the Asterisk package for Buildroot. Linux 6.1.61 with glibc 2.38 is used.

Frequency of Occurrence

Constant

Issue Description

With the bundled pjproject Asterisk works fine in my scenario. The Buildroot policy is not to download any source code while compiling a package. So I am trying to use the external pjproject 2.14.
But then Asterisk segfaults.

Relevant log output

gdb stacktrace:
(gdb) bt
#0  0x0000007fa12e4498 in strcmp () from /lib64/libc.so.6
#1  0x0000007f5bb2af84 in record_serializer (tdata=0x7f4c008f58) at res_pjsip/pjsip_distributor.c:85
#2  0x0000007f5bc856cc in endpt_on_tx_msg (endpt=0x55ab2d2b08, tdata=0x7f4c008f58) at ../src/pjsip/sip_endpoint.c:1116
#3  0x0000007f5bc8d028 in pjsip_transport_send (tr=0x55ab252748, tdata=tdata@entry=0x7f4c008f58, addr=addr@entry=0x7f4c009148, addr_len=addr_len@entry=16, token=token@entry=0x7f4c00a4e0, 
    cb=cb@entry=0x7f5bc87274 <stateless_send_transport_cb>) at ../src/pjsip/sip_transport.c:944
#4  0x0000007f5bc87480 in stateless_send_transport_cb (token=token@entry=0x7f4c00a4e0, tdata=tdata@entry=0x7f4c008f58, sent=<optimized out>) at ../src/pjsip/sip_util.c:1286
#5  0x0000007f5bc87afc in stateless_send_resolver_callback (status=<optimized out>, token=0x7f4c00a4e0, addr=<optimized out>) at ../src/pjsip/sip_util.c:1421
#6  0x0000007f5bb36c40 in sip_resolve_invoke_user_callback (data=0x7f4c00b698) at res_pjsip/pjsip_resolver.c:206
#7  0x00000055840e2180 in ast_taskprocessor_execute (tps=tps@entry=0x55ab3e59b8) at taskprocessor.c:1302
#8  0x00000055840e9080 in execute_tasks (data=0x55ab3e59b8) at threadpool.c:1350
#9  0x00000055840e2180 in ast_taskprocessor_execute (tps=0x55ab2d0e08) at taskprocessor.c:1302
#10 0x00000055840e7db4 in threadpool_execute (pool=0x55ab2d1958) at threadpool.c:367
#11 0x00000055840e7dd0 in worker_active (worker=worker@entry=0x7f50000be8) at threadpool.c:1137
#12 0x00000055840e83d0 in worker_start (arg=arg@entry=0x7f50000be8) at threadpool.c:1056
#13 0x00000055840efafc in dummy_start (data=<optimized out>) at utils.c:1607
#14 0x0000007fa12cf584 in ?? () from /lib64/libc.so.6
#15 0x0000007fa13351cc in ?? () from /lib64/libc.so.6

Asterisk Issue Guidelines

  • Yes, I have read the Asterisk Issue Guidelines
@jcolp
Copy link
Member

jcolp commented Mar 27, 2024

Did this occur as a result of upgrading Asterisk? Was Asterisk actually built against the new headers? Looking at the backtrace and where it is, I would only expect such a crash if Asterisk was built against one set of headers but then used against another version or build of PJSIP.

@wbx-github
Copy link
Author

I double checked with a complete rebuild. (make clean && make)
The same issue happens. So this is not an update problem.

@jcolp
Copy link
Member

jcolp commented Mar 27, 2024

What is the output of config.log for Asterisk?

@jcolp
Copy link
Member

jcolp commented Mar 27, 2024

And what arguments were passed to pjproject for building it?

@jcolp
Copy link
Member

jcolp commented Mar 27, 2024

Oh, and finally to confirm: the previous version of Asterisk was built against 2.13 and worked fine?

@jcolp
Copy link
Member

jcolp commented Mar 27, 2024

I also built PJSIP 2.14 externally myself and built Asterisk 20.7.0 against it and confirmed bundled was not used. I ran outgoing call tests, which were successful and did not result in a crash.

@wbx-github
Copy link
Author

Oh, and finally to confirm: the previous version of Asterisk was built against 2.13 and worked fine?

The previous version 20.6.0 and the version included in Buildroot 20.5.2 having the same issues. May be pjsip is the problem?

@jcolp
Copy link
Member

jcolp commented Mar 27, 2024

I can say that I am able to build both together not using bundled, and they work on my system. This would either mean it is your build process, the arguments passed to either PJSIP or Asterisk for building, or something in PJSIP that is only impacting things for you, or some other environmental thing. It doesn't appear to be an outright failure for all.

@wbx-github
Copy link
Author

Asterisk config.log
asterisk.config.log

@wbx-github
Copy link
Author

Pjsip config.log
pjsip.config.log

@jcolp
Copy link
Member

jcolp commented Mar 31, 2024

I am still unable to reproduce this, so that means it is one of the following:

  1. Something environment specific
  2. Something build process specific
  3. Something architecture specific
  4. Something in PJSIP
  5. A combination of the above
  6. Something else

There's nothing else I can add or investigate, and this is in unsupported territory. I will leave it open to see if anyone else has experience or comments.

@jcolp jcolp added support-level-extended Functionality with extended support level and removed triage feedback-required labels Mar 31, 2024
@wbx-github
Copy link
Author

The asterisk system is behind double NAT. But this works with the bundled pjsip as mentioned earlier.
I am attaching my extensions.conf and pjsip.conf for completeness. May be it is this special environment.
extensions.conf.txt
pjsip.conf.txt

arnout pushed a commit to buildroot/buildroot that referenced this issue Apr 28, 2024
See here for changes:
https://downloads.asterisk.org/pub/telephony/asterisk/ChangeLog-20-current.md

There is still an open issue reported upstream:
asterisk/asterisk#671

But it seems it is not reproducible by the asterisk developers, so
update the package so others can make use of it.

Use the external pjsip package, instead of the bundled one.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug support-level-extended Functionality with extended support level
Projects
None yet
Development

No branches or pull requests

3 participants