[tor-bugs] #31898 [Core Tor/Tor]: Occasional crash during shutdown when using Tor API
Tor Bug Tracker & Wiki
blackhole at torproject.org
Tue Oct 1 14:50:02 UTC 2019
#31898: Occasional crash during shutdown when using Tor API
-------------------------------------------------+-------------------------
Reporter: sysrqb | Owner: nickm
Type: defect | Status:
| accepted
Priority: Medium | Milestone: Tor:
| 0.4.2.x-final
Component: Core Tor/Tor | Version: Tor:
| 0.4.2.1-alpha
Severity: Normal | Resolution:
Keywords: 042-regression, crash, 042-must | Actual Points:
041-backport? 041-regression? |
Parent ID: | Points: 1
Reviewer: | Sponsor:
| Sponsor31-must
-------------------------------------------------+-------------------------
Comment (by sysrqb):
Replying to [comment:4 nickm]:
> A smaller test case might help here, or maybe a link to the RunMain
source.
I rebased the branch I used for testing the API on top of current master.
The configuration is handled
[https://gitweb.torproject.org/user/sysrqb/tor.git/tree/src/tools/jverify_config.java?h=testing_26653_02#n16
here] and
[https://gitweb.torproject.org/user/sysrqb/tor.git/tree/src/feature/api/TorApi.c?h=testing_26653_02#n173
RunMain] is there.
This is basically a thin wrapper around the API.
>
> One thing to note is that the stack trace that you're describing seems
to be happening inside the initialization code, before Tor is actually
running. Maybe this is something that happens on a second initialization
and not a first?
Yes, that is what this code is doing. On the Java-side, it takes in
commandline args which are passed into tor for configuration, but it
configures and runs tor twice. The first time the program inserts
`--verify-config` as the second argument, and then after `tor_run_main`
returns, it calls `tor_main_configuration_set_command_line` again except
this time with the original args (without `--verify-config`) and then
calls `tor_run_main` again.
Is reusing a `tor_main_configuration_t` with different args a supported
use case? I haven't looked at the code yet. I don't see this crash during
every execution, I usually run the program in a `while` loop until it
crashes (which usually takes between 5 and 30 iterations).
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/31898#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list