CSAPP 7.13 库打桩机制:运行时打桩例子导致段错误

已知文件名取文件所在目录                                                                           何志丹已知文件名,如何取文件所在目录?最简单的方法是从后向前找"//".但有时,文件名中没有"//",这时要先转化一下.具体代码如下:CString GetPathName(const CString strPathFileName){ //取 阅读详情
库打桩

库打桩可以截获对共享库函数的调用,第三个例子 运行时打桩 代码如下:

#ifdef RUNTIME
#define _GNU_SOURCE     // RTLD_NEXT 需要 _GNU_SOURCE 才能使用
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>

void* malloc(size_t size)
{
    void* (*mallocptr)(size_t size);
    char* error;
    // RTLD_NEXT:查找调用者所在共享库之后的下一个库
    // 这样调用libc.so中的malloc,而不是直接 malloc( ) 导致调用自身
    mallocptr = dlsym(RTLD_NEXT, "malloc");
    if ((error = dlerror()) != NULL) {
        fputs(error, stderr);
        exit(1);
    }

    char* ptr = mallocptr(size);
    printf("malloc(%d) = %p\n", (int)size, ptr);
    return ptr;
}

void free(void* ptr)
{
    if (!ptr)
        return;

    void (*freeptr)(void*) = NULL;
    char* error;

    freeptr = dlsym(RTLD_NEXT, "free");
    if ((error = dlerror()) != NULL) {
        fputs(error, stderr);
        exit(1);
    }
    freeptr(ptr);
    printf("free(%p)\n", ptr);
}

#endif

使用以下命令制作动态库:

gcc -DRUNTIME -shared -fpic -o mymalloc.so mymalloc.c -ldl

示例中运行以下会导致 SIGSEGV 信号的段错误

LD_PRELOAD=./mymalloc.so ./intr
使用core文件调试

使用 gdb 调试需要先将动态链接库和 intr 重新添加 -g 选项编译,调试也是 segment fault,需要核心转储文件才能查看调用堆栈详情

  1. 首先检查是否允许生成 core 文件,若为 0 则不允许,设置为 unlimited 则不限制大小,ulimit 的设置只会对当前终端有效,新开 shell 还会是默认值
ulimit -a | grep core
ulimit -c unlimited
  1. 检查 core 生成目录,下面生成 core 文件模式: %e 表示程序名, %p 表示进程号, %t 表示时间戳
# 若为 core 表示会在当前目录下生成名为 core 文件
cat /proc/sys/kernel/core_pattern

# 若自定义 core 生成目录,需要有写权限
sudo sysctl -w kernel.core_pattern=/tmp/corefiles/core_%e_%p_%t
mkdir -p /tmp/corefiles
chmod 777 /tmp/corefiles
  1. gdb 调试,将 core 文件作为第二个参数传入,使用 backtrace 命令查看函数调用堆栈,堆栈帧编号表示:编号大者调用编号小者
gdb ./intr core

# in gdb
set environment LD_PRELOAD=./mymalloc.so
bt

堆栈反复出现以下,malloc 即为打桩后 mymalloc.c 中的包装函数,其中调用了 printf 打印输出,如 #36 ,但是 printf 中 __GI__IO_doallocbuf 可能需要使用到 malloc 分配缓冲,可以看到 #28 再次调用 malloc 分配 size=1024 大小,于是循环调用导致栈溢出

#27 0x00007606d146079f in __printf (format=<optimized out>) at ./stdio-common/printf.c:33
#28 0x00007606d181022a in malloc (size=1024) at mymalloc.c:87
#29 0x00007606d147eba4 in __GI__IO_file_doallocate (fp=0x7606d161b780 <_IO_2_1_stdout_>) at ./libio/filedoalloc.c:101
#30 0x00007606d148dce0 in __GI__IO_doallocbuf (fp=fp@entry=0x7606d161b780 <_IO_2_1_stdout_>) at ./libio/libioP.h:947
#31 0x00007606d148cf60 in _IO_new_file_overflow (f=0x7606d161b780 <_IO_2_1_stdout_>, ch=-1) at ./libio/fileops.c:744
#32 0x00007606d148b6d5 in _IO_new_file_xsputn (n=7, data=<optimized out>, f=<optimized out>) at ./libio/libioP.h:947
#33 _IO_new_file_xsputn (f=0x7606d161b780 <_IO_2_1_stdout_>, data=<optimized out>, n=7) at ./libio/fileops.c:1196
#34 0x00007606d147514d in outstring_func (done=0, length=7, string=0x7606d1811007 "malloc(%d) = %p\n", 
    s=0x7606d161b780 <_IO_2_1_stdout_>) at ../libio/libioP.h:947
