Discussion:
[Ipsec-tools-users] racoon: segmentation fault error
Samanvitha Bhargav
2016-06-07 04:35:36 UTC
Permalink
Hi

I downloaded ipsectools from : https://sourceforge.net/projects/ipsec-tools/
and applied a patch as mentioned in :
https://dev.openwrt.org/browser/packages/net/ipsec-tools/patches/006-linux-3.7-compat.patch?rev=35312
Susequently after extracting and applying patch, i used the following
commands,
./bootstrap
autoconf
./configure --prefix=/. --libdir=/usr/lib64 --sbindir=/usr/sbin
--enable-shared --enable-security-context=no CXX=${CROSS_COMPILE}g++
CC=${CROSS_COMPILE}gcc AS=${CROSS_COMPILE}as AR=$ {CROSS_COMPILE}ar
LD=${CROSS_COMPILE}ld NM=${CROSS_COMPILE}nm OBJCOPY=${CROSS_COMPILE}objcopy
OBJDUMP=${CROSS_COMPILE}objdump RANLIB=${CROSS_COMPILE}ranlib
READELF=${CROSS_COMPILE}readelf S TRIP=${CROSS_COMPILE}strip
--with-kernel-headers=${RH_KERNEL_HOME}/include --host=$HOST --build=$BUILD

It compiled successfully.

but then, on usage the racoon crashes with a Segmentation fault.

