-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Problem with mod_perl in master where crashes after any dialplan call (At least on Ubuntu) #1369
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
Comments
Alright well in looking at something else I ran into an old bug I forgot about that was eerily similar: This is likely due to a newer perl version causing the crash (just like then). At that time the problem was the proper way of calling clone was not happening. For clone's usage and then perl_parse you must call perl_alloc then call perl_construct and finally perl_parse with a null terminated array of parameters and the call must be valid (there we were not passing a correct value to -e). None of the mod_perl code has changed and we are segfaulting at a different spot. While clone is at the top of the stack in this case it is likely not the source of issue. From what I have found as well all the proper initialization is happening. Perl/perl5#15917 is the original bug filed with perl when I thought it was a perl issue. I did run some very old FS copies in the newer perl just to make sure it wasn't a FS change of some sort and it still crashes. I will see if I can track down what perl version broke it first. |
Hi @mitchcapper, I have identified the same problem too. I upgraded from FS 1.6.20 on Ubuntu 16.04 to FS 1.10.7 on Ubuntu 20.04 using self compliled Freeswitch binaries. Ubuntu 16.04 provides perl 5.22, Ubuntu 20.04 provides perl 5.30. The key I found in my trace is also in the first line of your backtrace, 'Perl__invlist_intersection_maybe_complement_2nd'. This relates directly to the perl bug here Perl/perl5#17154 The fix isn't available in perl 5.30, which is included in Ubuntu 20.04. Ubuntu also don't provide backports of perl as they use it too heavily for internal integrations. As my next steps I'm going to try moving to a later Ubuntu release which provides a later release of perl. See here for a list of which perl version is include in each Ubuntu release; https://packages.ubuntu.com/search?keywords=perl Have you tried perl 5.32 or later? |
Confirmed fixed in ubuntu 21/22 along with 20.04 with custom compiled perl (attached sample dockerfile) |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Running the latest master I receive either a segfault or the error "Out of memory!" when mod_perl is called from a diaplan. Sometimes it needs to be called twice to get the error. The "Out of Memory!" error is generated by FS I believe (not an OS memkill) however a quick look at where FS throws that error in source do not show immediately anything related (mostly "src/mod/languages/mod_java/modjava.c" file and "libzrtp"). It is important to note the ! at the end as FS does throw generic "Out of memory" errors in several other places.
I have confirmed that building from source in a very similar manor on Debian Buster does NOT have the same issue (can call it several times at least). @briankwest mentioned this is likely an issue with perl, a perl module, or the perl script itself and not freeswitch. Brian also thought it was related to clone being unsafe to use in a threaded environment, from the BT I believe this is the FS threadpool worker that is calling clone so I am not sure what to do with that.
I am not sure where to go from here. Could potentially try to strace the freeswitch process for when perl is called into but
To Reproduce
Attached are two docker files (.txt annoying but GH requirement).
Dockerfile_DEBIAN_Compiled.txt
andDockerfile_Ubuntu_Compiled.txt
both follow a similar process for building freeswitch and setting up a dummy test. To build rundocker build -f .\Dockerfile_Ubuntu_Compiled.txt -t test_ubuntu .
thendocker run -t -i --rm -p 5060 test_ubuntu
. Once started connect and call extension 9198. Note for some reason Ubuntu in this setup requires it to be called twice to crash. The perl script is very basic justFor reference, you do NOT need to have an ubuntu box to verify this on, any nix box running docker should be fine (the docker base will still be ubuntu).
I also attached the output of the perl build info from both platforms they are exceptionally similar (minus one perl 5.28 vs 5.30). Files:
perl_debian.txt
andperl_ubuntu.txt
.Expected behavior
Perl script to be executed and FS not to crash.
Package version or git hash
bb7bf86
Trace logs
Provide freeswitch logs w/ DEBUG and UUID logging enabled
backtrace from core file
Full set of gdb traces attached to ticket
gdb_bts.log
.gdb_bts.log
perl_ubuntu.txt
perl_debian.txt
Dockerfile_Ubuntu_Compiled.txt
Dockerfile_DEBIAN_Compiled.txt
The text was updated successfully, but these errors were encountered: