In #31615 (moved), we discovered that our module init order doesn't match their dependency order.
Let's use practracker and tor to make sure that doesn't happen again. We'll probably need a new make check target, because we'll need a compiled tor and practracker output. See #31615 (moved) for details.
Gaba, this is Sponsor 31-can, because it helps us catch refactoring bugs when we create new modules.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
We might also want to check against the order in subsystem_list.c.
Yes, but have a look at check_and_setup() in subsysmgr.c -- that causes tor to exit with an assertion failure on startup if the subsystems are not sorted by priority.
We might also want to check against the order in subsystem_list.c.
Yes, but have a look at check_and_setup() in subsysmgr.c -- that causes tor to exit with an assertion failure on startup if the subsystems are not sorted by priority.
So we don't need to check the order in subsystem_list.c, because tor does it for us. That's good.
I have started this, but I believe it is bigger than we should do in 0.4.2, and we should defer part of it till 0.4.3. Here is why:
Our subsystems do not currently to our directory structures. Notably, these subsystems are defined in with names that do not match their locations: btrack, network, ocirc_event, oconn_event, relay, threads, tortls, winprocess.
Our subsystem order does not currently match the topology very well at all: there are four discontinuities on the ordering. I think they are caused by: btrack, compress, winprocess, threads. We should re-order these, but doing so will require us to re-organize some of our code. That seems like a stability risk.
I have checked in a work-in-progress version of the code to do these checks as ticket31634. Do you think it's reasonable to defer to 0.4.3 based on the above reasoning? If not, please re-assign to me for 0.4.2, but this just got bigger than we anticipated.
(Right now I am not asking for review on the code per se, since it is not ready. I'm asking for review on the decision to defer this to 0.4.3 when we willing to take more stability risks.)
Sorry it's taken me a while to review this, I've been busy with some urgent things the past few weeks.
The code looks good, I added comments about a few typos and tweaks.
There are a few conflicts between this PR and master.
I think I ran tor --dbg-dump-subsystem-list and practracker/includes.py --check-subsystem-order the way you expect, and got the expected results. But I'm not sure.
Can we add the relevant commands to make check?
Then I can run it locally, and in CI, and confirm we got the expected results.
Okay, I've made an updated branch incorporating your suggestions, completely removing a script that apparently isn't what I had working, and rebasing on master to fix merge issues.
Traceback (most recent call last): File "/home/travis/build/torproject/tor/tor-0.4.4.0-alpha-dev/_build/sub/../../scripts/maint/practracker/includes.py", line 348, in <module> main(sys.argv) File "/home/travis/build/torproject/tor/tor-0.4.4.0-alpha-dev/_build/sub/../../scripts/maint/practracker/includes.py", line 345, in main check_subsystem_order=args.check_subsystem_order) File "/home/travis/build/torproject/tor/tor-0.4.4.0-alpha-dev/_build/sub/../../scripts/maint/practracker/includes.py", line 309, in run_check_includes if check_subsys_file(check_subsystem_order, uses_dirs): File "/home/travis/build/torproject/tor/tor-0.4.4.0-alpha-dev/_build/sub/../../scripts/maint/practracker/includes.py", line 275, in check_subsys_file if fname in uses_closure[prev]:KeyError: u'lib/llharden'FAIL scripts/maint/run_check_subsystem_order.sh (exit status: 1)
Appveyor CI failed with a similar error:
Traceback (most recent call last): File "C:/projects/tor/x86_64-w64-mingw32/../scripts/maint/practracker/includes.py", line 348, in <module> main(sys.argv) File "C:/projects/tor/x86_64-w64-mingw32/../scripts/maint/practracker/includes.py", line 341, in main run_check_includes(topdir=args.topdir, File "C:/projects/tor/x86_64-w64-mingw32/../scripts/maint/practracker/includes.py", line 309, in run_check_includes if check_subsys_file(check_subsystem_order, uses_dirs): File "C:/projects/tor/x86_64-w64-mingw32/../scripts/maint/practracker/includes.py", line 275, in check_subsys_file if fname in uses_closure[prev]:KeyError: 'lib/llharden'FAIL scripts/maint/run_check_subsystem_order.sh (exit status: 1)