[tor-bugs] #24555 [Core Tor/Tor]: Bug: tor_gmtime_r overflow - gmtime(9223372036854775807) failed with error No error

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Jan 6 04:54:11 UTC 2018


#24555: Bug: tor_gmtime_r overflow - gmtime(9223372036854775807) failed with error
No error
-------------------------------------------------+-------------------------
 Reporter:  s7r                                  |          Owner:  (none)
     Type:  defect                               |         Status:  new
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.3.3.x-final
Component:  Core Tor/Tor                         |        Version:  Tor:
                                                 |  unspecified
 Severity:  Normal                               |     Resolution:
 Keywords:  integer-overflow time-overflow tor-  |  Actual Points:
  relay 2038-problem                             |
Parent ID:  #18480                               |         Points:
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by arma):

 {{{
 #2  0x00007f418dd5fbe6 in correct_tm (islocal=0, timep=0x7fff2d162b18,
     resultbuf=<value optimized out>, r=<value optimized out>)
     at src/common/compat.c:2974
 #3  0x00007f418dd72c5c in format_iso_time (
     buf=0x7fff2d162c60 "2018-01-13 02:00:00", t=9223372036854775807)
     at src/common/util.c:1777
 #4  0x00007f418dc767e6 in update_consensus_router_descriptor_downloads (
     now=1515201474, is_vote=756427840, consensus=0x7f419edbb550)
     at src/or/routerlist.c:5217
 #5  0x00007f418dc76c80 in update_all_descriptor_downloads (now=1515201474)
     at src/or/routerlist.c:4562
 #6  0x00007f418dc24660 in directory_info_has_arrived (now=1515201474,
     from_cache=0, suppress_logs=0) at src/or/main.c:1116
 #7  0x00007f418dd08b6d in handle_response_fetch_consensus (
     conn=<value optimized out>) at src/or/directory.c:2631
 #8  connection_dir_client_reached_eof (conn=<value optimized out>)
     at src/or/directory.c:2487
 #9  connection_dir_reached_eof (conn=<value optimized out>)
     at src/or/directory.c:3357
 #10 0x00007f418dcddd15 in connection_reached_eof (conn=0x7f41a74f6970)
     at src/or/connection.c:4696
 #11 connection_handle_read_impl (conn=0x7f41a74f6970)
     at src/or/connection.c:3503
 #12 connection_handle_read (conn=0x7f41a74f6970) at
 src/or/connection.c:3516
 #13 0x00007f418dc27811 in conn_read_callback (fd=<value optimized out>,
     event=<value optimized out>, _conn=0x7f41a74f6970) at
 src/or/main.c:861
 #14 0x00007f418ddd3414 in event_persist_closure ()
 #15 0x00007f418ddd3725 in event_process_active_single_queue ()
 #16 0x00007f418ddd3db5 in event_process_active ()
 #17 0x00007f418ddd4519 in event_base_loop ()
 #18 0x00007f418dc24a8b in run_main_loop_once () at src/or/main.c:2780
 #19 run_main_loop_until_done () at src/or/main.c:2852
 #20 do_main_loop () at src/or/main.c:2735
 #21 0x00007f418dc2506b in tor_run_main (tor_cfg=<value optimized out>)
     at src/or/main.c:4016
 #22 0x00007f418dc1f953 in tor_main (argc=3, argv=0x7fff2d163318)
     at src/or/tor_api.c:84
 #23 0x00007f418dc1f7e9 in main (argc=<value optimized out>,
     argv=<value optimized out>) at src/or/tor_main.c:22
 }}}

 {{{
 (gdb) up
 #3  0x00007f418dd72c5c in format_iso_time (
     buf=0x7fff2d162c60 "2018-01-13 02:00:00", t=9223372036854775807)
     at src/common/util.c:1777
 1777      strftime(buf, ISO_TIME_LEN+1, "%Y-%m-%d %H:%M:%S",
 tor_gmtime_r(&t, &tm));
 (gdb) print t
 $3 = 9223372036854775807
 }}}

 {{{
 (gdb) up
 #4  0x00007f418dc767e6 in update_consensus_router_descriptor_downloads (
     now=1515201474, is_vote=756427840, consensus=0x7f419edbb550)
     at src/or/routerlist.c:5217
 5217            format_iso_time(time_cert_expires,
 ri->cert_expiration_time);
 (gdb) print *ri
 value has been optimized out
 (gdb) print ri->cert_expiration_time
 value has been optimized out
 (gdb) print time_cert_expires
 $4 = "2018-01-13 02:00:00"
 }}}

 Hello, what is this "is_vote=756427840"?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/24555#comment:7>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list