Changes
Page history
Update debugging
authored
Aug 13, 2023
by
umaumax
Show whitespace changes
Inline
Side-by-side
debugging.md
View page @
e7050685
...
...
@@ -179,6 +179,13 @@ ps $(grep /lib/x86_64-linux-gnu/libnss_files-2.23.so /proc/*/maps | cut -d / -f3
### 遅延読み込みのライブラリが今現在、読み込まれているかどうかを知りたい
`pmap`
コマンドや
`/proc/$PID/maps`
を利用すれば、どのライブラリがどこのメモリマップにあるかわかる
### スタック破壊を検出したい
*
stack protectorはリリース向けでも適用可能である(オーバーヘッドがほぼないため、リリース向けで実績あり)
*
破壊された場合には
`assert`
となるが、そもそも、スタック破壊された場合には予期しない挙動となるので、
`assert`
で処理が終了するほうがまだよい挙動である
*
[
Instrumentation Options (Using the GNU Compiler Collection (GCC))
](
https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html
)
*
`CFLAGS += -D_FORTIFY_SOURCE=1 -fstack-protector-strong`
*
[
全てのプログラムに gcc の -D_FORTIFY_SOURCE と -fstack-protector オプションが効くわけではない話 | かわうそ通信
](
https://konpeitoh.net/tech/stack-protector_20220724/
)
## 各スレッドがどのようなスレッドかどうかを知りたい
### あるプロセスの各スレッドで実行した動的リンクした関数の一覧を取得して,図示したい
...
...
...
...