为什么当我的 linux 驱动程序第二次失败而第一次 insmod 运行正常时它转储堆栈两次

发布于 2025-01-09 15:46:10 字数 10938 浏览 0 评论 0原文

几天前我开始学习linux驱动程序,我写了一个简单的驱动程序。首先我insmod了我的驱动程序,它显示它运行良好,并且当我rmmod时正常。但是当我再次insmod它时,控制台日志显示“killed”,然后我使用dmesg。内核日志显示了两次 stackdump,这让我很惊讶,所以我不知道如何调试(使用 printk (●'◡'●))。 在搜索机上尝试了很多次,但一无所获。所以我把它扔在这里,非常非常迫切地需要你们的帮助。我真的想知道为什么它第二次失败,为什么 stackdump 发生两次以及我该如何修复这个驱动程序。非常非常感谢! 我的虚拟机Linux内核版本是:5.13.0 驱动程序代码在这里:

    #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/printk.h>
#include <linux/fs.h>
#include <linux/kdev_t.h>
#include <linux/device.h>
#include <linux/export.h>
#include <linux/types.h>
#include <linux/kobject.h>

static ssize_t my_file_show(struct device *dev,
 struct device_attribute *attr, char *buf)
{
    return snprintf(buf, 64, "%s", __func__);
}

static ssize_t my_file_store(struct device *dev,
 struct device_attribute *attr, const char *buf, size_t count)
{   
    pr_info("going to my_file_store\n");
    return count;
}
static DEVICE_ATTR(my_file, 0664, my_file_show, my_file_store);
static int my_devid = -1;
static struct class *my_class = NULL;
static struct device *my_device = NULL;

static int __init my_init(void){
    pr_info("going to %s\n", __func__);
    int ret = 0;
    
    ret = alloc_chrdev_region(&my_devid, 0, 1, "my_devid");
    if(ret < 0){
        my_devid = -1;
        pr_err("[%s,%d]alloc_chrdev_region failed\n", __func__, __LINE__);
        goto FAULT;
    }
    pr_info("my devid %d\n", my_devid);
    
    my_class = class_create(THIS_MODULE, "my_class");
    if(my_class == NULL){
        pr_err("[%s,%d]class_create failed\n", __func__, __LINE__);
        goto FAULT;
    }
    
    pr_info("[%s,%d]goes here\n", __func__, __LINE__);
    my_device = device_create(my_class, NULL,  my_devid, "%s", "my_dev");
    if(my_device == NULL){
        pr_err("[%s,%d] device_create failed\n", __func__, __LINE__);
        goto FAULT;
    }
    
    pr_info("[%s,%d]goes here\n", __func__, __LINE__);
    ret = device_create_file(my_device, &dev_attr_my_file);
    if(ret < 0){
        pr_err("sysfs_create_file failed\n");
        goto FAULT;
    }
    pr_info("go to init tail now\n");
    return 0;
FAULT:
    if(my_devid != -1){
        unregister_chrdev_region(my_devid, "my_devid");
        my_devid = -1;
    }
    
    if(my_device != NULL){
        device_destroy(my_class, my_devid);
        my_device = NULL;
    }
        
    if(my_class != NULL){
        class_destroy(my_class);
        my_class = NULL;
    }

    return 0;
}

static void  __exit my_exit(void){
    pr_info("going to %s\n", __func__);
    device_remove_file(my_device, &dev_attr_my_file);
    
    if(my_devid != -1){
        unregister_chrdev_region(my_devid, "my_devid");
        my_devid = -1;
    }
    
    if(my_device != NULL){
        device_destroy(my_class, my_devid);
        my_device = NULL;
    }
        
    if(my_class != NULL){
        class_destroy(my_class);
        my_class = NULL;
    }

}

module_init(my_init);
module_exit(my_exit);

MODULE_AUTHOR("tid");
MODULE_LICENSE("GPL");

这是 dmesg:

