Token导航 LogoToken导航

Agent Skill · 运维和基础设施

custom-memory-heap-crash(自定义内存堆崩溃)

custom-memory-heap-crash 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

custom-memory-heap-crash 是运维和基础设施类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描已通过,按安装量在运维和基础设施类的 2,449 个 Skill 里排第 1,169。

总安装 808周安装 33GitHub Stars 93下载 259核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:custom-memory-heap-crash(自定义内存堆崩溃)
来源仓库:https://github.com/letta-ai/skills
仓库路径:skills/custom-memory-heap-crash
安装命令:
npx skills add https://github.com/letta-ai/skills --skill custom-memory-heap-crash
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/letta-ai/skills --skill custom-memory-heap-crash

这个 Skill 是做什么的

运维和基础设施类 Skill 处理部署、监控、日志和云资源,多数需要较高的执行权限。

custom-memory-heap-crash 调试自定义内存堆导致的崩溃问题,特别是静态析构顺序异常。重点排查 DEBUG 与 RELEASE 构建间的行为差异。适用于标准库组件(如 locale、iostream)中的内存生命周期问题。建议结合日志与内存快照分析定位具体失效点。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/custom-memory-heap-crash

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/letta-ai/skills --skill custom-memory-heap-cra…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

custom-memory-heap-crash 怎么安装?

在终端执行 npx skills add https://github.com/letta-ai/skills --skill custom-memory-heap-crash。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

custom-memory-heap-crash 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

custom-memory-heap-crash 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

custom-memory-heap-crash 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

custom-memory-heap-crash 用的人多吗?

公开数据是累计安装 808 次,近一周安装 33 次,下载 259 次,GitHub 93 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

custom-memory-heap-crash 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理运维和基础设施类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

运维和基础设施类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
brainstorming

头脑风暴 · Codex、Claude

3,148,776173,131操作浏览器MIT通过
copywriting

文案写作 · Codex、Claude

1,996,72425,583需要联网MIT通过
openclaw-secure-linux-cloud

OpenClaw secure linux cloud 命令行 · Codex、Claude

1,853,08840接触敏感数据未明确未通过
xget

xget 命令行 · Codex、Claude

1,799,28040执行命令未明确未通过
requesting-code-review

代码审查请求 · Codex、Claude

1,590,144173,103权限未标注MIT通过
custom-memory-heap-crash

自定义内存堆崩溃 · 本页

80893需要联网MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Custom Memory Heap Crash Debugging

This skill provides systematic approaches for debugging crashes related to custom memory heaps, with emphasis on static destruction ordering issues, DEBUG vs RELEASE discrepancies, and memory lifecycle problems.

Problem Recognition

Apply this skill when encountering:

  • Crashes that occur only in RELEASE builds but not DEBUG builds
  • Segmentation faults or access violations during program shutdown
  • Use-after-free errors involving custom allocators
  • Crashes in standard library code (locale, iostream, etc.) when custom heaps are involved
  • Memory lifecycle issues during static destruction phase

Investigation Approach

Phase 1: Reproduce and Characterize

  1. Build both configurations: Compile the application in both DEBUG and RELEASE modes to confirm the discrepancy
  2. Identify crash timing: Determine if the crash occurs during:

- Normal execution - Program shutdown (static destruction phase) - Library initialization

  1. Collect crash information: Use GDB or equivalent debugger to obtain:

- Full backtrace at crash point - Register values and memory state - The specific instruction causing the crash

Phase 2: Understand Memory Lifecycle

  1. Map allocator lifecycle: Document when custom heaps are:

- Created (constructor timing) - Active (during main execution) - Destroyed (destructor timing)

  1. Identify static objects: List all static/global objects that may allocate memory
  2. Trace allocation sources: Determine which allocator (custom vs system) handles each allocation

Phase 3: Analyze Static Destruction Order

  1. Review destruction sequence: Static objects are destroyed in reverse order of construction
  2. Check cross-dependencies: Identify objects that depend on the custom heap but may be destroyed after it
  3. Examine library internals: Standard library components (locales, facets, streams) may register objects that outlive custom heaps

Common Root Causes

Use-After-Free During Static Destruction

Pattern: Objects allocated from a custom heap are accessed after the heap is destroyed.

Symptoms:

  • Crash in destructor or cleanup code
  • Backtrace shows standard library cleanup (e.g., locale facet destruction)
  • Crash accesses memory that was valid earlier

Investigation:

  • Check if standard library objects (locale facets, stream buffers) are allocated from the custom heap
  • Verify the custom heap outlives all its allocations

DEBUG vs RELEASE Allocation Differences

Pattern: Different allocation patterns between build configurations cause memory to come from different sources.

Symptoms:

  • Works in DEBUG, crashes in RELEASE
  • Memory addresses differ between configurations
  • Conditional compilation affects allocator selection

Investigation:

  • Examine preprocessor conditionals affecting memory allocation
  • Check if DEBUG mode uses system allocator while RELEASE uses custom heap
  • Look for #ifdef DEBUG or #ifndef NDEBUG blocks around allocation code

Library-Internal Allocations

Pattern: Standard library internally allocates memory that gets routed through custom allocators.

Symptoms:

  • Crash during library cleanup code
  • Backtrace shows internal library functions
  • No obvious user code involvement

Investigation:

  • Trace which library operations trigger allocations
  • Check if locale, iostream, or other library initializations use the custom heap
  • Examine library source code if available

Solution Strategies

Strategy 1: Force Early Initialization

Trigger library initialization before the custom heap is created, ensuring library-internal allocations use the system allocator.

Implementation approach:

  • Call library functions in user_init() or before heap creation
  • For locale issues: instantiate std::locale() early
  • For iostream issues: perform I/O operations early

Strategy 2: Extend Heap Lifetime

Ensure the custom heap outlives all objects allocated from it.

Implementation approach:

  • Use static local variables with guaranteed destruction order
  • Implement explicit cleanup before heap destruction
  • Consider lazy destruction or leaking the heap intentionally

Strategy 3: Exclude Library Allocations

Prevent library-internal allocations from using the custom heap.

Implementation approach:

  • Modify allocator selection logic to exclude certain allocation types
  • Use thread-local flags during library initialization
  • Implement allocation source tracking

Verification Checklist

After implementing a fix:

  1. Build verification: Confirm both DEBUG and RELEASE builds compile without errors
  2. Runtime verification: Run both configurations without crashes
  3. Memory leak check: Use Valgrind or equivalent to verify no memory leaks introduced
  4. Stress testing: Run multiple iterations to catch intermittent issues
  5. Destruction order verification: Confirm proper cleanup sequence with logging if needed

Debugging Tools and Techniques

GDB Commands for Memory Issues

# Get backtrace at crash
bt full

# Examine memory at address
x/16xg <address>

# Check if address is valid
info proc mappings

# Set breakpoint on destructor
break ClassName::~ClassName

# Watch memory location
watch *<address>

Valgrind Usage

# Basic memory check
valgrind --leak-check=full ./program

# Track origins of uninitialized values
valgrind --track-origins=yes ./program

# Detect invalid reads/writes
valgrind --read-var-info=yes ./program

Common Pitfalls

  1. Incomplete initialization: Triggering partial library initialization may not allocate all necessary objects. Verify the specific code path that causes problematic allocations.
  2. Multiple initialization points: Library components may be initialized from multiple code paths. Ensure all paths are covered.
  3. Thread safety assumptions: Static initialization may involve thread-safety mechanisms that interact with custom allocators.
  4. Optimization effects: Compiler optimizations may reorder or eliminate code that affects allocation timing.
  5. GDB command syntax: When debugging, use proper quoting and escaping. Test commands interactively before scripting.
  6. Assuming single root cause: Multiple allocation sources may contribute to the problem. Verify each fix addresses all crash scenarios.

Decision Framework

When investigating, follow this systematic approach:

  1. Can the crash be reproduced reliably? If not, add logging to capture crash state.
  2. Is this a DEBUG vs RELEASE discrepancy? Check preprocessor conditionals.
  3. Does the crash occur during shutdown? Focus on static destruction order.
  4. Is library code involved? Investigate library initialization and cleanup.
  5. Is memory being accessed after free? Trace the allocation source and lifetime.

Apply fixes incrementally and verify each change before proceeding.

平台分布

Claude Code

28.76%
按下载量换算74

Gemini CLI

22.8%
按下载量换算59

Antigravity

14.96%
按下载量换算39

windsurf

13.21%
按下载量换算34

Codex

8.17%
按下载量换算21

OpenCode

3.41%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills