在虚拟机与wsl中编译内核,并启用kasan

2023-05-16

linux内核编译

    • 虚拟机编译自己的内核
    • WSL编译自己的内核
    • 测试kasan

想学习一下kasan的相关配置,但kasan是内核中的相关配置,开启得编译内核,本文使用虚拟机与wsl两种方式来编译内核启动kasan。

虚拟机编译自己的内核

在虚拟机里编译内核参考ubuntu内核编译与Kasan初探

查看当前的内核

uname -a

查看可支持的内核

sudo apt-cache search linux-source

选择可支持的内核版本安装,这里选择4.15

sudo apt-get install linux-source-4.15.0

安装完成后会在/usr/src中看到相应的内核源码,打开并解压

cd /usr/src
sudo tar -axvf linux-source-4.15.0.tar.bz2

可以看到解压后的源码内容

修改设置

sudo make menuconfig

报错缺少menuconfig

安装库

 sudo apt-get install libncurses5-dev

再次运行

sudo make menuconfig

在这里插入图片描述

在kernel hacking/memory debugging,点击H,查看依赖

在这里插入图片描述

编译内核

cd linux-source-4.15.0/
make -j 2 clean #先清除临时文件
make -j 2 bzImage #先编译内核,生成bzImage文件
sudo make -j 2 modules #再编译模块,要权限(大量时间)

编译后的文件位于kernel中

编译完内核后,没有将其放入到相关的系统路径中,模块需要安装,内核也需要移动。运行modules_install,将模块安装到lib/modules

sudo make modules_install

安装之后在/lib/modules下回生成一个新目录

移动内核

sudo cp  /usr/src/linux-source-4.10.0/arch/x86/boot/bzImage  /boot/vmlinuz-4.10.17
sudo cp  /usr/src/linux-source-4.10.0/.config  /boot/config-4.10.17
#给新内核文件添加 X 权限
sudo chmod  a+x  /boot/vmlinuz-4.10.17
sudo cp  /usr/src/linux-source-4.10.0/System.map  /boot/System.map-4.10.17
sudo gzip -c  /usr/src/linux-source-4.10.0/Module.symvers  > /boot/symvers-4.10.17(这个要最高权限)
##sudo passwd设置密码(第一次时)
##su
##获取最高权限

建立对应的initial Ram Disk

首先安装dracut,安装完之后建立对应disk

sudo apt install dracut
sudo dracut  -v  /boot/initramfs-4.10.17.img 4.10.17

编辑开机选项

grub-mkconfig  -o  /boot/grub/grub.cfg

在虚拟机上编译内核后重启会出现一个错误:

VBoxClient (seamless): failed to start. Stage: Setting guest IRQ filter mas Error: VERR_INTERNAL_ERROR

解决该错误参考

sudo apt-get install gcc make perl
cd /media/$USER/VBox_GAs_5.2.22
sudo ./VBoxLinuxAdditions.run
sudo reboot

以上是在虚拟机上编译的结果,但不巧的是我使用的最多是是WSL

WSL编译自己的内核

参考如何让WSL2使用自己编译的内核
编译内核使用的均为相同的内核源码,但与使用虚拟机不同,WSL中微软进行了一些配置,熟悉内核配置的人都知道内核相关配置位于kenel目录下的.config中,因此我们需要在内核官网上下载相应的.config文件:

尽量使用WSL2,查询自己的WSL:

wsl -l -v

使用一下命令可以转换版本

wsl --set-version ubuntu 2 

WSL运行效率高,编译内核迅速,可以利用windows上的资源,方便的使用windows上的软件来查看文件

去官网或者镜像站下载内核源码

与在虚拟机上编译不同,WSL需要对配置文件进行配置:

使用微软的配置文件,项目的链接在/Microsoft/config-wsl

在要执行编译的工作区目录创建配置文件,可以删除之前的配置文件

rm .config
touch .config 

这里是使用WSL来学习kasan,修改.config,在其中加入(这里并不是一个好的操作,推荐将wsl的.config复制进来后根据虚拟机中的方法使用make menuconfig来进行修改)

