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

Compiled using patch lk6.5-block in linux-6.5 and blksnap-master versions, a bug occurred in the test 1000-simple.sh #67

Closed
DoubleFrzz opened this issue Oct 25, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@DoubleFrzz
Copy link

Distribution

CentOS7.9

Architecture

x86

Kernel version

6.5.0

Blksnap version

blksnap-master

Bug description

test case

[root@localhost tests]# ./1000-simple.sh
Diff storage directory /root
---
Simple test start
2.0.0.0
64+0 records in
64+0 records out
67108864 bytes (67 MB, 64 MiB) copied, 0.0352581 s, 1.9 GB/s
mke2fs 1.46.4 (18-Aug-2021)
Discarding device blocks: done
Creating filesystem with 65536 1k blocks and 16384 inodes
Filesystem UUID: 850128b3-102c-463f-afda-c106235f95fe
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

new image file /tmp/blksnap-test/simple_1.img
new device /dev/loop2
128+0 records in
128+0 records out
134217728 bytes (134 MB, 128 MiB) copied, 0.0491959 s, 2.7 GB/s
mke2fs 1.46.4 (18-Aug-2021)
Discarding device blocks: done
Creating filesystem with 131072 1k blocks and 32768 inodes
Filesystem UUID: 43a7a71a-0b5c-4c2b-8481-43803d7c25a6
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

new image file /tmp/blksnap-test/simple_2.img
new device /dev/loop3
generate files in /mnt/blksnap-test/simple_1
file: ./before-0 size: 27 sectors
file: ./before-1 size: 65 sectors
file: ./before-2 size: 97 sectors
file: ./before-3 size: 75 sectors
file: ./before-4 size: 13 sectors
file: ./before-5 size: 38 sectors
file: ./before-6 size: 57 sectors
file: ./before-7 size: 81 sectors
file: ./before-8 size: 55 sectors
generate complete
Block device prepared, press ...
2.0.0.0
New snapshot 00000000-0000-0000-0000-000000000000 was created
Append file /root/diff_storage0 to diff storage
allocate range: ofs=27181056 cnt=2097152
./blksnap.sh: line 34:  1746 Killed                  ${BLKSNAP} snapshot_appendstorage --id=${ID} --file=${FILE}

dmesg

[  457.449280] 1000-simple.sh (1697): drop_caches: 3
[  457.483556] BUG: kernel NULL pointer dereference, address: 0000000000000002
[  457.484096] #PF: supervisor instruction fetch in kernel mode
[  457.484511] #PF: error_code(0x0010) - not-present page
[  457.484898] PGD 0 P4D 0
[  457.485062] Oops: 0010 [#2] PREEMPT SMP NOPTI
[  457.485337] CPU: 11 PID: 1746 Comm: blksnap Kdump: loaded Tainted: G      D            6.5.0 #7
[  457.485858] Hardware name: Red Hat KVM, BIOS 1.13.0-2.ctl2 04/01/2014
[  457.486274] RIP: 0010:0x2
[  457.486454] Code: Unable to access opcode bytes at 0xffffffffffffffd8.
[  457.486876] RSP: 0018:ffffba6100ee7f00 EFLAGS: 00010202
[  457.487218] RAX: 0000000000000002 RBX: ffff9fac023e6c00 RCX: 00007ffdd9130600
[  457.487670] RDX: 00007ffdd9130600 RSI: 0000000000000000 RDI: 00007ffdd9130600
[  457.488123] RBP: 0000000040285607 R08: 0000000000000000 R09: 0000000000000000
[  457.488571] R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000003
[  457.489001] R13: 00007ffdd9130600 R14: ffff9fac023e6c00 R15: 0000000000000000
[  457.489434] FS:  00007f6b28f1e780(0000) GS:ffff9fb2fc0c0000(0000) knlGS:0000000000000000
[  457.489916] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  457.490293] CR2: ffffffffffffffd8 CR3: 000000010694e005 CR4: 0000000000770ee0
[  457.490743] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  457.491199] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  457.491650] PKRU: 55555554
[  457.491830] Call Trace:
[  457.491995]  <TASK>
[  457.492143]  ? __die+0x1f/0x70
[  457.492366]  ? page_fault_oops+0x156/0x420
[  457.492623]  ? exc_page_fault+0x69/0x150
[  457.492872]  ? asm_exc_page_fault+0x26/0x30
[  457.493157]  ? ctrl_unlocked_ioctl+0x22/0x40 [blksnap]
[  457.493491]  ? __x64_sys_ioctl+0x8a/0xc0
[  457.493750]  ? do_syscall_64+0x3c/0x90
[  457.493997]  ? entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[  457.494336]  </TASK>
[  457.494485] Modules linked in: blksnap iptable_nat
[  457.494798] CR2: 0000000000000002
[  457.495017] ---[ end trace 0000000000000000 ]---
[  457.495316] RIP: 0010:0x2
[  457.495494] Code: Unable to access opcode bytes at 0xffffffffffffffd8.
[  457.495908] RSP: 0018:ffffba6100dfbf00 EFLAGS: 00010202
[  457.496244] RAX: 0000000000000002 RBX: ffff9fac07259600 RCX: 00007ffe903e6170
[  457.496688] RDX: 00007ffe903e6170 RSI: 0000000000000000 RDI: 00007ffe903e6170
[  457.497119] RBP: 0000000040285607 R08: 0000000000000000 R09: 0000000000000000
[  457.497577] R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000003
[  457.498029] R13: 00007ffe903e6170 R14: ffff9fac07259600 R15: 0000000000000000
[  457.498485] FS:  00007f6b28f1e780(0000) GS:ffff9fb2fc0c0000(0000) knlGS:0000000000000000
[  457.498991] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  457.499362] CR2: ffffffffffffffd8 CR3: 000000010694e005 CR4: 0000000000770ee0
[  457.499816] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  457.500283] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  457.500711] PKRU: 55555554
[  457.500885] note: blksnap[1746] exited with irqs disabled

Steps to reproduce

No response

Expected behavior

No response

Additional informations

No response

@DoubleFrzz DoubleFrzz added the bug Something isn't working label Oct 25, 2023
@DoubleFrzz DoubleFrzz changed the title Compiled using patch lk6.5-block in linux-6.5 and blksnap-master versions, a bug occurred in the test Compiled using patch lk6.5-block in linux-6.5 and blksnap-master versions, a bug occurred in the test 1000-simple.sh Oct 25, 2023
@DoubleFrzz
Copy link
Author

When using the blksnap-stable-v2.0 version for testing, the following error occurs:

[root@localhost tests]# ./1000-simple.sh
Diff storage directory /root
---
Simple test start
2.0.0.0
mke2fs 1.46.4 (18-Aug-2021)
Discarding device blocks: done
Creating filesystem with 65536 1k blocks and 16384 inodes
Filesystem UUID: 3628cdfc-80dd-457d-b360-907f2b695443
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

new image file /root/blksnap-test/simple_1.img
new device /dev/loop4
mke2fs 1.46.4 (18-Aug-2021)
Discarding device blocks: done
Creating filesystem with 131072 1k blocks and 32768 inodes
Filesystem UUID: 4b590317-2aef-4f2d-9382-ae8ee518d5f4
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

new image file /root/blksnap-test/simple_2.img
new device /dev/loop5
generate files in /mnt/blksnap-test/simple_1
file: /mnt/blksnap-test/simple_1/before-0 size: 107 KiB
file: /mnt/blksnap-test/simple_1/before-1 size: 55 KiB
file: /mnt/blksnap-test/simple_1/before-2 size: 75 KiB
file: /mnt/blksnap-test/simple_1/before-3 size: 86 KiB
file: /mnt/blksnap-test/simple_1/before-4 size: 49 KiB
file: /mnt/blksnap-test/simple_1/before-5 size: 83 KiB
file: /mnt/blksnap-test/simple_1/before-6 size: 42 KiB
file: /mnt/blksnap-test/simple_1/before-7 size: 64 KiB
file: /mnt/blksnap-test/simple_1/before-8 size: 88 KiB
generate complete
unrecognised option '--file'

@Fantu
Copy link
Contributor

Fantu commented Oct 28, 2023

Hi, thanks for help to test latest version for upstream
about the kernel if you used the patch v5 posted (https://github.com/veeam/blksnap/tree/master/patches/lk6.5-block - https://lore.kernel.org/linux-block/ZIcsijGWeyk%[email protected]/T/#mc6b9e9bb70021d25decba816766a80fe54911539) there were significant changes done after, was recommended by the kernel developers that reviewed it and necessary for upstream acceptance (which appears to be approaching)
For test the v6 in development is needed updated branch (https://github.com/SergeiShtepa/linux/tree/blksnap-master) and tools from blksnap stable-v2.0 branch (https://github.com/veeam/blksnap/tree/stable-v2.0) where needed changes was done.
Different kernel and blksnap tools combinations are not compatible due to substantial changes.
The note to test the latest version was placed here: https://github.com/veeam/blksnap/blob/master/doc/README-upstream-kernel.md#work-in-progress-and-news
that document had not been updated with v4 (and v5 that was only a rebase done immediately afterwards) but the kernel and blksnap branches for testing latest changes remain the same.
the latest news of the upstream work is also here: #2 (comment)

@Fantu
Copy link
Contributor

Fantu commented Oct 29, 2023

@SergeiShtepa I did fast test today, fixed build on gcc13 with #69
about tests in latest stable-v2.0 (+ fixes of PR 69) "./1000-simple.sh" is working, I had issue on "1100-loop_diff_storage.sh" failed on mount of DEVICE_1, probably failed to generate correctly the imagefile fs but I not checked exactly, unfortunately these days I'm sick and now that I'm tired stopped the test

@DoubleFrzz
Copy link
Author

I changed the patched version and it passed the test. Thank you for your answer.

@SergeiShtepa
Copy link
Collaborator

Thanks everyone.
Since the tests are successful after all updates, I close the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants