Opened 8 weeks ago

Closed 7 weeks ago

#33782 closed defect (fixed)

Increases TEST_CONN_FD_INIT to make tests working on GitHub Actions

Reported by: ultimaweapon Owned by:
Priority: Medium Milestone: Tor: 0.4.3.x-final
Component: Core Tor/Tor Version: Tor: 0.2.8.1-alpha
Severity: Normal Keywords: tor-test, 043-backport, consider-backport-after-ci-passes
Cc: Actual Points:
Parent ID: Points: 0.1
Reviewer: Sponsor:

Description

With the current value, which is 50; it will cause some tests to fail on GitHub Actions:

hs_client/e2e_rend_circuit_setup_legacy: [forking] Mar 31 17:01:17.348 [warn] tor_bug_occurred_(): Bug: src/lib/net/socket.c:237: tor_close_socket__real: Non-fatal assertion n_sockets_open >= 0 failed. (on Tor 0.4.2.5 )
Mar 31 17:01:17.349 [warn] Bug: Tor 0.4.2.5: Non-fatal assertion n_sockets_open >= 0 failed in tor_close_socket__real at src/lib/net/socket.c:237. Stack trace: (on Tor 0.4.2.5 )
Mar 31 17:01:17.349 [warn] Bug:     ./src/test/test(log_backtrace_impl+0x56) [0x55d2831c7696] (on Tor 0.4.2.5 )
Mar 31 17:01:17.349 [warn] Bug:     ./src/test/test(tor_bug_occurred_+0x17f) [0x55d2831c2fcf] (on Tor 0.4.2.5 )
Mar 31 17:01:17.349 [warn] Bug:     ./src/test/test(tor_close_socket__real+0xd7) [0x55d2831ba3f7] (on Tor 0.4.2.5 )
Mar 31 17:01:17.349 [warn] Bug:     ./src/test/test(connection_free_minimal+0x1c7) [0x55d28302a507] (on Tor 0.4.2.5 )
Mar 31 17:01:17.349 [warn] Bug:     ./src/test/test(+0x2d5dff) [0x55d282e91dff] (on Tor 0.4.2.5 )
Mar 31 17:01:17.349 [warn] Bug:     ./src/test/test(+0x444c66) [0x55d283000c66] (on Tor 0.4.2.5 )
Mar 31 17:01:17.349 [warn] Bug:     ./src/test/test(testcase_run_one+0x2f1) [0x55d283000fb1] (on Tor 0.4.2.5 )
Mar 31 17:01:17.349 [warn] Bug:     ./src/test/test(tinytest_main+0x10c) [0x55d28300156c] (on Tor 0.4.2.5 )
Mar 31 17:01:17.349 [warn] Bug:     ./src/test/test(main+0x2a0) [0x55d282cad9f0] (on Tor 0.4.2.5 )
Mar 31 17:01:17.349 [warn] Bug:     /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f65fdf83b97] (on Tor 0.4.2.5 )
Mar 31 17:01:17.349 [warn] Bug:     ./src/test/test(_start+0x2a) [0x55d282cadb1a] (on Tor 0.4.2.5 )

  [e2e_rend_circuit_setup_legacy FAILED]

The reason is because of a process running in GitHub Actions doing something that caused a lot of file descriptors to open. So, when Tor is trying to close a fake socket it ends up closing a real one that was opened by GitHub Actions.

I already tried with 100 and it does not work. So I tried 200 and it works.

Child Tickets

Attachments (1)

increase-test-fd.patch (519 bytes) - added by ultimaweapon 8 weeks ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 weeks ago by dgoulet

Status: newneeds_review

comment:2 Changed 8 weeks ago by dgoulet

Keywords: tor-test added
Milestone: Tor: 0.4.4.x-final

comment:3 Changed 8 weeks ago by teor

Version: Tor: unspecified0.4.2.6

I would use 1000 as the minimum fake FD.
Or something ridiculously large, like 30,000.

Most systems default to 512 or 1024 file descriptors as a minimum.
So most processes tor is embedded in shouldn't ever use that many.

Also, do we want to backport this patch?
It seems like a good candidate for 0.4.3 at least.

It also seems like we might run into this issue more often, because more people are embedding tor. (It's unusual to embed the unit tests, but not entirely unreasonable. For example, we like to know if the unit tests pass on a real iOS device.)

Changed 8 weeks ago by ultimaweapon

Attachment: increase-test-fd.patch added

comment:4 Changed 8 weeks ago by ultimaweapon

Updated to 65,536.

Backport does not matter for me so it is up to you guys.

comment:5 Changed 8 weeks ago by teor

Keywords: 043-backport consider-backport-after-0435 added

Let's backport this to our 0.4.3 alpha series.

Can you submit a GitHub pull request?
https://github.com/torproject/tor

comment:6 Changed 8 weeks ago by ultimaweapon

comment:7 Changed 7 weeks ago by teor

Keywords: consider-backport-after-ci-passes added; consider-backport-after-0435 removed
Milestone: Tor: 0.4.4.x-finalTor: 0.4.3.x-final
Points: 0.1
Resolution: fixed
Status: needs_reviewclosed
Version: 0.4.2.6Tor: 0.2.8.1-alpha

Thanks, looks good, and CI passed.

Added a changes file, and merged to 0.4.3 and later.

This fix should be included in tor's next 0.4.3 alpha / release candidate.

Note: See TracTickets for help on using tickets.