CONFIG_SLUB_DEBUG=y
CONFIG_KASAN=y

保存后编译,-j8代表内核的线程,

make -j8

加入后会在编译开始出现几个新的配置,代表加入成功:

出现以下报错:

 CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  DESCEND  objtool
  CHK     include/generated/utsrelease.h
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CC [M]  ubuntu/xr-usb-serial/xr_usb_serial_common.o
  CHK     kernel/config_data.h
  CC [M]  ubuntu/vbox/vboxguest/common/log/log.o
ubuntu/xr-usb-serial/xr_usb_serial_common.c: In function ‘xr_usb_serial_ctrl_irq’:
ubuntu/xr-usb-serial/xr_usb_serial_common.c:301:21: warning: unused variable ‘tty’ [-Wunused-variable]
  struct tty_struct *tty;
                     ^~~
ubuntu/xr-usb-serial/xr_usb_serial_common.c: In function ‘xr_usb_serial_process_read_urb’:
ubuntu/xr-usb-serial/xr_usb_serial_common.c:433:24: warning: unused variable ‘tty’ [-Wunused-variable]
     struct tty_struct *tty;
                        ^~~
ubuntu/xr-usb-serial/xr_usb_serial_common.c: In function ‘xr_usb_serial_softint’:
ubuntu/xr-usb-serial/xr_usb_serial_common.c:508:24: warning: unused variable ‘tty’ [-Wunused-variable]
     struct tty_struct *tty;
                        ^~~
ubuntu/xr-usb-serial/xr_usb_serial_common.c: In function ‘xr_usb_serial_tty_ioctl’:
ubuntu/xr-usb-serial/xr_usb_serial_common.c:918:17: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
                 if (get_user(val, (int __user *)(arg + 2 * sizeof(int))))
                 ^~
ubuntu/xr-usb-serial/xr_usb_serial_common.c:921:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
    if (channel == -1)
    ^~
  CC [M]  ubuntu/vbox/vboxguest/common/log/logrelellipsis.o
  CC [M]  ubuntu/vbox/vboxguest/common/log/logcom.o
  CC [M]  ubuntu/vbox/vboxguest/common/log/logformat.o
  CC [M]  ubuntu/vbox/vboxguest/common/misc/RTAssertMsg1Weak.o
  CC [M]  ubuntu/vbox/vboxguest/common/misc/RTAssertMsg2.o
  CC [M]  ubuntu/vbox/vboxguest/common/misc/RTAssertMsg2Add.o
  CC [M]  ubuntu/vbox/vboxguest/common/misc/RTAssertMsg2AddWeak.o
  CC [M]  ubuntu/vbox/vboxguest/common/misc/RTAssertMsg2AddWeakV.o
  CC [M]  ubuntu/vbox/vboxguest/common/misc/RTAssertMsg2Weak.o
In file included from ./include/linux/bitmap.h:9:0,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/x86/include/asm/cpumask.h:5,
                 from ./arch/x86/include/asm/msr.h:11,
                 from ./arch/x86/include/asm/processor.h:21,
                 from ./arch/x86/include/asm/cpufeature.h:5,
                 from ./arch/x86/include/asm/thread_info.h:53,
                 from ./include/linux/thread_info.h:39,
                 from ./arch/x86/include/asm/preempt.h:7,
                 from ./include/linux/preempt.h:81,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/seqlock.h:36,
                 from ./include/linux/time.h:6,
                 from ./include/linux/stat.h:19,
                 from ./include/linux/module.h:10,
                 from ./ubuntu/vbox/vboxguest/include/internal/iprt.h:56,
                 from ubuntu/vbox/vboxguest/common/log/log.c:32:
In function ‘memcpy’,
    inlined from ‘rtLogStPNCpyPad’ at ubuntu/vbox/vboxguest/common/log/log.c:3587:9,
    inlined from ‘rtLogOutputPrefixed’ at ubuntu/vbox/vboxguest/common/log/log.c:3819:25:
