Stuck in doghost()
This is for the branch newTimeDefinition, commit eeb72b2e. I run ./swift -r 10 -t 1 -f UniformBox/uniformBox.hdf5 -m 0.1
There is indeed something strange going on with the links. We use previously freed memory. Here is the address sanitizer output:
=================================================================
==10302==ERROR: AddressSanitizer: heap-use-after-free on address 0x7ff0c56ec918 at pc 0x00000044df17 bp 0x7ff0c845fb50 sp 0x7ff0c845fb40
READ of size 8 at 0x7ff0c56ec918 thread T1
#0 0x44df16 in runner_doghost /home/matthieu/Desktop/Swift-git/multiTimeStep/swiftsim/src/runner.c:721
#1 0x44fd1f in runner_main /home/matthieu/Desktop/Swift-git/multiTimeStep/swiftsim/src/runner.c:1150
#2 0x7ff0cf3e36a9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76a9)
#3 0x7ff0cf118eec in clone (/lib/x86_64-linux-gnu/libc.so.6+0x106eec)
0x7ff0c56ec918 is located 274712 bytes inside of 864000-byte region [0x7ff0c56a9800,0x7ff0c577c700)
freed by thread T0 here:
#0 0x7ff0cfe636aa in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x986aa)
#1 0x45c2b7 in engine_maketasks /home/matthieu/Desktop/Swift-git/multiTimeStep/swiftsim/src/engine.c:1049
#2 0x460007 in engine_step /home/matthieu/Desktop/Swift-git/multiTimeStep/swiftsim/src/engine.c:1919
#3 0x403901 in main /home/matthieu/Desktop/Swift-git/multiTimeStep/swiftsim/examples/main.c:397
#4 0x7ff0cf032a3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20a3f)
previously allocated by thread T0 here:
#0 0x7ff0cfe639aa in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x989aa)
#1 0x45c2fa in engine_maketasks /home/matthieu/Desktop/Swift-git/multiTimeStep/swiftsim/src/engine.c:1050
#2 0x460007 in engine_step /home/matthieu/Desktop/Swift-git/multiTimeStep/swiftsim/src/engine.c:1919
#3 0x4038aa in main /home/matthieu/Desktop/Swift-git/multiTimeStep/swiftsim/examples/main.c:397
#4 0x7ff0cf032a3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20a3f)
Thread T1 created by T0 here:
#0 0x7ff0cfe016a3 in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x366a3)
#1 0x461ebf in engine_init /home/matthieu/Desktop/Swift-git/multiTimeStep/swiftsim/src/engine.c:2201
#2 0x40377e in main /home/matthieu/Desktop/Swift-git/multiTimeStep/swiftsim/examples/main.c:320
#3 0x7ff0cf032a3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20a3f)
SUMMARY: AddressSanitizer: heap-use-after-free /home/matthieu/Desktop/Swift-git/multiTimeStep/swiftsim/src/runner.c:721 runner_doghost
Shadow bytes around the buggy address:
0x0ffe98ad58d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0ffe98ad58e0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0ffe98ad58f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0ffe98ad5900: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0ffe98ad5910: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0ffe98ad5920: fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd
0x0ffe98ad5930: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0ffe98ad5940: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0ffe98ad5950: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0ffe98ad5960: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0ffe98ad5970: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
==10302==ABORTING