[***@CLA-0(FBSA-13) /root] racoon -F -f /etc/ipsec/0/ike1/racoon.conf
Foreground mode.
2016-06-07 07:26:39: INFO: @(#)ipsec-tools 0.8.2 (
http://ipsec-tools.sourceforge.net)
Segmentation fault (core dumped)

the gdb analysis of dumped core is given below. Can anybody help me on
this..

[***@CLA-0(FBSA-13) /root] gdb racoon -c
CLA-0-8769-5755262c-racoon-SEGV.core
GNU gdb (GDB) 7.10.1
Copyright (C) 2015 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from racoon...done.
[New LWP 8769]

warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `/usr/sbin/racoon'.
Program terminated with signal SIGSEGV, Segmentation fault.
0 0x00007fefd73633dd in _IO_vfprintf_internal (s=***@entry=0xd69120,
format=<optimized out="">, ***@entry=0x67c180 <buf> "INFO: %s\n",
ap=***@entry=0x7fff9d913268) at vfprintf.c:1632
1632 vfprintf.c: No such file or directory.
(gdb) bt full
0 0x00007fefd73633dd in _IO_vfprintf_internal (s=***@entry=0xd69120,
format=<optimized out="">, ***@entry=0x67c180 <buf> "INFO: %s\n",
ap=***@entry=0x7fff9d913268) at vfprintf.c:1632
len = <optimized out="">
string_malloced = <optimized out="">
step0_jumps = {0, -4893, -4842, 73, 163, -5792, -5690, -5435, -1729, -767,
330, -8653, -8570, -8477, -8382, -8335, -4670, -5165, -1744, -2433, -1333,
-30, -4272, -4176, -1470, -9580,
-2117, -8384, -8477, -5518}
space = <optimized out="">
is_short = <optimized out="">
use_outdigits = <optimized out="">
step1_jumps = {0, 0, 0, 0, 0, 0, 0, 0, 0, -767, 330, -8653, -8570, -8477,
-8382, -8335, -4670, -5165, -1744, -2433, -1333, -30, -4272, -4176, -1470,
-9580, -2117, -8384, -8477, 0}
group = <optimized out="">
prec = <optimized out="">
step2_jumps = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 330, -8653, -8570, -8477,
-8382, -8335, -4670, -5165, -1744, -2433, -1333, -30, -4272, -4176, -1470,
-9580, -2117, -8384, -8477, 0}
string = <optimized out="">
left = <optimized out="">
is_long_double = <optimized out="">
width = <optimized out="">
step3a_jumps = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 0, 0, 0, -8382, -8335,
-4670, -5165, -1744, 0, 0, 0, 0, -4176, 0, 0, 0, 0, 0, 0}
alt = <optimized out="">
showsign = <optimized out="">
is_long = <optimized out="">
is_char = <optimized out="">
pad = <optimized out="">
step3b_jumps = {0 <repeats 11="" times="">, -8570, 0, 0, -8382, -8335,
-4670, -5165, -1744, -2433, -1333, -30, -4272, -4176, -1470, -9580, -2117,
0, 0, 0}
step4_jumps = {0 <repeats 14="" times="">, -8382, -8335, -4670, -5165,
-1744, -2433, -1333, -30, -4272, -4176, -1470, -9580, -2117, 0, 0, 0}
is_negative = <optimized out="">
number = <optimized out="">
base = <optimized out="">
the_arg = {pa_wchar = -1651428480 L'\x9d913380', pa_int = -1651428480,
pa_long_int = 140735836926848, pa_long_long_int = 140735836926848, pa_u_int
= 2643538816,
pa_u_long_int = 140735836926848, pa_u_long_long_int = 140735836926848,
pa_double = 6.9532742164271511e-310, pa_long_double = <invalid float=""
value="">,
pa_string = 0x7fff9d913380 "\230\064\221\235\377\177", pa_wstring =
0x7fff9d913380 L"\x9d913498ç¿¿\001", pa_pointer = 0x7fff9d913380, pa_user =
0x7fff9d913380}
spec = 115 's'
_buffer = {*routine = 0x0, *arg = 0x2fd, *canceltype = -665223168, *prev =
0x7fefd731dd58}
_avail = <optimized out="">
thousands_sep = 0x0
grouping = 0xffffffffffffffff <error: Cannot="" access="" memory="" at=""
address="" 0xffffffffffffffff="">
done = <optimized out="">
f = 0x67c187 <buf+7> "s\n"
lead_str_end = 0x67c186 <buf+6> "%s\n"
end_of_spec = <optimized out="">
work_buffer =
"\270\257\062\327\357\177\000\000:\030\071\330\357\177\000\000\375\002\000\000\000\000\000\000\270\257\062\327\357\177\000\000\000\200Y\330\357\177\000\000\370-\221\235\377\177\000\000\364-\221\235\377\177\000\000\030sY\330\357\177\000\000\211\300\062\327\357\177\000\000\020%2\327\357\177\000\000\370-\221\235\377\177\000\000\363\026\346\365\000\000\000\000[\230\327\003\000\000\000\000\063\000\000\000\377\177\000\000\320.\221\235\377\177\000\000\270\257\062\327\357\177\000\000X\335\061\327\357\177\000\000\364-\221\235\377\177\000\000\300.\221\235\377\177\000\000\270pY\330\357\177\000\000\n",
'\000' <repeats 15="" times="">, "x\223Y\330", '\000' <repeats 12=""
times="">, "O2\221\235\001\000\000\000"...
Reinoud Koornstra
2016-06-20 09:12:09 UTC
Permalink
On Mon, Jun 6, 2016 at 10:35 PM, Samanvitha Bhargav
Post by Samanvitha Bhargav
Hi
I downloaded ipsectools from : https://sourceforge.net/projects/ipsec-tools/
https://dev.openwrt.org/browser/packages/net/ipsec-tools/patches/006-linux-3.7-compat.patch?rev=35312
Susequently after extracting and applying patch, i used the following
commands,
./bootstrap
autoconf
./configure --prefix=/. --libdir=/usr/lib64 --sbindir=/usr/sbin
--enable-shared --enable-security-context=no CXX=${CROSS_COMPILE}g++
CC=${CROSS_COMPILE}gcc AS=${CROSS_COMPILE}as AR=$ {CROSS_COMPILE}ar
LD=${CROSS_COMPILE}ld NM=${CROSS_COMPILE}nm OBJCOPY=${CROSS_COMPILE}objcopy
OBJDUMP=${CROSS_COMPILE}objdump RANLIB=${CROSS_COMPILE}ranlib
READELF=${CROSS_COMPILE}readelf S TRIP=${CROSS_COMPILE}strip
--with-kernel-headers=${RH_KERNEL_HOME}/include --host=$HOST --build=$BUILD
It compiled successfully.
but then, on usage the racoon crashes with a Segmentation fault.
Foreground mode.
(http://ipsec-tools.sourceforge.net)
Segmentation fault (core dumped)
the gdb analysis of dumped core is given below. Can anybody help me on
this..
CLA-0-8769-5755262c-racoon-SEGV.core
GNU gdb (GDB) 7.10.1
Copyright (C) 2015 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-linux-gnu".
Type "show configuration" for configuration details.
http://www.gnu.org/software/gdb/bugs/.
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from racoon...done.
[New LWP 8769]
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `/usr/sbin/racoon'.
Program terminated with signal SIGSEGV, Segmentation fault.
1632 vfprintf.c: No such file or directory.
(gdb) bt full
I've seen a very similar crash in SSL dump/
I wonder that %s was in this case.
Could you replace all -O2 to -O0 after the configure so that no
optimization is done?
That way we can see more instead of optimized out?
Also, what libc lib did you use to compile against?
So it crashes right away upon reading the config?
Post by Samanvitha Bhargav
len = <optimized out="">
string_malloced = <optimized out="">
step0_jumps = {0, -4893, -4842, 73, 163, -5792, -5690, -5435, -1729, -767,
330, -8653, -8570, -8477, -8382, -8335, -4670, -5165, -1744, -2433, -1333,
-30, -4272, -4176, -1470, -9580,
-2117, -8384, -8477, -5518}
space = <optimized out="">
is_short = <optimized out="">
use_outdigits = <optimized out="">
step1_jumps = {0, 0, 0, 0, 0, 0, 0, 0, 0, -767, 330, -8653, -8570, -8477,
-8382, -8335, -4670, -5165, -1744, -2433, -1333, -30, -4272, -4176, -1470,
-9580, -2117, -8384, -8477, 0}
group = <optimized out="">
prec = <optimized out="">
step2_jumps = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 330, -8653, -8570, -8477,
-8382, -8335, -4670, -5165, -1744, -2433, -1333, -30, -4272, -4176, -1470,
-9580, -2117, -8384, -8477, 0}
string = <optimized out="">
left = <optimized out="">
is_long_double = <optimized out="">
width = <optimized out="">
step3a_jumps = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 413, 0, 0, 0, -8382, -8335,
-4670, -5165, -1744, 0, 0, 0, 0, -4176, 0, 0, 0, 0, 0, 0}
alt = <optimized out="">
showsign = <optimized out="">
is_long = <optimized out="">
is_char = <optimized out="">
pad = <optimized out="">
step3b_jumps = {0 <repeats 11="" times="">, -8570, 0, 0, -8382, -8335,
-4670, -5165, -1744, -2433, -1333, -30, -4272, -4176, -1470, -9580, -2117,
0, 0, 0}
step4_jumps = {0 <repeats 14="" times="">, -8382, -8335, -4670, -5165,
-1744, -2433, -1333, -30, -4272, -4176, -1470, -9580, -2117, 0, 0, 0}
is_negative = <optimized out="">
number = <optimized out="">
base = <optimized out="">
the_arg = {pa_wchar = -1651428480 L'\x9d913380', pa_int = -1651428480,
pa_long_int = 140735836926848, pa_long_long_int = 140735836926848, pa_u_int
= 2643538816,
pa_u_long_int = 140735836926848, pa_u_long_long_int = 140735836926848,
pa_double = 6.9532742164271511e-310, pa_long_double = <invalid float=""
value="">,
pa_string = 0x7fff9d913380 "\230\064\221\235\377\177", pa_wstring =
0x7fff9d913380 L"\x9d913498翿\001", pa_pointer = 0x7fff9d913380, pa_user =
0x7fff9d913380}
spec = 115 's'
_buffer = {routine = 0x0, arg = 0x2fd, canceltype = -665223168, prev =
0x7fefd731dd58}
_avail = <optimized out="">
thousands_sep = 0x0
grouping = 0xffffffffffffffff <error: Cannot="" access="" memory="" at=""
address="" 0xffffffffffffffff="">
done = <optimized out="">
f = 0x67c187 <buf+7> "s\n"
lead_str_end = 0x67c186 <buf+6> "%s\n"
end_of_spec = <optimized out="">
work_buffer =
"\270\257\062\327\357\177\000\000:\030\071\330\357\177\000\000\375\002\000\000\000\000\000\000\270\257\062\327\357\177\000\000\000\200Y\330\357\177\000\000\370-\221\235\377\177\000\000\364-\221\235\377\177\000\000\030sY\330\357\177\000\000\211\300\062\327\357\177\000\000\020%2\327\357\177\000\000\370-\221\235\377\177\000\000\363\026\346\365\000\000\000\000[\230\327\003\000\000\000\000\063\000\000\000\377\177\000\000\320.\221\235\377\177\000\000\270\257\062\327\357\177\000\000X\335\061\327\357\177\000\000\364-\221\235\377\177\000\000\300.\221\235\377\177\000\000\270pY\330\357\177\000\000\n",
'\000' <repeats 15="" times="">, "x\223Y\330", '\000' <repeats 12=""
times="">, "O2\221\235\001\000\000\000"...
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning
reports. http://sdm.link/zohomanageengine
_______________________________________________
Ipsec-tools-devel mailing list
https://lists.sourceforge.net/lists/listinfo/ipsec-tools-devel
Rainer Weikusat
2016-06-20 17:25:16 UTC
Permalink
Samanvitha Bhargav <***@gmail.com> writes:

[...]
Post by Samanvitha Bhargav
Foreground mode.
http://ipsec-tools.sourceforge.net)
Segmentation fault (core dumped)
the gdb analysis of dumped core is given below. Can anybody help me on
this..
CLA-0-8769-5755262c-racoon-SEGV.core
GNU gdb (GDB) 7.10.1
Copyright (C) 2015 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-linux-gnu".
Type "show configuration" for configuration details.
http://www.gnu.org/software/gdb/bugs/.
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from racoon...done.
[New LWP 8769]
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `/usr/sbin/racoon'.
Program terminated with signal SIGSEGV, Segmentation fault.
1632 vfprintf.c: No such file or directory.
(gdb) bt full
len = <optimized out="">
string_malloced = <optimized out="">
step0_jumps = {0, -4893, -4842, 73, 163, -5792, -5690, -5435, -1729, -767,
330, -8653, -8570, -8477, -8382, -8335, -4670, -5165, -1744, -2433, -1333,
-30, -4272, -4176, -1470, -9580,
[more of this]

Who on earth is supposed to make any sense of this truckload of randomly
reformatted garbage?

Loading...