Freeradius Server seg fault when initializing python module
Avner Elizarov
avnerelizarov at gmail.com
Wed Sep 13 11:34:31 CEST 2017
Hi,
I'm trying to add the rlm_python module to the freeradius server and After
following the instructions in the documentation
https://wiki.freeradius.org/modules/Rlm_python The server crashes with a
segmentation fault.
When I run it in debug mode the follwing debug information is printed :
Wed Sep 13 09:18:09 2017 : Debug: # Instantiating module "python" from
file /etc/freeradius/mods-enabled/python
Wed Sep 13 09:18:09 2017 : Info: Python version: 2.7.12 (default, Nov 19
2016, 06:48:10) [GCC 5.4.0 20160609]
*Segmentation fault (core dumped)*
I ran freeradius using gdb to check the origin of the segmentation fault
and this is the output:
Program received signal SIGSEGV, Segmentation fault.
__strchr_sse2 () at ../sysdeps/x86_64/multiarch/../strchr.S:32
32 ../sysdeps/x86_64/multiarch/../strchr.S: No such file or directory.
(gdb) bt
#0 __strchr_sse2 () at ../sysdeps/x86_64/multiarch/../strchr.S:32
#1 0x00007ffff53867c1 in PySys_SetPath () from
/usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#2 0x00007ffff57f9d79 in ?? () from /usr/lib/freeradius/rlm_python.so
#3 0x00000000004214e4 in module_instantiate ()
#4 0x00000000004228b5 in modules_init ()
#5 0x000000000040f7dc in main ()
It seems that when the server tries to set the python path to that written
in mods-available/python (python_path = ${modconfdir}/${.:name}) it
crashes.
I've tried different strings for the python path and it still crashes.
When I removed the python_path line from the file and updated the
PYTHONPATH environment variable it worked when running it in debug mode
(freeradius -f -X -xx). However it doesn't work when I run the radius
server as a service (service freeradius start).
The debug output is:
Sep 13 09:26:19 radius-server freeradius[6748]: Python version: 2.7.12
(default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
Sep 13 09:26:19 radius-server freeradius[6748]: python_function_load -
Module 'reorder_tlv' not found
Sep 13 09:26:19 radius-server freeradius[6748]: <type
'exceptions.ImportError'> (No module named reorder_tlv)
Sep 13 09:26:19 radius-server freeradius[6748]: python_function_load -
Failed to import python function 'reorder_tlv.post_auth'
Sep 13 09:26:19 radius-server freeradius[6748]:
/etc/freeradius/mods-enabled/python[8]: Instantiation failed for module
"python"
Sep 13 09:26:19 radius-server systemd[1]: freeradius.service: Control
process exited, code=exited status=1
Sep 13 09:26:19 radius-server sudo[6717]: pam_unix(sudo:session): session
closed for user root
Sep 13 09:26:19 radius-server systemd[1]: Failed to start FreeRADIUS
multi-protocol policy server.
Is someone familiar with this problem? Is there a fix?
Thanks in advance
More information about the Freeradius-Users
mailing list