[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #15236 [Tor]: Identify functions most in need of testing, and hardest to test



#15236: Identify functions most in need of testing, and hardest to test
------------------------+--------------------------------
     Reporter:  nickm   |      Owner:
         Type:  task    |     Status:  new
     Priority:  normal  |  Milestone:  Tor: 0.2.7.x-final
    Component:  Tor     |    Version:
   Resolution:          |   Keywords:  SponsorS
Actual Points:          |  Parent ID:
       Points:          |
------------------------+--------------------------------

Comment (by nickm):

 In order to try to figure out the "hardest-to-test" functions, I've been
 looking through the Tor callgraph.

 (How do you get a callgraph? Make sure you have "clang" and "opt"
 installed, then run:
 {{{
 for f in src/common/*.c src/or/*.c ; do clang -S -emit-llvm $f -std=gnu99
 -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="\"/usr/local/share\""
 -DLOCALSTATEDIR="\"/usr/local/var\"" -DBINDIR="\"/usr/local/bin\""
 -I./src/common | opt -analyze -print-callgraph 2>$f.callgraph ; done
 }}}
 Then post-process the data with a little python script, and then you're
 set.)

 If you want to see the callgraph data I got for approximately-current
 master, head over to https://people.torproject.org/~nickm/volatile/call-
 graph-stuff/ .

 Anyway, it looks as though our call-graph breaks down so that about 85% of
 our functions are nice sensible functions from which only a smaller number
 of functions are reachable... but the rest of our functions can reach
 *nearly any other function in or called by Tor*.  These are likely to be
 among the hardest to debug, given how complex their potential behavior is.

 Here is the list of the top 25 offenders, and the number of other
 functions reachable from them:
 {{{
 3157 command_process_created_cell
 3157 connection_about_to_close_connection
 3158 dns_resolve
 3158 evdns_callback
 3159 connection_exit_begin_resolve
 3161 connection_unlink
 3161 dirserv_generate_networkstatus_vote_obj
 3164 conn_close_if_marked
 3165 close_closeable_connections
 3165 dirvote_compute_consensuses
 3166 conn_read_callback
 3166 conn_write_callback
 3167 dirvote_perform_vote
 3169 connection_exit_begin_conn
 3170 command_process_create_cell
 3172 rend_process_relay_cell
 3200 dirvote_act
 3201 tor_main
 3202 main
 3266 connection_edge_process_relay_cell
 3274 circuit_receive_relay_cell
 3276 command_process_relay_cell
 3306 command_process_cell
 3355 run_scheduled_events
 3367 second_elapsed_callback
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/15236#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs