Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
3
-
9223372036854775807
Description
This is an environment of kernel and Lustre which is built by clang instead of gcc on ubuntu24.04.
$ sudo dmesg | grep 'Linux version' [ 0.000000] Linux version 6.8.12clang (ubuntu@u2404-srv1) (Ubuntu clang version 18.1.3 (1ubuntu1), Ubuntu LLD 18.1.3) #1 SMP PREEMPT_DYNAMIC Thu Dec 5 09:13:19 UTC 2024 (Ubuntu 6.8.0-49.49-generic 6.8.12)
Lustre master branch was able to be built by clang except LU-18517.
$ sh ./autogen.sh; ./configure CC=clang 'CFLAGS=-Wno-frame-address -Wno-incompatible-function-pointer-types' --with-linux=/home/ubuntu/linux-source-6.8.0/ LLVM=1 $ sudo modprobe lustre $ modinfo lustre filename: /lib/modules/6.8.0-49-generic-clang-2/updates/kernel/fs/lustre/lustre.ko alias: fs-lustre author: OpenSFS, Inc. <http://www.lustre.org/> description: Lustre Client File System version: 2.16.50_87_g64e158b license: GPL vermagic: 6.8.0-49-generic-clang-2 SMP preempt mod_unload modversions name: lustre retpoline: Y depends: ptlrpc,libcfs,obdclass,mdc,lmv,lov,lnet,fid srcversion: F6E501204471DEE570F0971
However, when a device is mounted as Lustre, it hangs. Even device is just MGT.
$ sudo mkfs.lustre --mgs --device-size=100000 /tmp/mdt $ sudo mount /tmp/mdt -o loop /mnt/ -t lustre
mount doesn't complete and stuck here.
[25204.948835] ------------[ cut here ]------------ [25204.948843] UBSAN: array-index-out-of-bounds in /home/ubuntu/lustre-release/ldiskfs/htree_lock.c:874:35 [25204.951242] index 1 is out of range for type 'struct htree_lock_node[0]' [25204.952946] CPU: 15 PID: 74322 Comm: mount.lustre Tainted: G OE 6.8.0-49-generic-clang-2 #4 [25204.952960] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009)/Incus, BIOS unknown 02/02/2022 [25204.952966] Call Trace: [25204.952989] <TASK> [25204.952997] dump_stack_lvl+0x2f/0xa0 [25204.953051] dump_stack+0x10/0x20 [25204.953058] __ubsan_handle_out_of_bounds+0xe8/0x110 [25204.953094] htree_lock_alloc+0xdf/0x1b0 [ldiskfs] [25204.953204] ldiskfs_htree_lock_alloc+0x18/0x30 [ldiskfs] [25204.953287] osd_key_init+0x1c2/0x370 [osd_ldiskfs] [25204.953350] keys_fill+0x8f/0x120 [obdclass] [25204.953503] lu_context_init+0x15b/0x190 [obdclass] [25204.953644] lu_env_init+0x1a/0x30 [obdclass] [25204.953817] obd_setup+0x1f5/0x3e0 [obdclass] [25204.953961] class_setup+0x487/0x840 [obdclass] [25204.954103] class_process_config+0x1bdf/0x31a0 [obdclass] [25204.954247] ? libcfs_debug_msg+0xab7/0xe20 [libcfs] [25204.954291] ? __kmalloc+0x1bd/0x460 [25204.954304] do_lcfg+0x495/0x830 [obdclass] [25204.954447] lustre_start_simple+0x136/0x1e0 [obdclass] [25204.954590] server_fill_super+0x7c8/0x14d0 [ptlrpc] [25204.954853] lustre_fill_super+0x255/0x480 [lustre] [25204.954961] ? __pfx_lustre_fill_super+0x10/0x10 [lustre] [25204.955050] mount_nodev+0x52/0xb0 [25204.955065] lustre_mount+0x18/0x30 [lustre] [25204.955200] legacy_get_tree+0x2c/0x60 [25204.955221] vfs_get_tree+0x2f/0xf0 [25204.955228] do_new_mount+0x143/0x3a0 [25204.955239] path_mount+0x311/0x540 [25204.955245] __se_sys_mount+0x174/0x1f0 [25204.955251] __x64_sys_mount+0x25/0x40 [25204.955256] x64_sys_call+0x2726/0x2be0 [25204.955268] do_syscall_64+0x89/0x160 [25204.955276] ? fsnotify_destroy_marks+0x87/0x1c0 [25204.955288] ? call_rcu+0x25/0x60 [25204.955301] ? evict+0x202/0x230 [25204.955318] ? kmem_cache_free+0x2b/0x2d0 [25204.955329] ? fpregs_restore_userregs+0x81/0x150 [25204.955348] ? switch_fpu_return+0xe/0x20 [25204.955354] ? arch_exit_to_user_mode_prepare+0x68/0x70 [25204.955365] ? syscall_exit_to_user_mode+0xb6/0xe0 [25204.955375] ? do_syscall_64+0x95/0x160 [25204.955383] ? __memcg_slab_free_hook+0x48/0x1d0 [25204.955391] ? __fput+0x1a7/0x2d0 [25204.955396] ? kmem_cache_free+0x193/0x2d0 [25204.955402] ? __fput+0x1a7/0x2d0 [25204.955407] ? __fput_sync+0x15/0x20 [25204.955411] ? arch_exit_to_user_mode_prepare+0x22/0x70 [25204.955417] ? syscall_exit_to_user_mode+0xb6/0xe0 [25204.955422] ? do_syscall_64+0x95/0x160 [25204.955429] ? irqentry_exit+0x12/0x50 [25204.955434] ? exc_page_fault+0x74/0xf0 [25204.955444] entry_SYSCALL_64_after_hwframe+0x78/0x80 [25204.955465] RIP: 0033:0x75a56932af0e [25204.955473] Code: 48 8b 0d 0d 7f 0d 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d da 7e 0d 00 f7 d8 64 89 01 48 [25204.955479] RSP: 002b:00007ffe239b4078 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 [25204.955487] RAX: ffffffffffffffda RBX: 00007ffe239b83d8 RCX: 000075a56932af0e [25204.955492] RDX: 000061f0e643668a RSI: 00007ffe239b7280 RDI: 000061f0e71dd930 [25204.955495] RBP: 00007ffe239b82b0 R08: 000061f0e71dd950 R09: 0000000000000007 [25204.955499] R10: 0000000001000000 R11: 0000000000000206 R12: 0000000000000005 [25204.955503] R13: 0000000000000000 R14: 000061f0e6439b48 R15: 000075a5695a9000 [25204.955510] </TASK> [25204.955556] ---[ end trace ]---
Merged for 2.17