./include/linux/string.h:374:4: error: call to ‘__read_overflow2’ declared with attribute error: detected read beyond size of object passed as 2nd parameter
    __read_overflow2();
    ^~~~~~~~~~~~~~~~~~
readelf: Warning: [31]: Info field (30) should index a relocatable section.
scripts/Makefile.build:333: recipe for target 'ubuntu/vbox/vboxguest/common/log/log.o' failed
make[3]: *** [ubuntu/vbox/vboxguest/common/log/log.o] Error 1
make[3]: *** Waiting for unfinished jobs....
scripts/Makefile.build:607: recipe for target 'ubuntu/vbox/vboxguest' failed
make[2]: *** [ubuntu/vbox/vboxguest] Error 2
scripts/Makefile.build:607: recipe for target 'ubuntu/vbox' failed
make[1]: *** [ubuntu/vbox] Error 2
make[1]: *** Waiting for unfinished jobs....
readelf: Warning: [31]: Info field (30) should index a relocatable section.
Makefile:1087: recipe for target 'ubuntu' failed
make: *** [ubuntu] Error 2

出现该问题是因为GCC版本不对,要更新到和微软提供的配置文件一样的版本,GCC版本更新参考

Linux下更新GCC

注:WSL使用过程中遇到的一些问题,可以直接在微软的github上提交相应的issue,基本上都有很快的回答和解决,这里要注意,我们虽然使用的是WSL2,但是在微软的issue上在WSL上提交即可。

将编译产生的文件

/usr/src/linux-source-4.15.0/arch/x86/boot/bzImage

复制替换C:\WINDOWS\System32\lxss\tools 的kernel,注意将kernel备份

重启wsl

wsl --shutdown 
uname -r #检查内核版本 

编译内核成功
在这里插入图片描述

编译后的镜像文件比编译前的大一倍左右

测试kasan

在源码lib中包含了test_kasan的测试文件test_kasan.c

makefile:

obj-m += test_kasan.o

all:
            make -C /lib/modules/4.15.0/build M=$(PWD) modules
clean:
            make -C /lib/modules/4.15.0/build M=$(PWD) clean
~                                                                  

编译生成test_kasan.ko文件

安装ko文件

insmod test_kasan.ko

报错

insmod test_kasan.ko
insmod: ERROR: could not insert module test_kasan.ko: Operation not permitted

打印系统信息

dmesg

打印以下信息

 kmalloc_oob_krealloc_more+0x6c/0xd8 [test_kasan]
[14513.029878]  kmalloc_tests_init+0x2b/0xd2b [test_kasan]
[14513.029882]  do_one_initcall+0x7d/0x240
[14513.029885]  do_init_module+0x22a/0x790
[14513.029888]  load_module+0x5336/0x8230
[14513.029891]  SyS_finit_module+0x202/0x260
[14513.029894]  do_syscall_64+0x22b/0x600
[14513.029898]  entry_SYSCALL_64_after_hwframe+0x41/0xa6

[14513.029901] Freed by task 0:
[14513.029901] (stack is not available)

[14513.029903] The buggy address belongs to the object at ffff88829179ea88
                which belongs to the cache kmalloc-32 of size 32
[14513.029904] The buggy address is located 19 bytes inside of
                32-byte region [ffff88829179ea88, ffff88829179eaa8)
[14513.029905] The buggy address belongs to the page:
[14513.029906] page:ffffea000a45e780 count:1 mapcount:0 mapping:0000000000000000 index:0xffff88829179f388 compound_mapcount: 0
[14513.029912] flags: 0x4000000000008100(slab|head)
[14513.029915] raw: 4000000000008100 0000000000000000 ffff88829179f388 000000010015000f
[14513.029920] raw: ffff888187c03c50 ffff888187c03c50 ffff888187c0c640 0000000000000000
[14513.029924] page dumped because: kasan: bad access detected

[14513.029927] Memory state around the buggy address:
[14513.029928]  ffff88829179e980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[14513.029929]  ffff88829179ea00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[14513.029930] >ffff88829179ea80: fc 00 00 03 fc fc fc fc fc fc fc fc fc fc fc fc
[14513.029931]                             ^
[14513.029932]  ffff88829179eb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[14513.029933]  ffff88829179eb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[14513.029934] ==================================================================
[14513.029937] kasan test: kmalloc_oob_krealloc_less out-of-bounds after krealloc less
[14513.029946] ==================================================================
[14513.029949] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_krealloc_less+0xc1/0xd0 [test_kasan]
[14513.029950] Write of size 1 at addr ffff88829179f397 by task insmod/11566

[14513.029952] CPU: 1 PID: 11566 Comm: insmod Tainted: PF   B      O     4.15.18-wzd-kasan_debug-WSL2 #5
[14513.029956] Call Trace:
[14513.029959]  dump_stack+0xe3/0x13e
[14513.029963]  ? switchdev_obj_size.isra.1.part.2+0x7/0x7
[14513.029967]  ? kmalloc_oob_krealloc_less+0xc1/0xd0 [test_kasan]
[14513.029972]  ? printk+0x94/0xb0
[14513.029976]  ? SyS_gethostname.cold+0x11/0x11
[14513.029980]  ? SyS_gethostname.cold+0x11/0x11
[14513.030003]  ? kmalloc_oob_krealloc_less+0xc1/0xd0 [test_kasan]
[14513.030010]  print_address_description+0x6a/0x270
[14513.030017]  ? kmalloc_oob_krealloc_less+0xc1/0xd0 [test_kasan]
[14513.030026]  kasan_report+0x240/0x350
[14513.030032]  kmalloc_oob_krealloc_less+0xc1/0xd0 [test_kasan]
[14513.030037]  ? copy_user_test+0x1c9/0x1c9 [test_kasan]
[14513.030042]  kmalloc_tests_init+0x30/0xd2b [test_kasan]
[14513.030046]  do_one_initcall+0x7d/0x240
[14513.030049]  ? initcall_blacklisted+0x180/0x180
[14513.030054]  ? kasan_unpoison_shadow+0x30/0x40
[14513.030058]  ? __asan_register_globals+0x6e/0x80
[14513.030062]  do_init_module+0x22a/0x790
[14513.030066]  ? SyS_delete_module+0x640/0x640
[14513.030069]  ? load_module+0x5329/0x8230
[14513.030073]  load_module+0x5336/0x8230
[14513.030079]  ? module_frob_arch_sections+0x20/0x20
[14513.030083]  ? vfs_read+0x24e/0x2e0
[14513.030087]  ? kernel_read+0x90/0x130
[14513.030090]  ? kernel_read_file+0x3fb/0x670
[14513.030095]  ? kernel_read_file_from_fd+0x74/0xb0
[14513.030099]  SyS_finit_module+0x202/0x260
[14513.030103]  ? SyS_init_module+0x320/0x320
[14513.030107]  ? SyS_newfstat+0x75/0xb0
[14513.030111]  ? filp_close+0x1d0/0x1d0
[14513.030115]  ? SyS_init_module+0x320/0x320
[14513.030118]  do_syscall_64+0x22b/0x600
[14513.030122]  ? __switch_to_asm+0x31/0x60
[14513.030125]  ? __switch_to_asm+0x25/0x60
[14513.030128]  ? __switch_to_asm+0x31/0x60
[14513.030132]  ? syscall_return_slowpath+0x2d0/0x2d0
[14513.030136]  ? do_page_fault+0x87/0x310
[14513.030140]  ? __do_page_fault+0x9f0/0x9f0
[14513.030143]  ? prepare_exit_to_usermode+0x200/0x200
[14513.030147]  ? syscall_trace_enter+0xc10/0xc10
[14513.030151]  ? __put_user_4+0x1c/0x30
[14513.030155]  entry_SYSCALL_64_after_hwframe+0x41/0xa6
[14513.030159] RIP: 0033:0x7f319220c539
[14513.030161] RSP: 002b:00007fffddb8d7e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[14513.030166] RAX: ffffffffffffffda RBX: 00005634a5a9f480 RCX: 00007f319220c539
[14513.030169] RDX: 0000000000000000 RSI: 00005634a398acee RDI: 0000000000000003
[14513.030173] RBP: 00005634a398acee R08: 0000000000000000 R09: 00007f31924df000
[14513.030177] R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000000
[14513.030180] R13: 00005634a5a9f450 R14: 0000000000000000 R15: 0000000000000000
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在虚拟机与wsl中编译内核,并启用kasan 的相关文章

  • 轻松搞定面试中的二叉树题目

    版权所有 xff0c 转载请注明出处 xff0c 谢谢 xff01 http blog csdn net walkinginthewind article details 7518888 树是一种比较重要的数据结构 xff0c 尤其是二叉树
  • 使用Anaconda Navigator无法成功创建虚拟环境问题的解决方案

    1 问题描述 使用anaconda Navigator创建虚拟环境时 xff0c 配置初始名称以及python版本 xff0c Fetching各种包成功后 xff0c 开始loading各种包的过程中闪过cmd黑色窗口 xff0c 然后左
  • QT 后台处理时间过长 主界面卡死解决办法

    之前用WPF开发 xff0c 处理逻辑就是1 xff0c 处理前显示等待窗口 xff0c 2 同步处理改未异步 xff0c 3 处理完毕后关闭等待窗口 Qt应该也是类似的处理逻辑 xff1a 一 创建等待处理窗口 xff08 采用了QMoi
  • 一圈n个人,1-3循环报数,报道3的退出,最后剩下的是几号

    import java util ArrayList import java util List import java util Scanner public class CirCle public static void main St
  • GCD【洛谷P2568】(小左的GCD)

    题目描述 给定整数N xff0c 求1 lt 61 x y lt 61 N且Gcd x y 为素数的数对 x y 有多少对 输入格式 一个整数N 输出格式 答案 输入输出样例 输入 1 复制 4 输出 1 复制 4 说明 提示 对于样例 2
  • C++中的weak_ptr深入解析

    引言 在C 43 43 的智能指针家族中 xff0c weak ptr是一种非常实用且独特的成员 它主要用于解决循环引用问题 xff0c 从而避免内存泄漏 在本文中 xff0c 我们将详细讨论weak ptr的基本概念 功能和应用场景 xf
  • 【Redis】解决WARNING overcommit_memory is set to 0 Background save may fail under low memory condition.

    问题说明 不管是linux直装 xff0c 还是在docker环境中 xff0c 启动redis时 xff0c 报如下错误 WARNING overcommit memory is set to 0 Background save may
  • 运动跟踪算法CMT(续)之层次凝聚聚类算法(HAC)

    熟悉CMT的都知道 xff0c 作者在聚类部分使用了层次凝聚聚类算法 xff08 Hierarchical Agglomerative Clustering xff09 并且使用的是单链 xff08 Single link xff09 xf
  • 使用mysql8.x版本设置远程连接

    主要步骤 xff0c 注意 xff1a 自mysql8 x版本 xff0c 密码的加密方式改为caching sha2 password 登录mysql账号修改root用户登录地址修改root用户密码加密方式 usr local mysql
  • jenkins基础配置之四:读取本地文件

    需要安装的插件 Extended Choice Parameter Plug span class token operator span In span class token operator span External Monitor
  • 初识Btrfs文件系统

    Btrfs 也有一个重要的缺点 xff0c 当 BTree 中某个节点出现错误时 xff0c 文件系统将失去该节点之下的所有的文件信息 而 ext2 3 却避免了这种被称为 错误扩散 的问题 Btrfs相关介绍 xff1a Btrfs 是一
  • 服务器使用笔记本网络连接外网

    由于服务器经常部署在机房 xff0c 并没有外网 xff0c 连不上外网 需要使用自己笔记本的网络供服务器使用 笔记本连接手机热点 xff0c 再分享给服务器 一 首先 xff0c 需要把服务器和笔记本连接到同一网络内 xff0c 可以选择
  • grafana接入openldap认证

    首先两个文件开启ldap的支持 文件1 xff1a etc grafana grafana ini auth ldap enabled 61 true config file 61 etc grafana ldap toml allow s
  • Wireshark的常见提示

    概述 本文主要介绍Wireshark中出现的一些常见提示 详细信息 Wireshark简介 Gerald Combs是堪萨斯城密苏里大学计算机科学专业的毕业生 1998年发布了第一版Ethereal工具 xff0c Ethereal工具使用
  • shell报错bad substitution 解决办法

    bin bash a 61 34 hello 34 b 61 34 hi is a 34 echo b echo a echo a echo a 1 2 执行脚本方式不同出现的结果不同 xff1a 方式1 xff1a sh shell sh
  • centos8软件安装dnf命令

    DNF是新一代的rpm软件包管理器 它首先出现在 Fedora 18 这个发行版中 而目前 xff0c 它取代了yum xff0c 正式成为从 Fedora 22 起 Fedora 版本的包管理器 DNF包管理器克服了YUM包管理器的一些瓶
  • 多目标规则在 Makefile 中的应用与示例

    在 Makefile 中 xff0c 如果一个规则有多个目标 xff0c 而且它们之间用空格分隔 xff0c 我们称之为 34 多目标规则 34 这意味着这个规则适用于列出的所有目标 在目标下面的命令是 C 64 xff0c 它通常与 ma
  • 计算机中内存、cache和寄存器之间的关系及区别

    1 寄存器是中央处理器内的组成部份 寄存器是有限存贮容量的高速存贮部件 xff0c 它们可用来暂存指令 数据和位址 在中央处理器的控制部件中 xff0c 包含的寄存器有指令寄存器 IR 和程序计数器 PC 在中央处理器的算术及逻辑部件中 x
  • dell 台式电脑设置每天定时开机和关机

    每天定时开机设置 xff1a 戴尔电脑通过CMOS设置实现自动开机的设置过程如下 xff1a 1 首先进入 CMOS SETUP 程序 大多数主板是在计算机启动时按DEL或F2键进入 xff1b 2 然后将光条移到 Power Manage
  • windows批处理自动获取电脑配置信息

    39 2 gt nul 3 gt nul amp cls amp 64 echo off 39 amp rem 获取本机系统及硬件配置信息 39 amp set 61 Any question amp set 64 61 WX amp se