--Type <RET> for more, q to quit, c to continue without paging--
#35 __vfprintf_internal (s=0x7606d161b780 <_IO_2_1_stdout_>, format=0x7606d1811007 "malloc(%d) = %p\n", ap=ap@entry=0x7ffdf957bb30, 
    mode_flags=mode_flags@entry=0) at ./stdio-common/vfprintf-internal.c:1263
#36 0x00007606d146079f in __printf (format=<optimized out>) at ./stdio-common/printf.c:33
#37 0x00007606d181022a in malloc (size=1024) at mymalloc.c:87
解决方式

在 malloc 包装的实现中不应该调用任何依赖于 malloc 的函数,如 printf,可以使用 write 系统调用进行替换,可以正常打桩:

#ifdef RUNTIME
#define _GNU_SOURCE     // RTLD_NEXT 需要 _GNU_SOURCE 才能使用
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <dlfcn.h>
#include <string.h>

void* malloc(size_t size)
{
    void* (*mallocptr)(size_t size);
    char* error;
    // RTLD_NEXT:查找调用者所在共享库之后的下一个库
    // 这样调用libc.so中的malloc,而不是直接 malloc( ) 导致调用自身
    mallocptr = dlsym(RTLD_NEXT, "malloc");
    if ((error = dlerror()) != NULL) {
        // fputs(error, stderr);
        write(STDERR_FILENO, error, strlen(error));
        exit(1);
    }

    char* ptr = mallocptr(size);
    // printf("malloc(%d) = %p\n", (int)size, ptr);
    char buffer[64];
    int len = snprintf(buffer, sizeof(buffer), "malloc(%d) = %p\n", (int)size, ptr);
    write(STDOUT_FILENO, buffer, len);
    return ptr;
}

void free(void* ptr)
{
    if (!ptr)
        return;

    void (*freeptr)(void*) = NULL;
    char* error;

    freeptr = dlsym(RTLD_NEXT, "free");
    if ((error = dlerror()) != NULL) {
        // fputs(error, stderr)     // fputs好像没事 不会调用malloc
        write(STDERR_FILENO, error, strlen(error));
        exit(1);
    }
    freeptr(ptr);
    // printf("free(%p)\n", ptr);
    char buffer[64];
    int len = snprintf(buffer, sizeof(buffer), "free(%p)\n", ptr);
    write(STDOUT_FILENO, buffer, len);
}

#endif
【TCN回归预测】TCN时间卷积神经网络数据回归预测(多输入单输出)【含Matlab源码 2317期】 TCN时间卷积神经网络数据回归预测 完整的代码,方可运行;可提供运行操作视频!适合小白! 阅读详情

相关推荐

l0phtcrack 7(爆破管理员密码)使用教程

l0phtcrack7简称lc7,是爆破计算机管理员密码的软件,早期是网络安全管理员用来检测系统用户是否使用了不安全的密码,后被黑客用于用户口令破解 功能:该工具支持远程破解,理论上能破解所有密码,但对复杂度比较高的密码,破解时间很长 使用前提:1.登录了需要破解的计算机 2.知道需要破解的计算机的一个管理员的账户,密码 ** 也许你会疑惑,我都知道了一个管理员账户密码了,还要另外的管理员密码...

Xiongcanne的博客 2万+

ARM64-GNU汇编器

o伪指令分配大小例子伪指令分配大小例子.byte1 字节.byte 0x412 字节.word / .long 4 字节8 字节.ascii字符串(不加 \0)字符串(自动加 \0).byte:把 8位数当成数据插入汇编代码中。.hword和 .short:把16 位数当成数据插入汇编代码中。.long和 .int:这两个伪指令的作用相同,都把 32位数当成数据插入汇编代码中。.word:把 32位数当成数据插入汇编代码中。

weixin_43903002的博客 217

软件测试--用例篇(测试用例的好处、测试用例的七种设计方法、测试用例的粒度、测试用例的评价)

作为软件测试工程师,最主要的工作就是:编写测试用例,那么为什么要编写测试用例?它有什么好处?如何编写测试用例?测试用例写简单好还是复杂好?如何评价测试用例的质量? 天呐撸!能说不会吗?! 作为倾向软件测试工程师的老铁们,还是一起来学习吧! 一、编写测试用例的好处 测试用例是测试者的依据 测试用例使得工作可重复,是自动化测试的基础 补充:自动化测试的前提条件是:功能比较稳定,页面...

cherrydreamsover的博客 3734

理解 Linux 动态库加载:LD_LIBRARY_PATH

flyfish

二分掌柜的 383

群晖NAS变身私有Git服务器:DS218+部署与TortoiseGit客户端实战指南

本文详细介绍了如何将群晖NAS(如DS218+)变身为私有Git服务器,并配置TortoiseGit客户端实现高效代码管理。通过硬件检查、系统更新、Git Server套件安装及权限配置等步骤,帮助开发者在局域网内搭建安全、高速的代码托管环境,特别适合小团队协作。

weixin_29252171的博客 224

Hermes Agent vs OpenClaw:2026 年开源 AI Agent 框架深度对比

两款 2026 年最受关注的开源 AI Agent 框架,一个主打「自进化」,一个聚焦「网关路由」——它们究竟有何不同?本文将从架构原理、核心机制、使用方式到适用场景,为你全面拆解。无论你是 AI 研究者、开发者,还是想用 AI 提升工作效率的个人用户,这篇文章都将帮助你做出最适合的选择

程序猿_三产 3756

Linux-iostat命令详解

Linux命令学习记录

m0xin的博客 133

内存预取黑科技:__builtin_prefetch在数据库和游戏开发中的高阶用法

本文深入探讨了GCC内置函数`__builtin_prefetch`在数据库和游戏开发中的高阶应用。通过LevelDB的SSTable文件读取优化和UE5引擎场景数据流式加载的实战案例,详细解析了预取参数调优的艺术,并借助perf工具量化分析了不同策略的性能提升效果。文章还介绍了与`__builtin_expect`等内置函数的协同优化技巧,帮助开发者最大化缓存命中率。

weixin_29019241的博客 417

USB 技术系列 11 · USB Linux 驱动框架

本文系统解析Linux USB驱动框架,涵盖USB Core、HCD(xhci-hcd/dwc3)、类驱动(CDC/HID/Mass Storage)分层架构,详解usb_device_id匹配、probe/disconnect生命周期及Device Tree配置。结合RISC-V N300实战,揭示Host/Device双模式驱动开发核心逻辑,助力嵌入式BSP开发者掌握USB子系统全栈能力。

peter_pan_study的博客 263

量化实战:如何用Barra多因子模型给你的投资组合做一次‘风险体检’?

本文详细介绍了如何利用Barra多因子模型对投资组合进行全面的风险体检,帮助投资者识别行业和风格因子的风险暴露。通过实战案例和Python代码示例,展示了数据采集、风险归因和组合优化的完整流程,提升投资组合的风险调整收益。

weixin_27215337的博客 323

基于MATLAB的逐次变分模态分解(SVMD)算法详解

本文详细介绍了基于MATLAB的逐次变分模态分解(SVMD)算法。SVMD是一种改进的变分模态分解方法,通过逐次分解机制克服传统VMD算法需要预设模态数量的缺陷。文章从信号分解方法的发展历程入手,阐述了SVMD的核心优势与创新点,包括参数敏感性降低、自适应分解能力和更好的频率分离性能。详细解析了SVMD的数学模型和优化求解过程,重点讨论了变分问题构建、ADMM优化方法和停止准则设计。通过MATLAB代码实现展示了SVMD的具体应用,包括参数初始化、信号预处理、模态提取和残余信号更新等关键步骤。

