Opened 15 years ago

Last modified 7 years ago

#118 closed defect (Fixed)

server crash when exiting

Reported by: arma Owned by:
Priority: Low Milestone:
Component: Core Tor/Tor Version: 0.1.0.1-rc
Severity: Keywords:
Cc: arma Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Mar 31 12:37:21.214 [notice] Interrupt: will shut down in 30 seconds. Interrupt again to exit now.

Mar 31 12:37:21.347 [notice] Sigint received a second time; exiting now.

Segmentation fault

(gdb) where
#0 0x0808d11f in _openssl_locking_cb (mode=9, n=9, file=0x40103857 "rsa_lib.c", line=217)

at crypto.c:1653

#1 0x4007b0b8 in CRYPTO_lock () from /lib/libcrypto.so.2
#2 0x4007b120 in CRYPTO_add_lock () from /lib/libcrypto.so.2
#3 0x4009e987 in RSA_free () from /lib/libcrypto.so.2
#4 0x08088f5d in crypto_free_pk_env (env=0x80d1cd0) at crypto.c:265
#5 0x08066663 in cpuworker_main (data=0x815f7f8) at cpuworker.c:272
#6 0x08086977 in tor_pthread_helper_fn (_data=0x8166278) at compat.c:685
#7 0x40122f77 in pthread_start_thread () from /lib/libpthread.so.0
#8 0x4020deba in thread_start () from /lib/libc.so.6
(gdb) print _openssl_mutexes[n]
Cannot access memory at address 0x24
(gdb) print n
$1 = 9
(gdb) print _openssl_mutexes
$2 = (tor_mutex_t ) 0x0

looks like we free the mutexes before we should?

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (6)

comment:1 Changed 15 years ago by arma

Pardon the miserable markup that flyspray added. Key feature:

1653 tor_mutex_acquire(_openssl_mutexes[n]);

$2 = (tor_mutex_t ) 0x0

from:

#4 0x08088f5d in crypto_free_pk_env (env=0x80d1cd0) at crypto.c:265

#5 0x08066663 in cpuworker_main (data=0x815f7f8) at cpuworker.c:272

comment:2 Changed 15 years ago by nickm

Arg. Look at the stack trace: this is happening in a thread. Apparently, we need to wait for all the threads
to finish before we clean the openssl mutexes up.

comment:3 Changed 15 years ago by nickm

I added a not-quite-a-fix that should make this happen a lot less often. I still need to think about how to
eliminate it completely.

comment:4 Changed 14 years ago by phobos

Does this still happen?

comment:5 Changed 14 years ago by nickm

flyspray2trac: bug closed.
This one has been fixed for a while.

comment:6 Changed 7 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.