Today is good day for crashes, as i reinstalled one client, the crash
happens very fast.
Here i present the backtrace:
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-unknown-openbsd5.7"...
Core was generated by `openvpn'.
Program terminated with signal 11, Segmentation fault.
Loaded symbols for /usr/local/sbin/openvpn
Reading symbols from /usr/local/lib/liblzo2.so.0.0...done.
Loaded symbols for /usr/local/lib/liblzo2.so.0.0
Reading symbols from /usr/lib/libssl.so.31.0...done.
Loaded symbols for /usr/lib/libssl.so.31.0
Reading symbols from /usr/lib/libcrypto.so.31.0...done.
Loaded symbols for /usr/lib/libcrypto.so.31.0
Reading symbols from /usr/lib/libc.so.78.1...done.
Loaded symbols for /usr/lib/libc.so.78.1
Reading symbols from /usr/libexec/ld.so...done.
Loaded symbols for /usr/libexec/ld.so
#0  0x00000ae2bb22f170 in memcpy (dst0=0xae340efc548,
src0=0xae31f9e6000, length=Variable "length" is not available.
) at /usr/src/lib/libc/string/memcpy.c:96
96      /usr/src/lib/libc/string/memcpy.c: No such file or directory.
        in /usr/src/lib/libc/string/memcpy.c
(gdb) bt
#0  0x00000ae2bb22f170 in memcpy (dst0=0xae340efc548,
src0=0xae31f9e6000, length=Variable "length" is not available.
) at /usr/src/lib/libc/string/memcpy.c:96
#1  0x00000ae09148871c in x509_get_subject (cert=0xae29a3c2b00,
gc=0x7f7fffff6290) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/ssl_verify_openssl.c:291
#2  0x00000ae091486a24 in verify_cert (session=0xae3300d03a0,
cert=0xae29a3c2b00, cert_depth=0) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/ssl_verify.c:609
#3  0x00000ae091488296 in verify_callback (preverify_ok=1,
ctx=0x7f7fffff6440) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/ssl_verify_openssl.c:84
#4  0x00000ae3474f5d8c in internal_verify (ctx=0x7f7fffff6440) at
/usr/src/lib/libcrypto/crypto/../../libssl/src/crypto/x509/x509_vfy.c:1613
#5  0x00000ae3474f7435 in X509_verify_cert (ctx=0x7f7fffff6440) at
/usr/src/lib/libcrypto/crypto/../../libssl/src/crypto/x509/x509_vfy.c:374
#6  0x00000ae37c3838d0 in ssl_verify_cert_chain (s=0xae305263400,
sk=Variable "sk" is not available.
) at /usr/src/lib/libssl/ssl/../../libssl/src/ssl/ssl_cert.c:459
#7  0x00000ae37c35c260 in ssl3_get_client_certificate (s=0xae305263400)
at /usr/src/lib/libssl/ssl/../../libssl/src/ssl/s3_srvr.c:2540
#8  0x00000ae37c35fc68 in ssl3_accept (s=0xae305263400) at
/usr/src/lib/libssl/ssl/../../libssl/src/ssl/s3_srvr.c:511
#9  0x00000ae37c36cf75 in ssl3_read_bytes (s=0xae305263400, type=23,
buf=0xae36a9ca800 "", len=2048, peek=0) at
/usr/src/lib/libssl/ssl/../../libssl/src/ssl/s3_pkt.c:896
#10 0x00000ae37c38054e in ssl3_read_internal (s=0xae305263400,
buf=0xae36a9ca800, len=2048, peek=0) at
/usr/src/lib/libssl/ssl/../../libssl/src/ssl/s3_lib.c:2784
#11 0x00000ae37c354761 in ssl_read (b=0xae3379c4800, out=0xae36a9ca800
"", outl=2048) at /usr/src/lib/libssl/ssl/../../libssl/src/ssl/bio_ssl.c:156
#12 0x00000ae34753843f in BIO_read (b=0xae3379c4800, out=0xae36a9ca800,
outl=2048) at
/usr/src/lib/libcrypto/crypto/../../libssl/src/crypto/bio/bio_lib.c:217
#13 0x00000ae091484c58 in bio_read (bio=0xae3379c4800,
buf=0xae3300d0578, maxlen=2048, desc=0xae0915ac83c "tls_read_plaintext")
    at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/ssl_openssl.c:1094
#14 0x00000ae091485170 in key_state_read_plaintext
(ks_ssl=0xae3300d0488, buf=0xae3300d0578, maxlen=2048) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/ssl_openssl.c:1249
#15 0x00000ae09147fab3 in tls_process (multi=0xae3300d0150,
session=0xae3300d03a0, to_link=0xae3300cfe48,
to_link_addr=0x7f7fffff69f0, to_link_socket_info=0xae2af011448,
    wakeup=0x7f7fffff6a74) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/ssl.c:2411
#16 0x00000ae09148080f in tls_multi_process (multi=0xae3300d0150,
to_link=0xae3300cfe48, to_link_addr=0xae3300cfb78,
to_link_socket_info=0xae2af011448, wakeup=0x7f7fffff6a74)
    at /usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/ssl.c:2635
#17 0x00000ae0914155de in check_tls_dowork (c=0xae3300cf378) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/forward.c:100
#18 0x00000ae091419803 in check_tls (c=0xae3300cf378) at forward-inline.h:41
#19 0x00000ae091419744 in pre_select (c=0xae3300cf378) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/forward.c:1330
#20 0x00000ae09143e797 in multi_process_post (m=0x7f7fffff6c20,
mi=0xae3300cf2c0, flags=5) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/multi.c:2050
#21 0x00000ae09143f008 in multi_process_incoming_link (m=0x7f7fffff6c20,
instance=0x0, mpp_flags=5) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/multi.c:2293
#22 0x00000ae091438d75 in multi_process_io_udp (m=0x7f7fffff6c20) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/mudp.c:173
#23 0x00000ae0914390fd in tunnel_server_udp_single_threaded
(top=0x7f7fffff7a30) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/mudp.c:266
#24 0x00000ae09143952a in tunnel_server_udp (top=0x7f7fffff7a30) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/mudp.c:288
#25 0x00000ae09144065b in tunnel_server (top=0x7f7fffff7a30) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/multi.c:2875
#26 0x00000ae091442b40 in openvpn_main (argc=7, argv=0x7f7fffff8748) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/openvpn.c:254
#27 0x00000ae091442c82 in main (argc=7, argv=0x7f7fffff8748) at
/usr/ports/pobj/openvpn-2.3.6/openvpn-2.3.6/src/openvpn/openvpn.c:325





On 23.02.2015 18:46, Stuart Henderson wrote:
> On 2015/02/23 15:55, Alexander Haensch wrote:
>>> Synopsis: OpenVPN process crashes from time to time
>>> Category: OpenVPN
>>> Environment:
>>      System      : OpenBSD 5.7
>>      Details     : OpenBSD 5.7-beta (GENERIC.MP) #828: Thu Jan 29 14:28:19 
>> MST 2015
>>                       
>> [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
>>
>>      Architecture: OpenBSD.amd64
>>      Machine     : amd64
>>> Description:
>>      The OpenVPN Server process configured with a tap device is crashing 
>> during Handshake after some days of operation.
>>      The exact reason is not yet clear to me, but i can maybe gather some 
>> log files as this happens pretty much every 10 days.
>>      I think that something is accumulating and finally ending the process.
>>      
>>> How-To-Repeat:
>>      Let the server run and wait until the process crashes.
>>> Fix:
>>      I use monit to automatically start OpenVPN again. I think this is a bad 
>> idea.
> Log entries from around the time of the crash (both from openvpn and
> OS messages from /var/log/messages) would be helpful.
>
> Is there a core dump anywhere? If not, you might be able to get one in
> /var/crash by setting sysctl kern.nosuidcoredump=2, but it would be
> helpful to run a build of openvpn from ports done with 'make clean=all;
> make DEBUG="-O0 -g" repackage && sudo make reinstall' as this will
> increase the amount of information available if there is a coredump.
> (If you can get one, use gdb to obtain a backtrace and send that,
> rather than sending the file itself).
>
>> dmesg:
>> OpenBSD 5.7-beta (GENERIC.MP) #828: Thu Jan 29 14:28:19 MST 2015
>>     [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> (real/avail mem lines snipped to protect the innocent ;)
>

-- 

Dipl. Chem. Alexander Haensch
AG Weimar
Institute of Theoretical and Physical Chemistry
Eberhard Karls University Tübingen
Auf der Morgenstelle 15
72076 Tuebingen
Germany
Tel: +49(0) 7071 2978768
Fax: +49(0) 7071 295960 

Reply via email to