going to my_init
[87682.699433] my devid 247463936
[87682.700041] [my_init,47]goes here
[87682.706933] [my_init,54]goes here
[87682.706937] go to init tail now
[87704.903499] going to my_exit
[87747.424115] going to my_init
[87747.424385] my devid 262144000
[87747.424418] [my_init,47]goes here
[87747.424784] sysfs: cannot create duplicate filename '/devices/virtual/my_class'
[87747.424989] CPU: 1 PID: 462167 Comm: insmod Tainted: G           OE     5.13.0-27-generic #29~20.04.1-Ubuntu
[87747.424992] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
[87747.425172] Call Trace:
[87747.426055]  dump_stack+0x7d/0x9c
[87747.427617]  sysfs_warn_dup.cold+0x17/0x27
[87747.427889]  sysfs_create_dir_ns+0xb8/0xd0
[87747.428703]  kobject_add_internal+0xbd/0x2b0
[87747.429021]  kobject_add+0x7e/0xb0
[87747.429023]  ? kmem_cache_alloc_trace+0x37c/0x440
[87747.429671]  get_device_parent.isra.0+0x179/0x1b0
[87747.429943]  device_add+0xe3/0x8e0
[87747.429945]  device_create_groups_vargs+0xd4/0xf0
[87747.429946]  ? 0xffffffffc09b1000
[87747.429948]  device_create+0x49/0x60
[87747.429950]  my_init+0xf0/0x1000 [test]
[87747.430241]  do_one_initcall+0x46/0x1d0
[87747.430632]  ? __cond_resched+0x19/0x30
[87747.430866]  ? kmem_cache_alloc_trace+0x37c/0x440
[87747.430869]  do_init_module+0x62/0x260
[87747.430898]  load_module+0x125d/0x1440
[87747.431183]  __do_sys_finit_module+0xc2/0x120
[87747.431185]  ? __do_sys_finit_module+0xc2/0x120
[87747.431186]  __x64_sys_finit_module+0x1a/0x20
[87747.431188]  do_syscall_64+0x61/0xb0
[87747.431260]  ? __x64_sys_newfstat+0x16/0x20
[87747.431361]  ? do_syscall_64+0x6e/0xb0
[87747.431363]  ? __x64_sys_lseek+0x1a/0x20
[87747.431380]  ? do_syscall_64+0x6e/0xb0
[87747.431382]  ? exc_page_fault+0x8f/0x170
[87747.431383]  ? asm_exc_page_fault+0x8/0x30
[87747.431385]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[87747.431386] RIP: 0033:0x7fd6b8d3789d
[87747.431388] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c3 f5 0c 00 f7 d8 64 89 01 48
[87747.431390] RSP: 002b:00007ffe09073bd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[87747.431405] RAX: ffffffffffffffda RBX: 0000557d4fa68760 RCX: 00007fd6b8d3789d
[87747.431405] RDX: 0000000000000000 RSI: 0000557d4db48358 RDI: 0000000000000003
[87747.431406] RBP: 0000000000000000 R08: 0000000000000000 R09: 00007fd6b8e0b260
[87747.431407] R10: 0000000000000003 R11: 0000000000000246 R12: 0000557d4db48358
[87747.431407] R13: 0000000000000000 R14: 0000557d4fa683d0 R15: 0000000000000000
[87747.431503] kobject_add_internal failed for my_class with -EEXIST, don't try to register things with the same name in the same directory.
[87747.431713] [my_init,54]goes here
[87747.431749] BUG: kernel NULL pointer dereference, address: 000000000000001f
[87747.431765] #PF: supervisor read access in kernel mode
[87747.431780] #PF: error_code(0x0000) - not-present page
[87747.431819] PGD 0 P4D 0 
[87747.431821] Oops: 0000 [#1] SMP NOPTI
[87747.431823] CPU: 1 PID: 462167 Comm: insmod Tainted: G           OE     5.13.0-27-generic #29~20.04.1-Ubuntu
[87747.431825] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
[87747.431826] RIP: 0010:sysfs_create_file_ns+0x26/0x90
[87747.431829] Code: 9c 0f 1f 00 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 53 48 83 ec 10 65 48 8b 04 25 28 00 00 00 48 89 45 e0 31 c0 48 85 ff 74 5b <48> 83 7f 30 00 48 89 fb 74 51 49 89 f4 48 85 f6 74 49 49 89 d5 48
[87747.431831] RSP: 0018:ffffa39a0406fbe0 EFLAGS: 00010282
[87747.431832] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000027
[87747.431833] RDX: 0000000000000000 RSI: ffffffffc09ae020 RDI: ffffffffffffffef
[87747.431834] RBP: ffffa39a0406fc08 R08: ffff8e77b9e589c0 R09: ffffa39a0406fa18
[87747.431835] R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffc09ae020
[87747.431836] R13: ffffffffffffffef R14: ffffffffc09ae040 R15: 0000000000000000
[87747.431837] FS:  00007fd6b8bf2540(0000) GS:ffff8e77b9e40000(0000) knlGS:0000000000000000
[87747.431838] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[87747.432290] CR2: 000000000000001f CR3: 000000001f4c8005 CR4: 00000000003706e0
[87747.432721] Call Trace:
[87747.432724]  device_create_file+0x42/0x80
[87747.432726]  ? 0xffffffffc09b1000
[87747.432728]  my_init+0x141/0x1000 [test]
[87747.432730]  do_one_initcall+0x46/0x1d0
[87747.432732]  ? __cond_resched+0x19/0x30
[87747.432734]  ? kmem_cache_alloc_trace+0x37c/0x440
[87747.432737]  do_init_module+0x62/0x260
[87747.432739]  load_module+0x125d/0x1440
[87747.432741]  __do_sys_finit_module+0xc2/0x120
[87747.432742]  ? __do_sys_finit_module+0xc2/0x120
[87747.432743]  __x64_sys_finit_module+0x1a/0x20
[87747.432745]  do_syscall_64+0x61/0xb0
[87747.432747]  ? __x64_sys_newfstat+0x16/0x20
[87747.432749]  ? do_syscall_64+0x6e/0xb0
[87747.432750]  ? __x64_sys_lseek+0x1a/0x20
[87747.432752]  ? do_syscall_64+0x6e/0xb0
[87747.432754]  ? exc_page_fault+0x8f/0x170
[87747.432755]  ? asm_exc_page_fault+0x8/0x30
[87747.432756]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[87747.432758] RIP: 0033:0x7fd6b8d3789d
[87747.432759] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c3 f5 0c 00 f7 d8 64 89 01 48
[87747.432760] RSP: 002b:00007ffe09073bd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[87747.432762] RAX: ffffffffffffffda RBX: 0000557d4fa68760 RCX: 00007fd6b8d3789d
[87747.433030] RDX: 0000000000000000 RSI: 0000557d4db48358 RDI: 0000000000000003
[87747.433032] RBP: 0000000000000000 R08: 0000000000000000 R09: 00007fd6b8e0b260
[87747.433033] R10: 0000000000000003 R11: 0000000000000246 R12: 0000557d4db48358
[87747.433033] R13: 0000000000000000 R14: 0000557d4fa683d0 R15: 0000000000000000
[87747.433036] Modules linked in: test(OE+) vsock_loopback vmw_vsock_virtio_transport_common vmw_vsock_vmci_transport vsock nls_iso8859_1 intel_rapl_msr intel_rapl_common crct10dif_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd rapl vmw_balloon snd_ens1371 snd_ac97_codec gameport ac97_bus snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi joydev input_leds serio_raw snd_seq snd_seq_device snd_timer snd soundcore vmw_vmci mac_hid sch_fq_codel vmwgfx ttm drm_kms_helper cec rc_core fb_sys_fops syscopyarea sysfillrect sysimgblt msr nfsd parport_pc auth_rpcgss ppdev nfs_acl lockd lp grace parport drm sunrpc ip_tables x_tables autofs4 hid_generic ahci e1000 libahci usbhid hid mptspi mptscsih mptbase crc32_pclmul psmouse scsi_transport_spi i2c_piix4 pata_acpi [last unloaded: test]
[87747.433869] CR2: 000000000000001f
[87747.434327] ---[ end trace d7785aaa07b44309 ]---
[87747.434352] RIP: 0010:sysfs_create_file_ns+0x26/0x90
[87747.434357] Code: 9c 0f 1f 00 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 53 48 83 ec 10 65 48 8b 04 25 28 00 00 00 48 89 45 e0 31 c0 48 85 ff 74 5b <48> 83 7f 30 00 48 89 fb 74 51 49 89 f4 48 85 f6 74 49 49 89 d5 48
[87747.434359] RSP: 0018:ffffa39a0406fbe0 EFLAGS: 00010282
[87747.434361] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000027
[87747.434362] RDX: 0000000000000000 RSI: ffffffffc09ae020 RDI: ffffffffffffffef
[87747.434363] RBP: ffffa39a0406fc08 R08: ffff8e77b9e589c0 R09: ffffa39a0406fa18
[87747.434363] R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffc09ae020
[87747.434364] R13: ffffffffffffffef R14: ffffffffc09ae040 R15: 0000000000000000
[87747.434365] FS:  00007fd6b8bf2540(0000) GS:ffff8e77b9e40000(0000) knlGS:0000000000000000
[87747.434366] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[87747.434368] CR2: 000000000000001f CR3: 000000001f4c8005 CR4: 00000000003706e0

i started learning linux driver a few days ago and i write a simple driver.fisrt i insmod my driver ,it showed it runs well ,and normal when i rmmod. but when i insmod it again, console log showed "killed", and then i use dmesg. The kernel log showed twice stackdump which surprised me so that i don't how to debug(use printk (●'◡'●)).
Many times tried on search machine, i got nothing. so i throwed it here, needing your guys help very very desperate. i truely wanna know why it failed at second time, why stackdump happened twice and how could i fix this driver. thanks very very much!
my vm linux kernel version is : 5.13.0
driver code is here:

    #include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/printk.h>
#include <linux/fs.h>
#include <linux/kdev_t.h>
#include <linux/device.h>
#include <linux/export.h>
#include <linux/types.h>
#include <linux/kobject.h>

static ssize_t my_file_show(struct device *dev,
 struct device_attribute *attr, char *buf)
{
    return snprintf(buf, 64, "%s", __func__);
}

static ssize_t my_file_store(struct device *dev,
 struct device_attribute *attr, const char *buf, size_t count)
{   
    pr_info("going to my_file_store\n");
    return count;
}
static DEVICE_ATTR(my_file, 0664, my_file_show, my_file_store);
static int my_devid = -1;
static struct class *my_class = NULL;
static struct device *my_device = NULL;

static int __init my_init(void){
    pr_info("going to %s\n", __func__);
    int ret = 0;
    
    ret = alloc_chrdev_region(&my_devid, 0, 1, "my_devid");
    if(ret < 0){
        my_devid = -1;
        pr_err("[%s,%d]alloc_chrdev_region failed\n", __func__, __LINE__);
        goto FAULT;
    }
    pr_info("my devid %d\n", my_devid);
    
    my_class = class_create(THIS_MODULE, "my_class");
    if(my_class == NULL){
        pr_err("[%s,%d]class_create failed\n", __func__, __LINE__);
        goto FAULT;
    }
    
    pr_info("[%s,%d]goes here\n", __func__, __LINE__);
    my_device = device_create(my_class, NULL,  my_devid, "%s", "my_dev");
    if(my_device == NULL){
        pr_err("[%s,%d] device_create failed\n", __func__, __LINE__);
        goto FAULT;
    }
    
    pr_info("[%s,%d]goes here\n", __func__, __LINE__);
    ret = device_create_file(my_device, &dev_attr_my_file);
    if(ret < 0){
        pr_err("sysfs_create_file failed\n");
        goto FAULT;
    }
    pr_info("go to init tail now\n");
    return 0;
FAULT:
    if(my_devid != -1){
        unregister_chrdev_region(my_devid, "my_devid");
        my_devid = -1;
    }
    
    if(my_device != NULL){
        device_destroy(my_class, my_devid);
        my_device = NULL;
    }
        
    if(my_class != NULL){
        class_destroy(my_class);
        my_class = NULL;
    }

    return 0;
}

static void  __exit my_exit(void){
    pr_info("going to %s\n", __func__);
    device_remove_file(my_device, &dev_attr_my_file);
    
    if(my_devid != -1){
        unregister_chrdev_region(my_devid, "my_devid");
        my_devid = -1;
    }
    
    if(my_device != NULL){
        device_destroy(my_class, my_devid);
        my_device = NULL;
    }
        
    if(my_class != NULL){
        class_destroy(my_class);
        my_class = NULL;
    }

}

module_init(my_init);
module_exit(my_exit);

MODULE_AUTHOR("tid");
MODULE_LICENSE("GPL");

this is dmesg:

going to my_init
[87682.699433] my devid 247463936
[87682.700041] [my_init,47]goes here
[87682.706933] [my_init,54]goes here
[87682.706937] go to init tail now
[87704.903499] going to my_exit
[87747.424115] going to my_init
[87747.424385] my devid 262144000
[87747.424418] [my_init,47]goes here
[87747.424784] sysfs: cannot create duplicate filename '/devices/virtual/my_class'
[87747.424989] CPU: 1 PID: 462167 Comm: insmod Tainted: G           OE     5.13.0-27-generic #29~20.04.1-Ubuntu
[87747.424992] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
[87747.425172] Call Trace:
[87747.426055]  dump_stack+0x7d/0x9c
[87747.427617]  sysfs_warn_dup.cold+0x17/0x27
[87747.427889]  sysfs_create_dir_ns+0xb8/0xd0
[87747.428703]  kobject_add_internal+0xbd/0x2b0
[87747.429021]  kobject_add+0x7e/0xb0
[87747.429023]  ? kmem_cache_alloc_trace+0x37c/0x440
[87747.429671]  get_device_parent.isra.0+0x179/0x1b0
[87747.429943]  device_add+0xe3/0x8e0
[87747.429945]  device_create_groups_vargs+0xd4/0xf0
[87747.429946]  ? 0xffffffffc09b1000
[87747.429948]  device_create+0x49/0x60
[87747.429950]  my_init+0xf0/0x1000 [test]
[87747.430241]  do_one_initcall+0x46/0x1d0
[87747.430632]  ? __cond_resched+0x19/0x30
[87747.430866]  ? kmem_cache_alloc_trace+0x37c/0x440
[87747.430869]  do_init_module+0x62/0x260
[87747.430898]  load_module+0x125d/0x1440
[87747.431183]  __do_sys_finit_module+0xc2/0x120
[87747.431185]  ? __do_sys_finit_module+0xc2/0x120
[87747.431186]  __x64_sys_finit_module+0x1a/0x20
[87747.431188]  do_syscall_64+0x61/0xb0
[87747.431260]  ? __x64_sys_newfstat+0x16/0x20
[87747.431361]  ? do_syscall_64+0x6e/0xb0
[87747.431363]  ? __x64_sys_lseek+0x1a/0x20
[87747.431380]  ? do_syscall_64+0x6e/0xb0
[87747.431382]  ? exc_page_fault+0x8f/0x170
[87747.431383]  ? asm_exc_page_fault+0x8/0x30
[87747.431385]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[87747.431386] RIP: 0033:0x7fd6b8d3789d
[87747.431388] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c3 f5 0c 00 f7 d8 64 89 01 48
[87747.431390] RSP: 002b:00007ffe09073bd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[87747.431405] RAX: ffffffffffffffda RBX: 0000557d4fa68760 RCX: 00007fd6b8d3789d
[87747.431405] RDX: 0000000000000000 RSI: 0000557d4db48358 RDI: 0000000000000003
[87747.431406] RBP: 0000000000000000 R08: 0000000000000000 R09: 00007fd6b8e0b260
[87747.431407] R10: 0000000000000003 R11: 0000000000000246 R12: 0000557d4db48358
[87747.431407] R13: 0000000000000000 R14: 0000557d4fa683d0 R15: 0000000000000000
[87747.431503] kobject_add_internal failed for my_class with -EEXIST, don't try to register things with the same name in the same directory.
[87747.431713] [my_init,54]goes here
[87747.431749] BUG: kernel NULL pointer dereference, address: 000000000000001f
[87747.431765] #PF: supervisor read access in kernel mode
[87747.431780] #PF: error_code(0x0000) - not-present page
[87747.431819] PGD 0 P4D 0 
[87747.431821] Oops: 0000 [#1] SMP NOPTI
[87747.431823] CPU: 1 PID: 462167 Comm: insmod Tainted: G           OE     5.13.0-27-generic #29~20.04.1-Ubuntu
[87747.431825] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 11/12/2020
[87747.431826] RIP: 0010:sysfs_create_file_ns+0x26/0x90
[87747.431829] Code: 9c 0f 1f 00 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 53 48 83 ec 10 65 48 8b 04 25 28 00 00 00 48 89 45 e0 31 c0 48 85 ff 74 5b <48> 83 7f 30 00 48 89 fb 74 51 49 89 f4 48 85 f6 74 49 49 89 d5 48
[87747.431831] RSP: 0018:ffffa39a0406fbe0 EFLAGS: 00010282
[87747.431832] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000027
[87747.431833] RDX: 0000000000000000 RSI: ffffffffc09ae020 RDI: ffffffffffffffef
[87747.431834] RBP: ffffa39a0406fc08 R08: ffff8e77b9e589c0 R09: ffffa39a0406fa18
[87747.431835] R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffc09ae020
[87747.431836] R13: ffffffffffffffef R14: ffffffffc09ae040 R15: 0000000000000000
[87747.431837] FS:  00007fd6b8bf2540(0000) GS:ffff8e77b9e40000(0000) knlGS:0000000000000000
[87747.431838] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[87747.432290] CR2: 000000000000001f CR3: 000000001f4c8005 CR4: 00000000003706e0
[87747.432721] Call Trace:
[87747.432724]  device_create_file+0x42/0x80
[87747.432726]  ? 0xffffffffc09b1000
[87747.432728]  my_init+0x141/0x1000 [test]
[87747.432730]  do_one_initcall+0x46/0x1d0
[87747.432732]  ? __cond_resched+0x19/0x30
[87747.432734]  ? kmem_cache_alloc_trace+0x37c/0x440
[87747.432737]  do_init_module+0x62/0x260
[87747.432739]  load_module+0x125d/0x1440
[87747.432741]  __do_sys_finit_module+0xc2/0x120
[87747.432742]  ? __do_sys_finit_module+0xc2/0x120
[87747.432743]  __x64_sys_finit_module+0x1a/0x20
[87747.432745]  do_syscall_64+0x61/0xb0
[87747.432747]  ? __x64_sys_newfstat+0x16/0x20
[87747.432749]  ? do_syscall_64+0x6e/0xb0
[87747.432750]  ? __x64_sys_lseek+0x1a/0x20
[87747.432752]  ? do_syscall_64+0x6e/0xb0
[87747.432754]  ? exc_page_fault+0x8f/0x170
[87747.432755]  ? asm_exc_page_fault+0x8/0x30
[87747.432756]  entry_SYSCALL_64_after_hwframe+0x44/0xae
[87747.432758] RIP: 0033:0x7fd6b8d3789d
[87747.432759] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c3 f5 0c 00 f7 d8 64 89 01 48
[87747.432760] RSP: 002b:00007ffe09073bd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[87747.432762] RAX: ffffffffffffffda RBX: 0000557d4fa68760 RCX: 00007fd6b8d3789d
[87747.433030] RDX: 0000000000000000 RSI: 0000557d4db48358 RDI: 0000000000000003
[87747.433032] RBP: 0000000000000000 R08: 0000000000000000 R09: 00007fd6b8e0b260
[87747.433033] R10: 0000000000000003 R11: 0000000000000246 R12: 0000557d4db48358
[87747.433033] R13: 0000000000000000 R14: 0000557d4fa683d0 R15: 0000000000000000
[87747.433036] Modules linked in: test(OE+) vsock_loopback vmw_vsock_virtio_transport_common vmw_vsock_vmci_transport vsock nls_iso8859_1 intel_rapl_msr intel_rapl_common crct10dif_pclmul ghash_clmulni_intel aesni_intel crypto_simd cryptd rapl vmw_balloon snd_ens1371 snd_ac97_codec gameport ac97_bus snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi joydev input_leds serio_raw snd_seq snd_seq_device snd_timer snd soundcore vmw_vmci mac_hid sch_fq_codel vmwgfx ttm drm_kms_helper cec rc_core fb_sys_fops syscopyarea sysfillrect sysimgblt msr nfsd parport_pc auth_rpcgss ppdev nfs_acl lockd lp grace parport drm sunrpc ip_tables x_tables autofs4 hid_generic ahci e1000 libahci usbhid hid mptspi mptscsih mptbase crc32_pclmul psmouse scsi_transport_spi i2c_piix4 pata_acpi [last unloaded: test]
[87747.433869] CR2: 000000000000001f
[87747.434327] ---[ end trace d7785aaa07b44309 ]---
[87747.434352] RIP: 0010:sysfs_create_file_ns+0x26/0x90
[87747.434357] Code: 9c 0f 1f 00 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 53 48 83 ec 10 65 48 8b 04 25 28 00 00 00 48 89 45 e0 31 c0 48 85 ff 74 5b <48> 83 7f 30 00 48 89 fb 74 51 49 89 f4 48 85 f6 74 49 49 89 d5 48
[87747.434359] RSP: 0018:ffffa39a0406fbe0 EFLAGS: 00010282
[87747.434361] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000027
[87747.434362] RDX: 0000000000000000 RSI: ffffffffc09ae020 RDI: ffffffffffffffef
[87747.434363] RBP: ffffa39a0406fc08 R08: ffff8e77b9e589c0 R09: ffffa39a0406fa18
[87747.434363] R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffc09ae020
[87747.434364] R13: ffffffffffffffef R14: ffffffffc09ae040 R15: 0000000000000000
[87747.434365] FS:  00007fd6b8bf2540(0000) GS:ffff8e77b9e40000(0000) knlGS:0000000000000000
[87747.434366] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[87747.434368] CR2: 000000000000001f CR3: 000000001f4c8005 CR4: 00000000003706e0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文