qq_42212808的博客 131

Linux 服务器性能排查手册(2026):CPU、内存、磁盘IO、网络四大瓶颈定位

iptables 四表五链模型、firewalld zone 信任级别、云安全组与主机防火墙的关系与优先级,避坑改了防火墙把自己挡在服务器外面的翻车事故。

2502_91473995的博客 335

【ChatGPT】实用 Prompt 指令大全 —— 一文教你如何更好地挖掘 GPT 的价值

ChatGPT 是由 OpenAI 开发的一种先进的大型语言生成模型,能够理解和生成准确、自然且连贯的文本。文本生成数据分析内容审核语义理解自然语言推理以及其他众多任务ChatGPT是一种基于GPT-3.5架构的大型语言模型,由OpenAI公司开发。该模型在自然语言处理领域有着广泛的应用,可以用于文本生成、文本分类、情感分析、问答系统等任务。本文将从模型的架构、训练方式、优缺点等方面对ChatGPT进行详细介绍。一、模型架构。

AI天才研究院 2万+

Linux rm 误删文件恢复实操教程

Linux使用rm删除文件时,并不会直接抹除磁盘上的数据,只是移除文件索引,让系统不再识别这块空间。只要没有写入新数据,原有扇区内容就会保留。新文件写入才有可能覆盖这些区域,一旦覆盖就很难找回。恢复的本质就是扫描磁盘,找到这些还存在、但索引丢失的数据条目,再把它们导出保存到其他分区。越早停止写入,恢复成功的概率越高。

海天数据恢复-winhex数据恢复教程 236

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

Windows/Linux下强实时运动控制内核(二):基于Qt的Delta机械手的开发应用

强实时运动控制内核MotionRT750下Qt开发Delta机械手的完整开发流程。

weixin_57350300的博客 243

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

嵌入式 Linux OOM Killer 触发逻辑与防误杀实战指南

本文深入解析嵌入式 Linux 下 OOM Killer 的触发机制,结合工业网关真实工程场景,提供从日志排查、内核参数调优到关键进程保护的完整落地方案,解决核心进程被误杀导致的业务中断问题。

嵌入式扫地僧 395

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

Linux epoll 一篇讲透:从 select/poll 到红黑树、LT/ET,再到完整 TCP 服务器

一万个客户端已经连上服务器,眼下只有十个客户端发来了数据。服务器怎样把时间花在这十个连接上?理解这个问题,就抓住了 epoll 的主线。接下来,我们沿着“为什么需要它 → 接口怎么用 → 内核如何实现 → LT/ET 怎么写 → 完整服务器怎么运行”的顺序,把知识连起来。**阅读基础:**了解socketbindlistenaccept的基本用途即可。本文示例面向 Linux,服务器使用 C++17,实验脚本使用 Python 3。

2601_94861874的博客 205

Linux 网络基础详解:IP、子网、路由与 ip、ss 命令实战

建库建表、增删改查、连接查询(内连左连右连)、聚合函数、权限控制 GRANT/REVOKE,每条命令配可运行示例,零基础也能跟着敲会 SQL 基础。

2502_91473995的博客 617

Linux、Shell、MySQL 测试卷逐题细讲(下篇:MySQL)

本文为Linux、Shell、MySQL测试卷下半段MySQL部分逐题讲解,包含填空、选择与SQL分析三类题型。填空题覆盖COUNT、HAVING、DISTINCT、事务、约束、索引等核心语法;选择题辨析存储过程、索引类型、ACID、存储引擎、用户管理等考点。SQL大题围绕员工、部门、职位、地点四张关联表,考察多表连接、分组聚合、自连接、相关子查询、NULL处理等高频写法,标注LEFT JOIN统计计数、NULL判断、子查询别名等易错坑点,同时梳理试卷OCR识别带来的干扰问题,重点提示SQL实操中的常见失误

dongziwen1的博客 188

深入浅出聊聊 Linux 的 PageCache 与系统极致性能

