Tor issueshttps://gitlab.torproject.org/tpo/core/tor/-/issues2020-11-09T18:16:57Zhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27813Tor 0.3.4.8 is leaking memory2020-11-09T18:16:57ZTracTor 0.3.4.8 is leaking memoryI upgraded to Tor 0.3.4.8 yesterday and today the process has been killed by the oom killer.
Out of memory: Kill process 1369 (tor) score 338 or sacrifice child.
It seems Tor is leaking memory until there is nothing left.
**Trac**:
...I upgraded to Tor 0.3.4.8 yesterday and today the process has been killed by the oom killer.
Out of memory: Kill process 1369 (tor) score 338 or sacrifice child.
It seems Tor is leaking memory until there is nothing left.
**Trac**:
**Username**: anongTor: 0.3.5.x-finalhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27812memwipe + arm, error: implicit declaration, error: nested extern2020-06-27T13:52:04ZTracmemwipe + arm, error: implicit declaration, error: nested externSomewhere between 0.3.3 and 0.3.4, a compilation error was introduced on arm achhitectures+compilers. On armhf and arm64,
```
gcc -DHAVE_CONFIG_H -I. -I./src/ext -Isrc/ext -I./src/ext/trunnel -I./src/trunnel -I./src/common -Isrc/commo...Somewhere between 0.3.3 and 0.3.4, a compilation error was introduced on arm achhitectures+compilers. On armhf and arm64,
```
gcc -DHAVE_CONFIG_H -I. -I./src/ext -Isrc/ext -I./src/ext/trunnel -I./src/trunnel -I./src/common -Isrc/common -I./src/ext/trunnel -I./src/trunnel -I./src/or -Isrc/or -DSHARE_DATADIR="\"/share\"" -DLOCALSTATEDIR="\"/var\"" -DBINDIR="\"/bin\"" -I./src -DTOR_UNIT_TESTS -DHAVE_MODULE_DIRAUTH=1 -I./src/common -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector --param ssp-buffer-size=1 -fPIE -fasynchronous-unwind-tables -Wall -fno-strict-aliasing -Waddress -Warray-bounds -Wdate-time -Wdouble-promotion -Wextra -Wfloat-conversion -Winit-self -Wlogical-op -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wnormalized=nfkc -Woverlength-strings -Woverride-init -Wshadow -Wshift-count-negative -Wshift-count-overflow -Wsizeof-array-argument -Wstrict-overflow=1 -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wswitch-bool -Wsync-nand -Wtrampolines -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-local-typedefs -Wvariadic-macros -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wnested-externs -Wbad-function-cast -Wswitch-enum -Waggregate-return -Wpacked -Wunused -Wunused-parameter -Wold-style-definition -Wmissing-declarations -Werror -MT src/common/src_common_libor_crypto_testing_a-compress.o -MD -MP -MF src/common/.deps/src_common_libor_crypto_testing_a-compress.Tpo -c -o src/common/src_common_libor_crypto_testing_a-compress.o `test -f 'src/common/compress.c' || echo './'`src/common/compress.c
src/common/aes.c: In function ‘aes_cipher_free_’:
src/common/aes.c:339:3: error: implicit declaration of function ‘memwipe’ [-Werror=implicit-function-declaration]
memwipe(cipher, 0, sizeof(aes_cnt_cipher_t));
^
src/common/aes.c:339:3: error: nested extern declaration of ‘memwipe’ [-Werror=nested-externs]
```
https://launchpadlibrarian.net/389494248/buildlog_snap_ubuntu_xenial_arm64_tor-middle-relay_BUILDING.txt.gz
https://launchpadlibrarian.net/389493997/buildlog_snap_ubuntu_xenial_armhf_tor-middle-relay_BUILDING.txt.gz
**Trac**:
**Username**: chadmillerTor: 0.3.5.x-finalhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27808tor 0.3.5.early-alpha: Raw assertion failed at smartlist_core.c::191191 : idx>=02020-06-27T13:52:05ZTractor 0.3.5.early-alpha: Raw assertion failed at smartlist_core.c::191191 : idx>=0I'm seeing this error in 0.3.5.2-alpha which crashes tor soon after starting and was seeing it earlier in 0.3.5.1-alpha.
My build (on Debian 64bit) identifies as Tor 0.3.5.2-alpha (git-1a85ac8c2de77f40) running on Linux with Libevent 2....I'm seeing this error in 0.3.5.2-alpha which crashes tor soon after starting and was seeing it earlier in 0.3.5.1-alpha.
My build (on Debian 64bit) identifies as Tor 0.3.5.2-alpha (git-1a85ac8c2de77f40) running on Linux with Libevent 2.1.8-stable, OpenSSL 1.0.1t, Zlib 1.2.8, Liblzma N/A, and Libzstd 1.3.2.
Do let me know if you'd like to see some of the config context.
```
INTERNAL ERROR: Raw assertion failed at
src/lib/smartlist_core/smartlist_core.c::191191: : idx>=0
./tor(dump_stack_symbols_to_error_fds+0x31)[0x55b21eaab571]
./tor(tor_raw_assertion_failed_msg_+0x86)[0x55b21eaabbf6]
./tor(smartlist_del+0xbf)[0x55b21eaaa36f]
./tor(retry_all_listeners+0x441)[0x55b21ea37911]
./tor(+0x533db)[0x55b21e90e3db]
./tor(+0x5bed1)[0x55b21e916ed1]
/usr/lib/x86_64-linux-gnu/libevent-2.1.so.6(+0x22c05)[0x7f5bd5b5dc05]
/usr/lib/x86_64-linux-gnu/libevent-2.1.so.6(event_base_loop+0x5a7)[0x7f5bd5b5e537]
./tor(do_main_loop+0x203)[0x55b21e913843]
./tor(tor_run_main+0x11f5)[0x55b21e915cc5]
./tor(tor_main+0x3a)[0x55b21e90e07a]
./tor(main+0x19)[0x55b21e90dbd9]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f5bd4aa1b45]
./tor(+0x52c29)[0x55b21e90dc29]
./tor(dump_stack_symbols_to_error_fds+0x31)[0x55b21eaab571]
./tor(tor_raw_assertion_failed_msg_+0x86)[0x55b21eaabbf6]
./tor(smartlist_del+0xbf)[0x55b21eaaa36f]
./tor(retry_all_listeners+0x441)[0x55b21ea37911]
./tor(+0x533db)[0x55b21e90e3db]
./tor(+0x5bed1)[0x55b21e916ed1]
/usr/lib/x86_64-linux-gnu/libevent-2.1.so.6(+0x22c05)[0x7f5bd5b5dc05]
/usr/lib/x86_64-linux-gnu/libevent-2.1.so.6(event_base_loop+0x5a7)[0x7f5bd5b5e537]
./tor(do_main_loop+0x203)[0x55b21e913843]
./tor(tor_run_main+0x11f5)[0x55b21e915cc5]
./tor(tor_main+0x3a)[0x55b21e90e07a]
./tor(main+0x19)[0x55b21e90dbd9]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f5bd4aa1b45]
./tor(+0x52c29)[0x55b21e90dc29]
```
**Trac**:
**Username**: jchevaliTor: 0.3.5.x-finalrl1987rl1987https://gitlab.torproject.org/tpo/core/tor/-/issues/27804rust protover_all_supported() NULL pointer dereference2020-06-27T13:52:05Zteorrust protover_all_supported() NULL pointer dereferenceWhen missing_out is NULL, Rust still assigns to *missing_outWhen missing_out is NULL, Rust still assigns to *missing_outTor: 0.3.5.x-finalAlexander Færøyahf@torproject.orgAlexander Færøyahf@torproject.orghttps://gitlab.torproject.org/tpo/core/tor/-/issues/27803rust protover_all_supported() double-free of *missing_out2020-06-27T13:52:05Zteorrust protover_all_supported() double-free of *missing_out`*missing_out` is allocated in Rust, deallocated in Rust (when the function returns), used in C, and then freed in C`*missing_out` is allocated in Rust, deallocated in Rust (when the function returns), used in C, and then freed in CTor: 0.3.5.x-finalhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27800Non-fatal assertion !(old) failed in node_add_to_ed25519_map2020-06-27T13:52:05ZStefani BanerianNon-fatal assertion !(old) failed in node_add_to_ed25519_mapthis error showed up in my logs today:
(happened on the directory authority `bastet`)
```
[warn] tor_bug_occurred_(): Bug: ../src/or/nodelist.c:297: node_add_to_ed25519_map: Non-fatal assertion !(old) failed. (on Tor 0.3.4.8 )
[warn] ...this error showed up in my logs today:
(happened on the directory authority `bastet`)
```
[warn] tor_bug_occurred_(): Bug: ../src/or/nodelist.c:297: node_add_to_ed25519_map: Non-fatal assertion !(old) failed. (on Tor 0.3.4.8 )
[warn] Bug: Non-fatal assertion !(old) failed in node_add_to_ed25519_map at ../src/or/nodelist.c:297. Stack trace: (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(log_backtrace+0x44) [0x560fb19f0354] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(tor_bug_occurred_+0xb9) [0x560fb1a0b2f9] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(+0x648b1) [0x560fb18cc8b1] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(nodelist_set_routerinfo+0x13f) [0x560fb18ce9ef] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(+0x9d7ec) [0x560fb19057ec] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(router_add_to_routerlist+0x814) [0x560fb190bb94] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(dirserv_add_descriptor+0x228) [0x560fb19aefa8] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(dirserv_add_multiple_descriptors+0x154) [0x560fb19af294] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(connection_dir_process_inbuf+0xabc) [0x560fb19a494c] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(connection_handle_read+0xa27) [0x560fb197d717] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(+0x53afe) [0x560fb18bbafe] (on Tor 0.3.4.8 )
[warn] Bug: /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5(event_base_loop+0x6a0) [0x7fefd7df25a0] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(do_main_loop+0x265) [0x560fb18bde95] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(tor_run_main+0x1175) [0x560fb18c0685] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(tor_main+0x3a) [0x560fb18b84ba] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(main+0x19) [0x560fb18b8229] (on Tor 0.3.4.8 )
[warn] Bug: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1) [0x7fefd664e2e1] (on Tor 0.3.4.8 )
[warn] Bug: /usr/bin/tor(_start+0x2a) [0x560fb18b827a] (on Tor 0.3.4.8 )
```Tor: 0.3.5.x-finalTaylor YuTaylor Yuhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27799Split routerlist.c and dirserv.c into smaller modules2020-06-27T13:52:06ZNick MathewsonSplit routerlist.c and dirserv.c into smaller modulesThese are a couple of the biggest modules in Tor, and they have a bunch of responsibilities each.
Per discussion, we're going to try to put more code movement into 0.3.5, to reduce the number of code-movement releases we need to merge a...These are a couple of the biggest modules in Tor, and they have a bunch of responsibilities each.
Per discussion, we're going to try to put more code movement into 0.3.5, to reduce the number of code-movement releases we need to merge across.
See branch `split_routerlist_dirserv` with PR at https://github.com/torproject/tor/pull/363 .Tor: 0.3.5.x-finalNick MathewsonNick Mathewsonhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27795Possible fd leak on 0.3.5.1-alpha2020-06-27T13:52:06ZDavid Gouletdgoulet@torproject.orgPossible fd leak on 0.3.5.1-alphaIt has been reported by toralf and moria1 so far that their relay ran out of file descriptor.
toralf's relay ended up in 100% CPU situation whereas I believe moria1 stopped working properly as a dirauth.
The DoS status was normal so th...It has been reported by toralf and moria1 so far that their relay ran out of file descriptor.
toralf's relay ended up in 100% CPU situation whereas I believe moria1 stopped working properly as a dirauth.
The DoS status was normal so the winning theory so far is a FD leak in 035.Tor: 0.3.5.x-finalNick MathewsonNick Mathewsonhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27782nss: tor_tls_release_socket() won't catch invalid socket value2020-06-27T13:52:07ZDavid Gouletdgoulet@torproject.orgnss: tor_tls_release_socket() won't catch invalid socket valueFrom commit ae5692994fc31cc5fa25fb5681e59e326e6c5dbe:
```
+ tor_socket_t sock =
+ tor_open_socket_nonblocking(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ if (!sock) {
+ log_warn(LD_NET, "Out of sockets when trying to shut down an NSS ...From commit ae5692994fc31cc5fa25fb5681e59e326e6c5dbe:
```
+ tor_socket_t sock =
+ tor_open_socket_nonblocking(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ if (!sock) {
+ log_warn(LD_NET, "Out of sockets when trying to shut down an NSS "
+ "connection");
+ return;
+ }
```
A socket value of `0` is a _valid_ socket but not only that, if `socket()` did ran out of fd, `-1` will be returned (or other errors would send back `TOR_INVALID_SOCKET = -1`).
So we probably want `if (sock < 0) {}`Tor: 0.3.5.x-finalhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27781FTBFS on older arm2020-06-27T13:52:07Zweasel (Peter Palfrader)FTBFS on older arm0.3.5.1-alpha failed to build on arm64/armhf/armel jessie, stretch (only arm64), trusty, xenial, and artful.
Looking at some of the logs, this comes up repeatedly:
```
src/lib/libtor-crypt-ops.a(src_lib_libtor_crypt_ops_a-aes_openssl.o)...0.3.5.1-alpha failed to build on arm64/armhf/armel jessie, stretch (only arm64), trusty, xenial, and artful.
Looking at some of the logs, this comes up repeatedly:
```
src/lib/libtor-crypt-ops.a(src_lib_libtor_crypt_ops_a-aes_openssl.o): In function `aes_set_iv':
./build/../src/lib/crypt_ops/aes_openssl.c:399: undefined reference to `get_uint32'
./build/../src/lib/crypt_ops/aes_openssl.c:400: undefined reference to `get_uint32'
./build/../src/lib/crypt_ops/aes_openssl.c:401: undefined reference to `get_uint32'
```
https://jenkins.torproject.org/view/packages%20-%20debian/job/tor-debian-release-binaries-arm/44/
Cheers,Tor: 0.3.5.x-finalhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27772Compile without warnings on GCC 8.2.0 with LTO enabled2020-06-27T13:52:07ZNick MathewsonCompile without warnings on GCC 8.2.0 with LTO enabledI propose that we should try to build without warnings on GCC 8.2.0 when the LTO option is enabled. (See legacy/trac#27728)
With LTO, the compiler generates some spurious warnings, but some warnings that reflect real cross-module issue...I propose that we should try to build without warnings on GCC 8.2.0 when the LTO option is enabled. (See legacy/trac#27728)
With LTO, the compiler generates some spurious warnings, but some warnings that reflect real cross-module issues that we should care about.Tor: 0.3.5.x-finalNick MathewsonNick Mathewsonhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27765Appveyor: only install packages for the current target2020-06-27T13:52:07ZteorAppveyor: only install packages for the current targetCurrently, we install packages for 64 and 32 bit targets on both builds.Currently, we install packages for 64 and 32 bit targets on both builds.Tor: 0.3.5.x-finalNick MathewsonNick Mathewsonhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27764crypto_rsa.c: CID 1439488: Resource leaks2020-06-27T13:52:08ZGeorge Kadianakiscrypto_rsa.c: CID 1439488: Resource leaksCoverity report from 18th Sept:
```
/src/lib/crypt_ops/crypto_rsa.c: 558 in crypto_pk_read_private_key_from_filename()
552 {
553 struct stat st;
554 char *buf = read_file_to_str(keyfile, 0, &st);
555 if (!buf)
556 ...Coverity report from 18th Sept:
```
/src/lib/crypt_ops/crypto_rsa.c: 558 in crypto_pk_read_private_key_from_filename()
552 {
553 struct stat st;
554 char *buf = read_file_to_str(keyfile, 0, &st);
555 if (!buf)
556 return -1;
557 if (st.st_size > MAX_PRIVKEY_FILE_LEN)
>>> CID 1439488: Resource leaks (RESOURCE_LEAK)
>>> Variable "buf" going out of scope leaks the storage it points to.
558 return -1;
559
560 int rv = crypto_pk_read_private_key_from_string(env, buf,
561 (ssize_t)st.st_size);
562 memwipe(buf, 0, (size_t)st.st_size);
563 tor_free(buf);
```Tor: 0.3.5.x-finalhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27761check-changes: check that bugfixes aren't on future versions2020-06-27T13:52:08Zteorcheck-changes: check that bugfixes aren't on future versionsI tried to modify lintChanges.py to check for bugfixes against future versions. But then I realised that we backport bugfixes.
So I salvaged the version parsing code into a new check.I tried to modify lintChanges.py to check for bugfixes against future versions. But then I realised that we backport bugfixes.
So I salvaged the version parsing code into a new check.Tor: 0.3.5.x-finalteorteorhttps://gitlab.torproject.org/tpo/core/tor/-/issues/277570.3.5.1-alpha: minor changelog fixes2020-06-27T13:52:08Zteor0.3.5.1-alpha: minor changelog fixesTor: 0.3.5.x-finalteorteorhttps://gitlab.torproject.org/tpo/core/tor/-/issues/277560.3.5.1-alpha ChangeLog: delete all the consensuses to un-break nss2020-06-27T13:52:08Zteor0.3.5.1-alpha ChangeLog: delete all the consensuses to un-break nssThe required protocol version check occurs before the consensus flavour check. So on directory mirrors, alpha users need to delete both consensus flavours.The required protocol version check occurs before the consensus flavour check. So on directory mirrors, alpha users need to delete both consensus flavours.Tor: 0.3.5.x-finalteorteorhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27751Travis: add CI with --enable-nss2020-06-27T13:52:08ZteorTravis: add CI with --enable-nssNow that tor supports nss, we should add CI with nss enabled.
We should do a quick nss build on Linux gcc.Now that tor supports nss, we should add CI with nss enabled.
We should do a quick nss build on Linux gcc.Tor: 0.3.5.x-finalteorteorhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27741too many arguments in rust protover_compute_vote()2020-06-27T13:52:08ZTractoo many arguments in rust protover_compute_vote()[569b4e57e23d728969a12751afc6b45f32d0f093](https://gitweb.torproject.org/tor.git/commit/?id=569b4e57e23d728969a12751afc6b45f32d0f093) added an argument `allow_long_proto_names: bool` in order to `maintain compatibility with consensus met...[569b4e57e23d728969a12751afc6b45f32d0f093](https://gitweb.torproject.org/tor.git/commit/?id=569b4e57e23d728969a12751afc6b45f32d0f093) added an argument `allow_long_proto_names: bool` in order to `maintain compatibility with consensus methods older than 29.`
The C code never added this 3rd argument and only calls it with 2, which can't be safe.
**Trac**:
**Username**: cyberpunksTor: 0.3.5.x-finalNick MathewsonNick Mathewsonhttps://gitlab.torproject.org/tpo/core/tor/-/issues/27740rust protover_all_supported() returns rust-allocated string in *missing_out2020-06-27T13:52:08ZTracrust protover_all_supported() returns rust-allocated string in *missing_out
**Trac**:
**Username**: cyberpunks
**Trac**:
**Username**: cyberpunksTor: 0.3.5.x-finalAlexander Færøyahf@torproject.orgAlexander Færøyahf@torproject.orghttps://gitlab.torproject.org/tpo/core/tor/-/issues/27738Travis: use the homebrew addon to reliably install dependencies2020-06-27T13:52:09ZteorTravis: use the homebrew addon to reliably install dependenciesHomebrew exits with an error if you try to install an outdated package, or upgrade a package that isn't installed:
https://github.com/travis-ci/docs-travis-ci-com/pull/2017#issuecomment-421444250
Our original scripts were wrong, and now...Homebrew exits with an error if you try to install an outdated package, or upgrade a package that isn't installed:
https://github.com/travis-ci/docs-travis-ci-com/pull/2017#issuecomment-421444250
Our original scripts were wrong, and now our new scripts are wrong in another way. (Oops!)
To avoid these issues, we should use the travis homebrew addon:
https://docs.travis-ci.com/user/installing-dependencies/#installing-packages-on-os-xTor: 0.3.5.x-finalteorteor