Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in test-fork #46

Open
allanlw opened this issue Jul 30, 2017 · 0 comments
Open

Bug in test-fork #46

allanlw opened this issue Jul 30, 2017 · 0 comments

Comments

@allanlw
Copy link
Collaborator

allanlw commented Jul 30, 2017

There is a non-deterministic bug in test-fork.

To reproduce, try: taskset -c 0 bash -c "rm userland/test-fork/output.txt; while true; do make test/test-fork || break; rm userland/test-fork/output.txt; done"

The failure will look something like:

allan@ubuntu-4gb-nyc3-01:~/silvos$ taskset -c 0 bash -c "rm userland/test-fork/output.txt; while true; do make test/test-fork || break; rm userland/test-fork/output.txt; done"
x86_64-elf-gcc -c userland/test-fork/main.c -o userland/test-fork/main.o -ffreestanding -Wall -Wextra -Wno-main -std=c99 -O2 -Iuserland
x86_64-elf-gcc userland/test-fork/main.o userland/startup.o -o userland/test-fork.bin -nostdlib -lgcc
dd if=/dev/zero of=userland/test-fork/test_disk bs=512 count=16
16+0 records in
16+0 records out
8192 bytes (8.2 kB, 8.0 KiB) copied, 0.000207988 s, 39.4 MB/s
qemu-system-x86_64 -kernel bootloader.multiboot \
        -d in_asm -D >( grep -E "^(Trace.*\[ffffffff|IN:|0xffffff)" | uniq > userland/test-fork/coverage.log) \
        -initrd george.multiboot,userland/test-fork.bin \
        -serial file:userland/test-fork/output.txt \
        -device isa-debug-exit,iobase=0xf4,iosize=0x04 \
        -nographic \
        -display none \
        -m 128 \
        -drive file=userland/test-fork/test_disk,index=0,media=disk,format=raw \
        | true
warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
diff <(sort userland/test-fork/expected.txt) <(sort userland/test-fork/output.txt)
8,9c8,9
< THREAD 0x04: Child, depth 1
< THREAD 0x05: Child, depth 2
---
> THREAD 0x04: Child, depth 2
> THREAD 0x05: Child, depth 1
Makefile:117: recipe for target 'test/test-fork' failed
make: *** [test/test-fork] Error 1
rm userland/test-fork/test_disk userland/test-fork/main.o

This is pretty obviously some kind of race condition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant