惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
H
Help Net Security
Recorded Future
Recorded Future
The Register - Security
The Register - Security
F
Full Disclosure
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hackread – Cybersecurity News, Data Breaches, AI and More
爱范儿
爱范儿
Security Archives - TechRepublic
Security Archives - TechRepublic
Simon Willison's Weblog
Simon Willison's Weblog
Cisco Talos Blog
Cisco Talos Blog
I
InfoQ
T
Tenable Blog
T
Tor Project blog
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
NISL@THU
NISL@THU
Google DeepMind News
Google DeepMind News
博客园 - 叶小钗
B
Blog
V
V2EX
Jina AI
Jina AI
L
LangChain Blog
月光博客
月光博客
W
WeLiveSecurity
U
Unit 42
AWS News Blog
AWS News Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园 - 聂微东
V
Visual Studio Blog
A
Arctic Wolf
T
Tailwind CSS Blog
The Cloudflare Blog
SecWiki News
SecWiki News
S
SegmentFault 最新的问题
Hacker News - Newest:
Hacker News - Newest: "LLM"
宝玉的分享
宝玉的分享
MyScale Blog
MyScale Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Securelist
www.infosecurity-magazine.com
www.infosecurity-magazine.com
腾讯CDC
雷峰网
雷峰网

博客园 - 有安科技

好消息,OpenResty Manager专业版来了,如何免费升级? NanoPi R3S PVE 8.X 优化 鹊桥-零信任安全网格网络 森罗-攻击面管理平台 天机-免费的新一代办公安全平台 南墙WAF-最好的免费Web应用防火墙 Elastic Stack 7.4.0~7.5.0 白金版永不过期 JVM CPU占满问题定位 SQL2008数据库优化常用脚本 Tips of Linux C programming nginx url解码引发的waf漏洞 http长连接200万尝试及调优 发个在owasp上演讲web应用防火墙的ppt Using Internet Explorer from .NET scrapy结合webkit抓取js生成的页面 快速构建实时抓取集群 Safe3 Web漏洞扫描系统 v9.6免费版 Varnish+Xcache构建高性能WEB构架初探 IIS监控请求脚本
linux程序调试
有安科技 · 2012-06-07 · via 博客园 - 有安科技

strace -f -F -o strace.txt /data1/waf/sbin/nginx -c /data1/waf/conf/nginx.conf


如果想让系统在信号中断造成的错误时产生core文件, 我们需要在shell中按如下设置:
#设置core大小为无限
ulimit -c unlimited
#设置文件大小为无限
ulimit unlimited
gdb /data1/waf/sbin/nginx core.21169

编译nginx程序-g: 产生调试工具所用的调试符号信息(如果所编译的程序想要调试就需要加-g),-O, -O2,-O3: 优化编译连接 是执行的更迅速 -O的优化<-O2的优化<-O3的优化(不加是默认是-O)这个只在你的程序已经确定没有错误,可以发布时才去进行优化 平时就不用了

设置Core Dump的核心转储文件目录和命名规则
/proc/sys/kernel/core_uses_pid可以控制产生的core文件的文件名中是否添加pid作为扩展,如果添加则文件内容为1,否则为0
/proc/sys/kernel/core_pattern可以设置格式化的core文件保存位置或文件名,比如原来文件内容是core-%e
可以这样修改:
echo "/corefile/core-%e-%p-%t" > /proc/sys/kernel/core_pattern
将会控制所产生的core文件会存放到/corefile目录下,产生的文件名为core-命令名-pid-时间戳
以下是参数列表:
    %p - insert pid into filename 添加pid
    %u - insert current uid into filename 添加当前uid
    %g - insert current gid into filename 添加当前gid
    %s - insert signal that caused the coredump into the filename 添加导致产生core的信号
    %t - insert UNIX time that the coredump occurred into filename 添加core文件生成时的unix时间
    %h - insert hostname where the coredump happened into filename 添加主机名
    %e - insert coredumping executable name into filename 添加命令名

测试产生core文件:kill -s SIGSEGV $$