Spotting and Avoiding Heap Fragmentation in Rust Applications

tags: Heap Fragmentation, jemalloc source:Svix Blog. “Spotting and Avoiding Heap Fragmentation in Rust Applications,” April 4, 2023. https://www.svix.com/blog/heap-fragmentation-in-rust-applications/. Heap fragmentation cause stair-step memeory usage, use jemalloc to solve heap fragmentation.

April 7, 2023 · 1 min · Gray King

Sign Message

tags: Blockchain

April 7, 2023 · 1 min · Gray King

Tron Signing Data

tags: Tron, Sign Message Three methods tronweb.trx.signMessageV11 tronweb.trx.signMessageV22 tronweb.trx._signtypeddata3, 4 https://github.com/tronprotocol/tronweb/blob/859253856c79d3aff26ec6c89afefc73840d648d/src/lib/trx.js#L727-L739 ↩︎ https://github.com/tronprotocol/tronweb/blob/859253856c79d3aff26ec6c89afefc73840d648d/src/utils/message.js#L8-L18 ↩︎ https://github.com/tronprotocol/tronweb/blob/859253856c79d3aff26ec6c89afefc73840d648d/src/utils/crypto.js#L89 ↩︎ TIP 104 ↩︎

April 7, 2023 · 1 min · Gray King

Ethereum Signing Data

tags: Ethereum, Sign Message source: “Signing Data | MetaMask Docs.” Accessed April 6, 2023. https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4. Five Methods1 eth_sign allow to sign arbitrary hash.2 personal_sign add prefix to data and human readable text that encoded UFT-8.3 signTypedData or signTypedData_v1 first release that lacked some later security improvements. signTypedData_v3 signTypedData_v4 compatible with V3. Differences Between V3 and V44 Some input types that V3 doesn’t support but V4 does: Custom type array Custom type with null input Some input types that V4 doesn’t support but V3 does: ...

April 6, 2023 · 1 min · Gray King

Use GDB to Debug Cgo Segmentation Fault

tags: Go, GDB Enable Core Dumps ulimit -S -c unlimited Confirm or Change The Location of Core Dumps sysctl -w kernel.core_pattern=/tmp/core.%e.%p # Or echo '/tmp/core.%e.%p' | tee /proc/sys/kernel/core_pattern Set GOTRACEBACK Environment Variable to Let Go Program Core Dumps when Panic export GOTRACEBACK=crash Run Go Program and Wait Segmentation Fault Use GDB to Debug gdb /path/to/goprogram /tmp/core-xx-xx Then use thread apply all bt to see all backtraces, include compiled C code. Note: -g option should be applied to the compiled C code to generate debug symbols. ...

April 5, 2023 · 1 min · Gray King