Opened 10 years ago

Closed 9 years ago

Last modified 7 years ago

#1139 closed defect (wontfix)

alpha gcc bug: circuitbuild.c:608: circuit_build_times_generate_sample: Assertion q_lo < q_hi failed

Reported by: weasel Owned by: nickm
Priority: Low Milestone:
Component: Core Tor/Tor Version: 0.2.2.5-alpha
Severity: Keywords:
Cc: weasel, nickm, Sebastian, arma, mikeperry Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Hi,

on alpha, in 0.2.2.4 and latest git the testsuite fails with:
[sid] weasel@albeniz:~/tmp/tor$ ./src/test/test --info
Oct 26 09:07:09.931 [info] crypto_global_init(): NOT using OpenSSL engine support.
Oct 26 09:07:09.932 [info] crypto_seed_rng(): Seeding RNG from "/dev/urandom"
Oct 26 09:07:09.934 [info] crypto_seed_rng(): Seeding RNG from "/dev/urandom"
buffers: OK
onion_handshake: OK
circuit_timeout: Oct 26 09:07:10.206 [err] Bug: circuitbuild.c:608: circuit_build_times_generate_sample: Assertion q_lo < q_hi failed; aborting.
circuitbuild.c:608 circuit_build_times_generate_sample: Assertion q_lo < q_hi failed; aborting.
zsh: abort (core dumped) ./src/test/test --info

See also http://experimental.ftbfs.de/fetch.php?pkg=tor&arch=alpha&ver=0.2.2.4-alpha-1&stamp=1255305733&file=log&as=raw

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (12)

comment:1 Changed 10 years ago by nickm

Exciting. Remind me, what's architecturally interesting about the alpha that might make it act funny here?

comment:2 Changed 10 years ago by mikeperry

Weasel, how often were you able to reproduce this? And via any particular magic?

comment:3 Changed 10 years ago by weasel

100% of the time. I just ran the test suite 500 times and it failed every single run. No magic required.

comment:4 Changed 10 years ago by mikeperry

Can we get a run of just the test executable with --info?

./src/test/test --info circuit_timeout >& cbt.out

comment:5 Changed 10 years ago by weasel

Program terminated with signal 6, Aborted.
#0 0x0000020000455d58 in *GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.

in ../nptl/sysdeps/unix/sysv/linux/raise.c

(gdb) bt
#0 0x0000020000455d58 in *GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x000002000045a3dc in *
GI_abort () at abort.c:88
#2 0x0000000120076c90 in circuit_build_times_generate_sample (cbt=<value optimized out>, q_lo=0, q_hi=<value optimized out>) at circuitbuild.c:608
#3 0x000000012000aeec in test_circuit_timeout () at test.c:487
#4 0x0000000120007b28 in legacy_test_helper (data=0x1f2) at test.c:1085
#5 0x0000000120069d4c in _testcase_run_bare (testcase=0x1201e6960) at tinytest.c:86
#6 0x000000012006a1c0 in testcase_run_one (group=0x1201e68a0, testcase=0x1201e6960) at tinytest.c:220
#7 0x000000012006a6c0 in tinytest_main (c=<value optimized out>, v=<value optimized out>, groups=0x1201e68a0) at tinytest.c:329
#8 0x000000012000fb54 in main (c=<value optimized out>, v=0x11f987318) at test.c:1199

comment:6 Changed 10 years ago by weasel

Doesn't happen when built with -O0 -g.

What does valgrind (on amd64) think about the testsuite?

comment:7 Changed 10 years ago by weasel

(gdb) break circuitbuild.c:608
Breakpoint 1 at 0x120076990: file circuitbuild.c, line 608.
(gdb) run
Starting program: /home/weasel/tmp/tor/src/test/test
[Thread debugging using libthread_db enabled]
buffers: OK
onion_handshake: OK
circuit_timeout:
Breakpoint 1, circuit_build_times_generate_sample (cbt=0x11fdae4f8, q_lo=0, q_hi=0.99999999953433871) at circuitbuild.c:608
608 tor_assert(q_lo < q_hi);
(gdb) p q_hi
$1 = 0.99999999953433871
(gdb) p q_lo
$2 = 0
(gdb) next
609 r = crypto_rand_uint64(UINT64_MAX-1);
(gdb)
611 u = q_lo + ((q_hi-q_lo)*r)/(1.0*UINT64_MAX);
(gdb) p q_hi
$3 = 0.99999999953433871
(gdb) p q_lo
$4 = -1.1212654061868307e+198
(gdb)

comment:8 Changed 9 years ago by arma

Weasel, did this go away, or did we all just agree to ignore it?

Odd that nobody else has reported it (or have they?)

comment:9 Changed 9 years ago by weasel

Very much looked like a gcc bug, but I think we decided alpha doesn't matter anymore.

comment:10 Changed 9 years ago by nickm

Owner: set to nickm
Status: newassigned

We could close as wontfix; if somebody wants to investigate further, the right place to start is by doing a gcc -S to see what assembly it generates for the -O2 and -O0 cases.

But the code in question sets off a smell-test of mine; instead of doing (X*rand_uint64() ) / (1.0*UINT64_MAX) , we should just have a function that returns a random double. That should work around this issue just fine.

I've added a branch, "rand_double", in my public to do this. I'll hold off merging it until mikeperry's cbt-bugfixes3 branch is merged, since giving him more conflicts on that would not be a nice thing to do.

comment:11 Changed 9 years ago by nickm

Resolution: Nonewontfix
Status: assignedclosed

merged rand_double2. Closing this bug as wontfix.

comment:12 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.