随机推荐

  • Centos7搭建cisco ocserv

    一 安装的部分直接yum安装即可 yum y install ocserv 二 配置文件根据实际情况调整 auth方式有两种 1 系统账号认证 配置的话就是 xff1a auth 61 34 pam 34 2 本地文件认证 配置的话就是 x
  • 私有harbor部署(docker方式)

    环境准备 docker compose v Docker Compose version v2 14 2 wget https github com docker compose releases download v2 14 2 dock
  • ORACLE扩展表空间

    一 查询表空间使用情况 SELECT UPPER F TABLESPACE NAME 34 表空间名 34 D TOT GROOTTE MB 34 表空间大小 M 34 D TOT GROOTTE MB F TOTAL BYTES 34 已
  • Oracle 常用性能监控SQL语句

    1 查看表锁 SELECT FROM SYS V SQLAREA WHERE DISK READS gt 100 2 监控事例的等待 SELECT EVENT SUM DECODE WAIT TIME 0 0 1 34 Prev 34 SU
  • Nginx出现“ 413 (499 502 404) Request Entity Too Large”错误解决方法

    1 Nginx413错误的排查 修改上传文件大小限制 在使用上传POST一段数据时 xff0c 被提示413 Request Entity Too Large xff0c 应该是nginx限制了上传数据的大小 解决方法就是 打开nginx主
  • 查看弹出广告来自哪个软件

    打开VS的Spy 43 43 将指针移到广告处 xff0c 然后点OK xff0c 在Process标签页可以看到进程id和线程id将获得的16进制进程id xff08 例如 xff1a 000025F8 xff09 通过计算器转成10进制
  • C++多态虚函数实现原理,对象和虚函数表的内存布局

    基本概念 我们知道C 43 43 动态多态是用虚函数实现的 xff0c 而虚函数的实现方式虽说C 43 43 标准没有要求 xff0c 但是基本都是用虚函数表实现的 xff08 编译器决定 xff09 所以我们有必要了解一下虚函数表的实现原
  • C++ STL中递归锁与普通锁的区别

    在多线程编程中 xff0c 保护共享资源的访问很重要 xff0c 为了实现这个目标 xff0c C 43 43 标准库 xff08 STL xff09 中提供了多种锁 xff0c 如std mutex和std recursive mutex
  • VS+Qt开发环境

    VS Qt下载 VS下载 xff1a https visualstudio microsoft com zh hans vs Qt下载安装 xff1a https www bilibili com video BV1gx4y1M7cM VS
  • windows下使用ShiftMediaProject编译调试FFmpeg

    为什么要编译FFmpeg xff1f 定制模块调试源码 windows下编译 推荐项目ShiftMediaProject FFmpeg 平时总是看到一些人说windows下编译FFmpeg很麻烦 xff0c 这时候我就都是微微一笑 xff0
  • RTSP分析

    RTSP使用TCP来发送控制命令 xff08 OPTIONS DESCRIBE SETUP PLAY xff09 xff0c 因为TCP提供可靠有序的数据传输 xff0c 而且TCP还提供错误检测和纠正 RTSP的报文格式可以参考HTTP的
  • RTP分析

    参考 RTP xff08 A Transport Protocol for Real Time Applications 实时传输协议 xff0c rfc3550 xff09 RTP Payload Format for H 264 Vid
  • VS链接器工具错误 LNK2019:无法解析的外部符号

    常见的问题 以下是一些导致 LNK2019 的常见问题 xff1a 未链接的对象文件或包含符号定义的库 在 Visual Studio 中 xff0c 验证包含定义源代码文件是生成 xff0c 分别链接为项目的一部分 在命令行中 xff0c
  • FFmpeg合并视频流与音频流

    mux h ifndef MUX H define MUX H ifdef cplusplus extern 34 C 34 endif include 34 common h 34 include 34 encode h 34 typed
  • 解决电脑同时使用有线网上内网,无线网上外网的冲突

    由于内网有网络限制 xff08 限制娱乐等 xff09 xff0c 所以肯定要用外网 xff08 无线网卡 xff09 但是有的网站只能用内网访问 xff0c 比如gitlab xff0c oa等 我电脑刚开始连接了wifi后上不了gitl
  • Python斗鱼直播间自动发弹幕脚本

    工具 xff1a Python xff0c Chrome浏览器 因为不会用短信验证码登录 xff0c 所以使用QQ帐号登录 xff0c 必须要斗鱼帐号绑定QQ号 难点主要是帧的切换 查找元素可以通过chrome浏览器鼠标指向该元素 xff0
  • Qt+FFmpeg录屏录音

    欢迎加QQ群309798848交流C C 43 43 linux Qt 音视频 OpenCV 源码 xff1a Qt 43 FFmpeg录屏录音 NanaRecorder 之前的录屏项目ScreenCapture存在音视频同步问题 xff0
  • Qt源码分析(一)

    欢迎加QQ群309798848交流C C 43 43 linux Qt 音视频 OpenCV 源码面前 xff0c 了无秘密 阅读源码能帮助我们理解实现原理 xff0c 然后更灵活的运用 接下来我用VS2015调试Qt5 9源码 首先提一下
  • python实现批量提取图片中文字的小工具

    要实现批量提取图片中的文字 xff0c 我们可以使用Python的pytesseract和Pillow库 pytesseract是一个OCR xff08 Optical Character Recognition xff0c 光学字符识别
  • 在虚拟机与wsl中编译内核,并启用kasan

    linux内核编译 虚拟机编译自己的内核WSL编译自己的内核测试kasan 想学习一下kasan的相关配置 xff0c 但kasan是内核中的相关配置 xff0c 开启得编译内核 xff0c 本文使用虚拟机与wsl两种方式来编译内核启动ka