Opened 4 years ago

Closed 4 years ago

#19038 closed defect (fixed)

Test failure on the latest commit

Reported by: cypherpunks Owned by:
Priority: Medium Milestone: Tor: 0.2.9.x-final
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

the latest git ( commit 9e44273a4a22803eff900f6df10f13c7548bdb0d ) is failing on tests; the system is linux debian unstable 32bit :

util/pubsub/pubsub_basic: [forking] *** Error in `./src/test/test': free(): invalid next size (fast): 0x823300d8 ***
======= Backtrace: =========
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x692ab)[0xb5c1d2ab]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x6f4f7)[0xb5c234f7]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x6fca1)[0xb5c23ca1]
./src/test/test(pubsub_unsubscribe_+0x6e)[0x81d540fe]
./src/test/test(+0x185ad4)[0x81b7fad4]
./src/test/test(+0x20d081)[0x81c07081]
./src/test/test(testcase_run_one+0x162)[0x81c07242]
./src/test/test(tinytest_main+0x134)[0x81c07994]
./src/test/test(main+0x26d)[0x81a3575d]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xf7)[0xb5bcc527]
./src/test/test(+0x3b89d)[0x81a3589d]
======= Memory map: ========
819fa000-81fec000 r-xp 00000000 fe:00 2625171    $HOME/tor-build/tor/build/src/test/test
81fed000-81ff0000 r--p 005f2000 fe:00 2625171    $HOME/tor-build/tor/build/src/test/test
81ff0000-82002000 rw-p 005f5000 fe:00 2625171    $HOME/tor-build/tor/build/src/test/test
82002000-82008000 rw-p 00000000 00:00 0 
82317000-82387000 rw-p 00000000 00:00 0          [heap]
b5992000-b59a6000 r-xp 00000000 fe:00 525448     /lib/i386-linux-gnu/i686/cmov/libresolv-2.22.so
b59a6000-b59a7000 r--p 00013000 fe:00 525448     /lib/i386-linux-gnu/i686/cmov/libresolv-2.22.so
b59a7000-b59a8000 rw-p 00014000 fe:00 525448     /lib/i386-linux-gnu/i686/cmov/libresolv-2.22.so
b59a8000-b59aa000 rw-p 00000000 00:00 0 
b59aa000-b59af000 r-xp 00000000 fe:00 525378     /lib/i386-linux-gnu/i686/cmov/libnss_dns-2.22.so
b59af000-b59b0000 r--p 00004000 fe:00 525378     /lib/i386-linux-gnu/i686/cmov/libnss_dns-2.22.so
b59b0000-b59b1000 rw-p 00005000 fe:00 525378     /lib/i386-linux-gnu/i686/cmov/libnss_dns-2.22.so
b59b1000-b59c1000 r-xp 00000000 fe:00 393537     /lib/i386-linux-gnu/libnss_myhostname.so.2
b59c1000-b59c2000 ---p 00010000 fe:00 393537     /lib/i386-linux-gnu/libnss_myhostname.so.2
b59c2000-b59c3000 r--p 00010000 fe:00 393537     /lib/i386-linux-gnu/libnss_myhostname.so.2
b59c3000-b59c4000 rw-p 00011000 fe:00 393537     /lib/i386-linux-gnu/libnss_myhostname.so.2
b59c4000-b59cf000 r-xp 00000000 fe:00 525379     /lib/i386-linux-gnu/i686/cmov/libnss_files-2.22.so
b59cf000-b59d0000 r--p 0000a000 fe:00 525379     /lib/i386-linux-gnu/i686/cmov/libnss_files-2.22.so
b59d0000-b59d1000 rw-p 0000b000 fe:00 525379     /lib/i386-linux-gnu/i686/cmov/libnss_files-2.22.so
b59d1000-b59d9000 rw-p 00000000 00:00 0 
b59d9000-b59ed000 r-xp 00000000 fe:00 393740     /lib/i386-linux-gnu/libgpg-error.so.0.18.0
b59ed000-b59ee000 r--p 00013000 fe:00 393740     /lib/i386-linux-gnu/libgpg-error.so.0.18.0
b59ee000-b59ef000 rw-p 00014000 fe:00 393740     /lib/i386-linux-gnu/libgpg-error.so.0.18.0
b59ef000-b5a62000 r-xp 00000000 fe:00 393297     /lib/i386-linux-gnu/libpcre.so.3.13.2
b5a62000-b5a63000 r--p 00072000 fe:00 393297     /lib/i386-linux-gnu/libpcre.so.3.13.2
b5a63000-b5a64000 rw-p 00073000 fe:00 393297     /lib/i386-linux-gnu/libpcre.so.3.13.2
b5a64000-b5a68000 r-xp 00000000 fe:00 393322     /lib/i386-linux-gnu/libattr.so.1.1.0
b5a68000-b5a69000 r--p 00003000 fe:00 393322     /lib/i386-linux-gnu/libattr.so.1.1.0
b5a69000-b5a6a000 rw-p 00004000 fe:00 393322     /lib/i386-linux-gnu/libattr.so.1.1.0
b5a6a000-b5a6b000 rw-p 00000000 00:00 0 
b5a6b000-b5a87000 r-xp 00000000 fe:00 393557     /lib/i386-linux-gnu/libgcc_s.so.1
b5a87000-b5a88000 rw-p 0001b000 fe:00 393557     /lib/i386-linux-gnu/libgcc_s.so.1
b5a88000-b5b51000 r-xp 00000000 fe:00 393602     /lib/i386-linux-gnu/libgcrypt.so.20.1.0
b5b51000-b5b52000 ---p 000c9000 fe:00 393602     /lib/i386-linux-gnu/libgcrypt.so.20.1.0
b5b52000-b5b53000 r--p 000c9000 fe:00 393602     /lib/i386-linux-gnu/libgcrypt.so.20.1.0
b5b53000-b5b56000 rw-p 000ca000 fe:00 393602     /lib/i386-linux-gnu/libgcrypt.so.20.1.0
b5b56000-b5b7c000 r-xp 00000000 fe:00 393222     /lib/i386-linux-gnu/liblzma.so.5.0.0
b5b7c000-b5b7e000 r--p 00026000 fe:00 393222     /lib/i386-linux-gnu/liblzma.so.5.0.0
b5b7e000-b5b7f000 rw-p 00028000 fe:00 393222     /lib/i386-linux-gnu/liblzma.so.5.0.0
b5b7f000-b5b86000 r-xp 00000000 fe:00 525449     /lib/i386-linux-gnu/i686/cmov/librt-2.22.so
b5b86000-b5b87000 r--p 00006000 fe:00 525449     /lib/i386-linux-gnu/i686/cmov/librt-2.22.so
b5b87000-b5b88000 rw-p 00007000 fe:00 525449     /lib/i386-linux-gnu/i686/cmov/librt-2.22.so
b5b88000-b5bb0000 r-xp 00000000 fe:00 393270     /lib/i386-linux-gnu/libselinux.so.1
b5bb0000-b5bb1000 r--p 00027000 fe:00 393270     /lib/i386-linux-gnu/libselinux.so.1
b5bb1000-b5bb2000 rw-p 00028000 fe:00 393270     /lib/i386-linux-gnu/libselinux.so.1
b5bb2000-b5bb4000 rw-p 00000000 00:00 0 
b5bb4000-b5d65000 r-xp 00000000 fe:00 525043     /lib/i386-linux-gnu/i686/cmov/libc-2.22.so
b5d65000-b5d66000 ---p 001b1000 fe:00 525043     /lib/i386-linux-gnu/i686/cmov/libc-2.22.so
b5d66000-b5d68000 r--p 001b1000 fe:00 525043     /lib/i386-linux-gnu/i686/cmov/libc-2.22.so
b5d68000-b5d69000 rw-p 001b3000 fe:00 525043     /lib/i386-linux-gnu/i686/cmov/libc-2.22.so
b5d69000-b5d6c000 rw-p 00000000 00:00 0 
b5d6c000-b5d6f000 r-xp 00000000 fe:00 525069     /lib/i386-linux-gnu/i686/cmov/libdl-2.22.so
b5d6f000-b5d70000 r--p 00002000 fe:00 525069     /lib/i386-linux-gnu/i686/cmov/libdl-2.22.so
b5d70000-b5d71000 rw-p 00003000 fe:00 525069     /lib/i386-linux-gnu/i686/cmov/libdl-2.22.so
b5d71000-b5d8a000 r-xp 00000000 fe:00 524419     /lib/i386-linux-gnu/i686/cmov/libpthread-2.22.so
b5d8a000-b5d8b000 r--p 00018000 fe:00 524419     /lib/i386-linux-gnu/i686/cmov/libpthread-2.22.so
b5d8b000-b5d8c000 rw-p 00019000 fe:00 524419     /lib/i386-linux-gnu/i686/cmov/libpthread-2.22.so
b5d8c000-b5d8e000 rw-p 00000000 00:00 0 
b5d8e000-b5d92000 r-xp 00000000 fe:00 393226     /lib/i386-linux-gnu/libcap.so.2.24
b5d92000-b5d93000 r--p 00003000 fe:00 393226     /lib/i386-linux-gnu/libcap.so.2.24
b5d93000-b5d94000 rw-p 00004000 fe:00 393226     /lib/i386-linux-gnu/libcap.so.2.24
b5d94000-b5dab000 r-xp 00000000 fe:00 393428     /lib/i386-linux-gnu/libseccomp.so.2.3.0
b5dab000-b5db6000 r--p 00016000 fe:00 393428     /lib/i386-linux-gnu/libseccomp.so.2.3.0
b5db6000-b5db7000 rw-p 00021000 fe:00 393428     /lib/i386-linux-gnu/libseccomp.so.2.3.0
b5db7000-b5db8000 rw-p 00000000 00:00 0 
b5db8000-b5dbd000 r-xp 00000000 fe:00 6694098    /usr/lib/libscrypt.so.0
b5dbd000-b5dbe000 r--p 00004000 fe:00 6694098    /usr/lib/libscrypt.so.0
b5dbe000-b5dbf000 rw-p 00005000 fe:00 6694098    /usr/lib/libscrypt.so.0
b5dbf000-b5e4b000 r-xp 00000000 fe:00 393540     /lib/i386-linux-gnu/libsystemd.so.0.14.0
b5e4b000-b5e4c000 ---p 0008c000 fe:00 393540     /lib/i386-linux-gnu/libsystemd.so.0.14.0
b5e4c000-b5e4e000 r--p 0008c000 fe:00 393540     /lib/i386-linux-gnu/libsystemd.so.0.14.0
b5e4e000-b5e4f000 rw-p 0008e000 fe:00 393540     /lib/i386-linux-gnu/libsystemd.so.0.14.0
b5e4f000-b601e000 r-xp 00000000 fe:00 6824792    /usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.2
b601e000-b601f000 ---p 001cf000 fe:00 6824792    /usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.2
b601f000-b602f000 r--p 001cf000 fe:00 6824792    /usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.2
b602f000-b6038000 rw-p 001df000 fe:00 6824792    /usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.2
b6038000-b603b000 rw-p 00000000 00:00 0 
b603b000-b609b000 r-xp 00000000 fe:00 6824872    /usr/lib/i386-linux-gnu/i686/cmov/libssl.so.1.0.2
b609b000-b609d000 r--p 0005f000 fe:00 6824872    /usr/lib/i386-linux-gnu/i686/cmov/libssl.so.1.0.2
b609d000-b60a1000 rw-p 00061000 fe:00 6824872    /usr/lib/i386-linux-gnu/i686/cmov/libssl.so.1.0.2
b60a1000-b60f1000 r-xp 00000000 fe:00 6685154    /usr/lib/i386-linux-gnu/libevent-2.0.so.5.1.9
b60f1000-b60f2000 r--p 0004f000 fe:00 6685154    /usr/lib/i386-linux-gnu/libevent-2.0.so.5.1.9
b60f2000-b60f3000 rw-p 00050000 fe:00 6685154    /usr/lib/i386-linux-gnu/libevent-2.0.so.5.1.9
b60f3000-b613f000 r-xp 00000000 fe:00 525071     /lib/i386-linux-gnu/i686/cmov/libm-2.22.so
b613f000-b6140000 r--p 0004b000 fe:00 525071     /lib/i386-linux-gnu/i686/cmov/libm-2.22.so
b6140000-b6141000 rw-p 0004c000 fe:00 525071     /lib/i386-linux-gnu/i686/cmov/libm-2.22.so
b6141000-b615b000 r-xp 00000000 fe:00 393514     /lib/i386-linux-gnu/libz.so.1.2.8
b615b000-b615d000 r--p 00019000 fe:00 393514     /lib/i386-linux-gnu/libz.so.1.2.8
b615d000-b615e000 rw-p 0001b000 fe:00 393514     /lib/i386-linux-gnu/libz.so.1.2.8
b6189000-b618a000 rw-p 00000000 00:00 0 
b618a000-b618c000 rw-p 00000000 00:00 0 
b618c000-b618f000 r--p 00000000 00:00 0          [vvar]
b618f000-b6190000 r-xp 00000000 00:00 0          [vdso]
b6190000-b61b1000 r-xp 00000000 fe:00 393232     /lib/i386-linux-gnu/ld-2.22.so
b61b1000-b61b2000 rw-p 00000000 00:00 0 
b61b2000-b61b3000 r--p 00021000 fe:00 393232     /lib/i386-linux-gnu/ld-2.22.so
b61b3000-b61b4000 rw-p 00022000 fe:00 393232     /lib/i386-linux-gnu/ld-2.22.so
bff6d000-bff8e000 rw-p 00000000 00:00 0          [stack]
[Lost connection!] 
  [pubsub_basic FAILED]

Child Tickets

Change History (3)

comment:1 Changed 4 years ago by cypherpunks

Status: newneeds_review

As suggested by another cypherpunk in ticket:18363#comment:29 the issue is caused by an incorrect memory allocation.

diff --git a/src/common/pubsub.c b/src/common/pubsub.c
index 98ec3f8..b3faf40 100644
--- a/src/common/pubsub.c
+++ b/src/common/pubsub.c
@@ -48,7 +48,7 @@ pubsub_subscribe_(pubsub_topic_t *topic,
   if (subscribe_flags & SUBSCRIBE_ATSTART) {
     tor_assert(topic->n_events_fired == 0);
   }
-  pubsub_subscriber_t *r = tor_malloc_zero(sizeof(r));
+  pubsub_subscriber_t *r = tor_malloc_zero(sizeof(*r));
   r->priority = priority;
   r->subscriber_flags = subscribe_flags;
   r->fn = fn;

This patch fixes the issue for me.

comment:2 Changed 4 years ago by nickm

Milestone: Tor: 0.2.9.x-final

Works for me too. Applied as 99c0e1bd5b3974c8bf767487e7cf9a9193a3c91a.

comment:3 Changed 4 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed
Note: See TracTickets for help on using tickets.