本文深入浅出解析了 Linux PageCache 的核心机制,揭示其如何通过“延迟写、预读读”提升系统性能。以监控告警为切入点,阐明 free -h 中 buff/cache 并非真正占用,真正可用内存由 available 决定。结合 Kafka、Elasticsearch、MySQL 等实战场景,说明中间件如何依赖 PageCache 实现极致性能。强调不可手动清理缓存,并建议合理调优脏页参数,避免卡顿。最终指出:内存满≠危机,而是系统高效运行的体现。

小小默:进无止境 486

Linux 下 OpenCode 接入自定义大模型 API 教程:以 DeepSeek-V4.1-Flash-1017 为例

本文介绍在Linux下通过Python脚本配置OpenCode接入自定义大模型API(以DeepSeek-V4.1-Flash-1017为例),实现永久化、非侵入式配置。通过修改~/.config/opencode/opencode.json文件,添加OpenAI兼容服务商BLSC,注册模型并设置APIKey。支持命令行测试、默认模型设定及安全权限控制,操作简单且不影响原有配置。适用于各类支持OpenAI接口的自定义模型服务,提升开发灵活性与安全性。

qq_15060477的博客 137

【Linux 命令实战(06):Linux 文件权限管理,掌握 chmod、chown、chgrp】

chmod:修改文件和目录权限。chown:修改文件所有者,也可以修改所属用户组。chgrp:修改文件所属用户组。r:读取。w:写入。x:执行,对于目录则表示进入和访问能力。ugo:分别代表所有者、所属组和其他用户。我认为,权限管理最重要的不是记住755644这些数字,而是先弄清楚谁需要访问文件、需要执行什么操作,再给出恰当的权限。尤其是在测试服务器和生产服务器上,不要为了图方便直接使用chmod 777。权限开放得越大,并不代表问题解决得越好。

一些微不足道的见解、希望能帮助各位 340

【Linux 命令实战(02):文件与目录操作,掌握 pwd、ls、cd 三个核心命令】

命令作用cd /进入根目录cd ~进入当前用户家目录cd返回当前用户家目录cd …返回上一级目录cd …/…返回上两级目录cd -返回上一次所在目录进入指定目录命令核心用途常用参数pwd查看当前目录-L、-Pls查看文件和目录cd切换目录…、~、-Linux 文件系统的基本结构。绝对路径与相对路径的区别。Tab 自动补全。Shell 通配符。使用&&组合命令。这篇文章主要解决的是如何在 Linux 文件系统中快速定位目录。

一些微不足道的见解、希望能帮助各位 212

Linux篇(五)

本文系统梳理了Linux常用终端快捷键、软件包管理(yum/apt)、服务管理(systemctl)、软链接(ln)、时间与IP配置、域名解析、固定IP设置及网络命令(ping/wget/curl),涵盖日常运维核心操作,助力高效管理Linux环境。

wykyzdq的博客 205

Linux的渲染与显示系统链路

Linux渲染与显示链路核心为DRM/KMS + EGL直连模式,绕过传统X11/Wayland中间层,实现低延迟、高效率的直接帧提交。相比X11的粗粒度权限控制与Wayland的合成开销,该方案链路短、资源消耗低,但仅支持单进程独占显示,缺乏窗口管理与系统级兜底。EGL作为跨平台桥梁,连接OpenGL ES与原生显示系统,通过Display、Surface、Context三要素构建渲染环境。内核层DRM管理GPU资源,KMS配置显示模式,用户态GDM负责登录会话,共同构成从硬件到应用的完整图形栈。

微小的鱼的博客 431

【Linux】进程间通信的基础概念及基于匿名管道的进程池

前面我们介绍了进程的创建、退出和等待,接下来看看进程之间怎样传递数据。这篇从匿名管道入手,再用管道把父子进程联系起来,写一个简单的进程池小demo。而且我把发行版从CentOS切换成Ubuntu了,主要是CentOS已经不维护了,可惜了。。。

qeen87的博客 326
上一篇: CSAPP AttackLab:Ubuntu22.04中运行 ctarget 导致 Segmentation Fault
下一篇: CSAPP ch12家庭作业 读者写者问题
cramming
博客等级 码龄6年 8粉丝 6原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值