-
Notifications
You must be signed in to change notification settings - Fork 7
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
Introduce basic tests #2
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e3b9113
to
0aab716
Compare
This makes len < 4096 no longer produce an error when attempting to remap it. Signed-off-by: Daniil Tatianin <[email protected]>
This runs a few basic read/write + randread/randwrite tests against libvhost using blkio-bench. Signed-off-by: Daniil Tatianin <[email protected]>
Signed-off-by: Daniil Tatianin <[email protected]>
This is achieved by doing 'ninja test' or 'meson test' in the build directory. Signed-off-by: Daniil Tatianin <[email protected]>
Signed-off-by: Daniil Tatianin <[email protected]>
0aab716
to
e948806
Compare
d-tatianin
added a commit
that referenced
this pull request
Feb 12, 2024
Since vhd_vdev_stop_server indirectly releases blockdev via the bottom-half loop, we would touch the ->vblk.serial field of an already released bdev struct. First freed here from the bottom-half, invoked via vhd_unregister_blockdev: #0 0x29c9e90 in free /home/arigachnyy/arc/arcadia/contrib/libs/clang14-rt/lib/asan/asan_malloc_linux.cpp:52:3 #1 0x66815c4 in vhd_free /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/platform.h:169:5 #2 0x668188f in vblk_free /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/blockdev.c:63:5 #3 0x666732b in vhd_vdev_release /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1630:5 #4 0x6668761 in vdev_drained /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1816:9 #5 0x6667e6f in vdev_maybe_finished /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:235:9 #6 0x6667766 in vdev_stop /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1994:5 #7 0x666924f in vdev_work_fn /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1557:5 #8 0x666463f in work_bh /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:540:5 #9 0x6664b4f in bh_call /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:165:5 #10 0x66624bb in bh_poll /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:192:13 #11 0x6661f30 in vhd_run_event_loop /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:351:5 #12 0x665ebbd in vhost_evloop_func /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/server.c:26:15 bdev->vblk then accessed on the line below vhd_vdev_stop_server causing a use-after-free: #0 0x668321d in virtio_blk_destroy_dev /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/virtio/virtio_blk.c:346:19 #1 0x668160c in vhd_unregister_blockdev /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/blockdev.c:154:5 Signed-off-by: Daniil Tatianin <[email protected]>
d-tatianin
added a commit
that referenced
this pull request
Feb 12, 2024
This fixes a memory sanitizer error: ==138663==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x3eaf07e7 in vhd_dequeue_request /-S/cloud/contrib/vhost/server.c:216:9 #1 0x3f2dc3ab in virtio_session_loop /-S/cloud/filestore/libs/fuse/vhost/fuse_virtio.c:411:16 #2 0x3f2c9676 in fuse_session_loop /-S/contrib/libs/virtiofsd/fuse_lowlevel.c:2671:12 #3 0x3f4ebe73 in NCloud::NFileStore::NFuse::(anonymous namespace)::TSessionThread::ThreadProc() /-S/cloud/filestore/libs/fuse/driver.cpp:415:9 #4 0x107fe36f in void* (anonymous namespace)::ThreadProcWrapper<ISimpleThread>(void*) /-S/util/system/thread.cpp:383:45 #5 0x10804e9d in (anonymous namespace)::TPosixThread::ThreadProxy(void*) /-S/util/system/thread.cpp:244:20 #6 0x7faa26a94608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8 #7 0x7faa269b9132 in __clone /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95 SUMMARY: MemorySanitizer: use-of-uninitialized-value /-S/cloud/contrib/vhost/server.c:216:9 in vhd_dequeue_request Exiting Signed-off-by: Daniil Tatianin <[email protected]>
d-tatianin
added a commit
that referenced
this pull request
Feb 12, 2024
Since vhd_vdev_stop_server indirectly releases blockdev via the bottom-half loop, we would touch the ->vblk.serial field of an already released bdev struct. First freed here from the bottom-half, invoked via vhd_unregister_blockdev: #0 0x29c9e90 in free /home/arigachnyy/arc/arcadia/contrib/libs/clang14-rt/lib/asan/asan_malloc_linux.cpp:52:3 #1 0x66815c4 in vhd_free /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/platform.h:169:5 #2 0x668188f in vblk_free /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/blockdev.c:63:5 #3 0x666732b in vhd_vdev_release /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1630:5 #4 0x6668761 in vdev_drained /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1816:9 #5 0x6667e6f in vdev_maybe_finished /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:235:9 #6 0x6667766 in vdev_stop /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1994:5 #7 0x666924f in vdev_work_fn /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1557:5 #8 0x666463f in work_bh /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:540:5 #9 0x6664b4f in bh_call /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:165:5 #10 0x66624bb in bh_poll /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:192:13 #11 0x6661f30 in vhd_run_event_loop /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:351:5 #12 0x665ebbd in vhost_evloop_func /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/server.c:26:15 bdev->vblk then accessed on the line below vhd_vdev_stop_server causing a use-after-free: #0 0x668321d in virtio_blk_destroy_dev /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/virtio/virtio_blk.c:346:19 #1 0x668160c in vhd_unregister_blockdev /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/blockdev.c:154:5 Signed-off-by: Daniil Tatianin <[email protected]>
d-tatianin
added a commit
that referenced
this pull request
Feb 12, 2024
This fixes a memory sanitizer error: ==138663==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x3eaf07e7 in vhd_dequeue_request /-S/cloud/contrib/vhost/server.c:216:9 #1 0x3f2dc3ab in virtio_session_loop /-S/cloud/filestore/libs/fuse/vhost/fuse_virtio.c:411:16 #2 0x3f2c9676 in fuse_session_loop /-S/contrib/libs/virtiofsd/fuse_lowlevel.c:2671:12 #3 0x3f4ebe73 in NCloud::NFileStore::NFuse::(anonymous namespace)::TSessionThread::ThreadProc() /-S/cloud/filestore/libs/fuse/driver.cpp:415:9 #4 0x107fe36f in void* (anonymous namespace)::ThreadProcWrapper<ISimpleThread>(void*) /-S/util/system/thread.cpp:383:45 #5 0x10804e9d in (anonymous namespace)::TPosixThread::ThreadProxy(void*) /-S/util/system/thread.cpp:244:20 #6 0x7faa26a94608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8 #7 0x7faa269b9132 in __clone /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95 SUMMARY: MemorySanitizer: use-of-uninitialized-value /-S/cloud/contrib/vhost/server.c:216:9 in vhd_dequeue_request Exiting Signed-off-by: Daniil Tatianin <[email protected]>
d-tatianin
added a commit
that referenced
this pull request
Feb 12, 2024
Since vhd_vdev_stop_server indirectly releases blockdev via the bottom-half loop, we would touch the ->vblk.serial field of an already released bdev struct. First freed here from the bottom-half, invoked via vhd_unregister_blockdev: #0 0x29c9e90 in free /home/arigachnyy/arc/arcadia/contrib/libs/clang14-rt/lib/asan/asan_malloc_linux.cpp:52:3 #1 0x66815c4 in vhd_free /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/platform.h:169:5 #2 0x668188f in vblk_free /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/blockdev.c:63:5 #3 0x666732b in vhd_vdev_release /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1630:5 #4 0x6668761 in vdev_drained /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1816:9 #5 0x6667e6f in vdev_maybe_finished /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:235:9 #6 0x6667766 in vdev_stop /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1994:5 #7 0x666924f in vdev_work_fn /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1557:5 #8 0x666463f in work_bh /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:540:5 #9 0x6664b4f in bh_call /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:165:5 #10 0x66624bb in bh_poll /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:192:13 #11 0x6661f30 in vhd_run_event_loop /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:351:5 #12 0x665ebbd in vhost_evloop_func /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/server.c:26:15 bdev->vblk then accessed on the line below vhd_vdev_stop_server causing a use-after-free: #0 0x668321d in virtio_blk_destroy_dev /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/virtio/virtio_blk.c:346:19 #1 0x668160c in vhd_unregister_blockdev /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/blockdev.c:154:5 Signed-off-by: Daniil Tatianin <[email protected]>
d-tatianin
added a commit
that referenced
this pull request
Feb 12, 2024
This fixes a memory sanitizer error: ==138663==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x3eaf07e7 in vhd_dequeue_request /-S/cloud/contrib/vhost/server.c:216:9 #1 0x3f2dc3ab in virtio_session_loop /-S/cloud/filestore/libs/fuse/vhost/fuse_virtio.c:411:16 #2 0x3f2c9676 in fuse_session_loop /-S/contrib/libs/virtiofsd/fuse_lowlevel.c:2671:12 #3 0x3f4ebe73 in NCloud::NFileStore::NFuse::(anonymous namespace)::TSessionThread::ThreadProc() /-S/cloud/filestore/libs/fuse/driver.cpp:415:9 #4 0x107fe36f in void* (anonymous namespace)::ThreadProcWrapper<ISimpleThread>(void*) /-S/util/system/thread.cpp:383:45 #5 0x10804e9d in (anonymous namespace)::TPosixThread::ThreadProxy(void*) /-S/util/system/thread.cpp:244:20 #6 0x7faa26a94608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8 #7 0x7faa269b9132 in __clone /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95 SUMMARY: MemorySanitizer: use-of-uninitialized-value /-S/cloud/contrib/vhost/server.c:216:9 in vhd_dequeue_request Exiting Signed-off-by: Daniil Tatianin <[email protected]>
d-tatianin
added a commit
that referenced
this pull request
Feb 16, 2024
Since vhd_vdev_stop_server indirectly releases blockdev via the bottom-half loop, we would touch the ->vblk.serial field of an already released bdev struct. First freed here from the bottom-half, invoked via vhd_unregister_blockdev: #0 0x29c9e90 in free /home/arigachnyy/arc/arcadia/contrib/libs/clang14-rt/lib/asan/asan_malloc_linux.cpp:52:3 #1 0x66815c4 in vhd_free /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/platform.h:169:5 #2 0x668188f in vblk_free /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/blockdev.c:63:5 #3 0x666732b in vhd_vdev_release /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1630:5 #4 0x6668761 in vdev_drained /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1816:9 #5 0x6667e6f in vdev_maybe_finished /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:235:9 #6 0x6667766 in vdev_stop /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1994:5 #7 0x666924f in vdev_work_fn /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1557:5 #8 0x666463f in work_bh /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:540:5 #9 0x6664b4f in bh_call /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:165:5 #10 0x66624bb in bh_poll /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:192:13 #11 0x6661f30 in vhd_run_event_loop /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:351:5 #12 0x665ebbd in vhost_evloop_func /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/server.c:26:15 bdev->vblk then accessed on the line below vhd_vdev_stop_server causing a use-after-free: #0 0x668321d in virtio_blk_destroy_dev /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/virtio/virtio_blk.c:346:19 #1 0x668160c in vhd_unregister_blockdev /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/blockdev.c:154:5 Signed-off-by: Daniil Tatianin <[email protected]>
d-tatianin
added a commit
that referenced
this pull request
Feb 16, 2024
This fixes a memory sanitizer error: ==138663==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x3eaf07e7 in vhd_dequeue_request /-S/cloud/contrib/vhost/server.c:216:9 #1 0x3f2dc3ab in virtio_session_loop /-S/cloud/filestore/libs/fuse/vhost/fuse_virtio.c:411:16 #2 0x3f2c9676 in fuse_session_loop /-S/contrib/libs/virtiofsd/fuse_lowlevel.c:2671:12 #3 0x3f4ebe73 in NCloud::NFileStore::NFuse::(anonymous namespace)::TSessionThread::ThreadProc() /-S/cloud/filestore/libs/fuse/driver.cpp:415:9 #4 0x107fe36f in void* (anonymous namespace)::ThreadProcWrapper<ISimpleThread>(void*) /-S/util/system/thread.cpp:383:45 #5 0x10804e9d in (anonymous namespace)::TPosixThread::ThreadProxy(void*) /-S/util/system/thread.cpp:244:20 #6 0x7faa26a94608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8 #7 0x7faa269b9132 in __clone /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95 SUMMARY: MemorySanitizer: use-of-uninitialized-value /-S/cloud/contrib/vhost/server.c:216:9 in vhd_dequeue_request Exiting Signed-off-by: Daniil Tatianin <[email protected]>
d-tatianin
added a commit
that referenced
this pull request
Feb 28, 2024
Since vhd_vdev_stop_server indirectly releases blockdev via the bottom-half loop, we would touch the ->vblk.serial field of an already released bdev struct. First freed here from the bottom-half, invoked via vhd_unregister_blockdev: #0 0x29c9e90 in free /home/arigachnyy/arc/arcadia/contrib/libs/clang14-rt/lib/asan/asan_malloc_linux.cpp:52:3 #1 0x66815c4 in vhd_free /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/platform.h:169:5 #2 0x668188f in vblk_free /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/blockdev.c:63:5 #3 0x666732b in vhd_vdev_release /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1630:5 #4 0x6668761 in vdev_drained /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1816:9 #5 0x6667e6f in vdev_maybe_finished /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:235:9 #6 0x6667766 in vdev_stop /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1994:5 #7 0x666924f in vdev_work_fn /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/vdev.c:1557:5 #8 0x666463f in work_bh /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:540:5 #9 0x6664b4f in bh_call /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:165:5 #10 0x66624bb in bh_poll /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:192:13 #11 0x6661f30 in vhd_run_event_loop /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/event.c:351:5 #12 0x665ebbd in vhost_evloop_func /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/server.c:26:15 bdev->vblk then accessed on the line below vhd_vdev_stop_server causing a use-after-free: #0 0x668321d in virtio_blk_destroy_dev /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/virtio/virtio_blk.c:346:19 #1 0x668160c in vhd_unregister_blockdev /home/arigachnyy/arc/arcadia/cloud/contrib/vhost/blockdev.c:154:5 Signed-off-by: Daniil Tatianin <[email protected]>
d-tatianin
added a commit
that referenced
this pull request
Feb 28, 2024
This fixes a memory sanitizer error: ==138663==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x3eaf07e7 in vhd_dequeue_request /-S/cloud/contrib/vhost/server.c:216:9 #1 0x3f2dc3ab in virtio_session_loop /-S/cloud/filestore/libs/fuse/vhost/fuse_virtio.c:411:16 #2 0x3f2c9676 in fuse_session_loop /-S/contrib/libs/virtiofsd/fuse_lowlevel.c:2671:12 #3 0x3f4ebe73 in NCloud::NFileStore::NFuse::(anonymous namespace)::TSessionThread::ThreadProc() /-S/cloud/filestore/libs/fuse/driver.cpp:415:9 #4 0x107fe36f in void* (anonymous namespace)::ThreadProcWrapper<ISimpleThread>(void*) /-S/util/system/thread.cpp:383:45 #5 0x10804e9d in (anonymous namespace)::TPosixThread::ThreadProxy(void*) /-S/util/system/thread.cpp:244:20 #6 0x7faa26a94608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8 #7 0x7faa269b9132 in __clone /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95 SUMMARY: MemorySanitizer: use-of-uninitialized-value /-S/cloud/contrib/vhost/server.c:216:9 in vhd_dequeue_request Exiting Signed-off-by: Daniil Tatianin <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.