OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / release / man5 / core.5
1 .\" Copyright (c) 2006, 2008 by Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Japanese Version Copyright (c) 2006-2008 Akihiro MOTOKI
24 .\" Translated 2006-04-15, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
25 .\" Updated 2007-01-05, Akihiro MOTOKI, LDP v2.43
26 .\" Updated 2007-09-03, Akihiro MOTOKI, LDP v2.64
27 .\" Updated 2008-08-10, Akihiro MOTOKI, LDP v3.05
28 .\" Updated 2008-09-19, Akihiro MOTOKI, LDP v3.08
29 .\"
30 .TH CORE 5 2010-02-27 "Linux" "Linux Programmer's Manual"
31 .SH Ì¾Á°
32 core \- ¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë
33 .SH ÀâÌÀ
34 ¤¢¤ë¼ï¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±¤¿¾ì¹ç¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥¢¥¯¥·¥ç¥ó¤Ï¡¢
35 ¥×¥í¥»¥¹¤ò½ªÎ»¤· (terminate)¡¢
36 .I "¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë (core dump file)"
37 ¤òÀ¸À®¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Ï¡¢¥Ç¥£¥¹¥¯¾å¤ËÀ¸À®¤µ¤ì¤ë
38 ½ªÎ»»þ¤Î¥×¥í¥»¥¹¤Î¥á¥â¥ê¥¤¥á¡¼¥¸¤òÆâÍƤȤ¹¤ë¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¡£
39 ¤³¤Î¥¤¥á¡¼¥¸¤ò¥Ç¥Ð¥Ã¥¬ (Î㤨¤Ð
40 .BR gdb (1))
41 ¤ËÆɤ߹þ¤ó¤Ç¡¢
42 ¥×¥í¥°¥é¥à¤¬½ªÎ»¤·¤¿»þÅÀ¤Î¥×¥í¥°¥é¥à¤Î¾õÂÖ¤ò¸¡ºº¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
43 ¤É¤Î¥·¥°¥Ê¥ë¤ò¼õ¤±¤¿¤È¤­¤Ë¥×¥í¥»¥¹¤¬¥³¥¢¥À¥ó¥×¤òÀ¸À®¤¹¤ë¤«¤Î¥ê¥¹¥È¤Ï
44 .BR signal (7)
45 ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¡£
46
47 ¥×¥í¥»¥¹¤Ï¥½¥Õ¥È¡¦¥ê¥½¡¼¥¹À©¸Â
48 .B RLIMIT_CORE
49 ¤òÀßÄꤹ¤ë¤³¤È¤Ç¡¢¡Ö¥³¥¢¥À¥ó¥×¡×¥·¥°¥Ê¥ë¤ò¼õ¿®¤·¤¿ºÝ¤ËÀ¸À®¤µ¤ì¤ë
50 ¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤Ë¾å¸Â¤ò²Ý¤¹¤³¤È¤¬¤Ç¤­¤ë¡£¾ÜºÙ¤Ï
51 .BR getrlimit (2)
52 ¤ò»²¾È¡£
53
54 ¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤¬À¸À®¤µ¤ì¤Ê¤¤¾õ¶·¤¬¤¤¤¯¤Ä¤«¤¢¤ë:
55 .IP * 3
56 ¥×¥í¥»¥¹¤¬¥³¥¢¥Õ¥¡¥¤¥ë¤ò½ñ¤­¹þ¤àµö²Ä¤ò»ý¤¿¤Ê¤¤¾ì¹ç
57 (¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥³¥¢¥Õ¥¡¥¤¥ë¤Ï
58 .I core
59 ¤È¤¤¤¦Ì¾Á°¤Ç¡¢¥«¥ì¥ó¥È¡¦¥ï¡¼¥­¥ó¥°¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ËÀ¸À®¤µ¤ì¤ë¡£
60 ̿̾µ¬Â§¤Î¾ÜºÙ¤Ï²¼µ­¤ò»²¾È)¡£
61 ¥³¥¢¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤è¤¦¤È¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬½ñ¤­¹þ¤ß²Äǽ¤Ç¤Ê¤¤¾ì¹ç¡¢
62 ¤â¤·¤¯¤ÏƱ¤¸Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬½ñ¤­¹þ¤ß²Äǽ¤Ç¤â
63 Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤Ç¤â¤Ê¤¤¾ì¹ç (Î㤨¤Ð¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ä¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯)¡¢
64 ¥³¥¢¥Õ¥¡¥¤¥ë¤ÎÀ¸À®¤Ï¼ºÇÔ¤¹¤ë¡£
65 .IP *
66 ¥³¥¢¥À¥ó¥×¤Ë»È¤ª¤¦¤È¤·¤¿¤Î¤ÈƱ¤¸Ì¾Á°¤Î (½ñ¤­¹þ¤ß²Äǽ¤Ê¡¢Ä̾ï¤Î) ¥Õ¥¡¥¤¥ë¤¬
67 ¤¹¤Ç¤Ë¸ºß¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥Ï¡¼¥É¥ê¥ó¥¯¤¬ 2¸Ä°Ê¾å¤¢¤ë¾ì¹ç¡£
68 .IP *
69 ¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤è¤¦¤È¤·¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤¬¥Õ¥ë¤Ç¤¢¤ë¤«¡¢
70 inode ¤¬Á´¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤ë¤«¡¢Æɤ߹þ¤ßÀìÍѤǥޥ¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡£
71 ¤Þ¤¿¤Ï¡¢¤½¤Î¥æ¡¼¥¶¤Î¥Ç¥£¥¹¥¯»ÈÍÑÎ̤¬¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î
72 ¥¯¥ª¡¼¥¿ (quota) ¤Ë㤷¤Æ¤¤¤ë¡£
73 .IP *
74 ¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤è¤¦¤È¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡£
75 .IP *
76 ¥×¥í¥»¥¹Ëè¤Î¥ê¥½¡¼¥¹À©¸Â
77 .B RLIMIT_CORE
78 (¥³¥¢¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º) ¤«
79 .B RLIMIT_FSIZE
80 (¥Õ¥¡¥¤¥ë¥µ¥¤¥º) ¤¬ 0 ¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡£
81 .BR getrlimit (2)
82 ¤ä¥·¥§¥ë¤Î
83 .I ulimit
84 ¥³¥Þ¥ó¥É¤Î¥É¥­¥å¥á¥ó¥È
85 .RB ( csh (1)
86 ¤Î
87 .IR limit )
88 ¤ò»²¾È¡£
89 .IP *
90 ¥×¥í¥»¥¹¤¬¼Â¹Ô¤·¤¿¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë¤ÎÆɤ߽Ф·µö²Ä¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡£
91 .IP *
92 ¥×¥í¥»¥¹¤¬¼Â¹Ô¤·¤Æ¤¤¤ë set-user-ID (set-group-ID) ¥×¥í¥°¥é¥à¤Î½êÍ­¼Ô¤Î
93 ¥æ¡¼¥¶ (¥°¥ë¡¼¥×) ¤¬¡¢¥×¥í¥»¥¹¤Î¼Â UID (¼Â GID) ¤È°Û¤Ê¤ë¾ì¹ç
94 (⤷¡¢
95 .BR prctl (2)
96 .B PR_SET_DUMPABLE
97 Áàºî¤ÎÀâÌÀ¤È¡¢
98 .BR proc (5)
99 ¤Î
100 .I /proc/sys/fs/suid_dumpable
101 ¥Õ¥¡¥¤¥ë¤ÎÀâÌÀ¤â»²¾È¤Î¤³¤È)¡£
102 .\" FIXME . Perhaps relocate discussion of /proc/sys/fs/suid_dumpable
103 .\" and PR_SET_DUMPABLE to this page?
104 .SS ¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î̾Á°
105 .\" motoki XXX Æ±¤¸ÆâÍƤ¬½ÅÊ£¤·¤Æ½ñ¤«¤ì¤Æ¤¤¤ë¡£
106 ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î̾Á°¤Ï
107 .I core
108 ¤È¤Ê¤ë¤¬¡¢¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î̾Á°¤ò·è¤á¤ë¤Î¤Ë»È¤ï¤ì¤ë¥Æ¥ó¥×¥ì¡¼¥È¤ò
109 .I /proc/sys/kernel/core_pattern
110 ¥Õ¥¡¥¤¥ë¤ËÄêµÁ¤¹¤ë¤³¤È¤Ç¡¢¥Õ¥¡¥¤¥ë̾¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë
111 .RI ( /proc/sys/kernel/core_pattern
112 ¤Ï Linux 2.6 ¤ª¤è¤Ó 2.4.21 °Ê¹ß¤ÇÍøÍѤǤ­¤ë)¡£
113 ¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤Ï % »Ø¼¨»Ò (specifier) ¤òÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
114 ¤³¤ì¤Ï¥³¥¢¥Õ¥¡¥¤¥ë¤¬À¸À®¤µ¤ì¤ëºÝ¤Ë¡¢°Ê²¼¤ÎÃͤËÃÖ¤­´¹¤¨¤é¤ì¤ë¡£
115 .PP
116 .RS 4
117 .PD 0
118 .TP 4
119 %%
120 1 ¤Ä¤Î % Ê¸»ú
121 .TP
122 %p
123 ¥À¥ó¥×¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¥×¥í¥»¥¹ID (PID)
124 .TP
125 %u
126 ¥À¥ó¥×¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¼Â¥æ¡¼¥¶ ID (real UID)
127 .TP
128 %g
129 ¥À¥ó¥×¤µ¤ì¤¿¥×¥í¥»¥¹¤Î¼Â¥°¥ë¡¼¥× ID (real GID)
130 .TP
131 %s
132 ¥À¥ó¥×¤ò°ú¤­µ¯¤³¤·¤¿¥·¥°¥Ê¥ë¤ÎÈÖ¹æ
133 .TP
134 %t
135 ¥À¥ó¥×»þ¹ï¡¢µª¸µ (Epoch; 1970-01-01 00:00:00 +0000 (UTC))
136 ¤«¤é¤ÎÉÿô¡£
137 .TP
138 %h
139 ¥Û¥¹¥È̾ (\fBuname\fP(2) ¤ÇÊÖ¤µ¤ì¤ë \fInodename\fP ¤ÈƱ¤¸)
140 .TP
141 %e
142 ¼Â¹Ô¥Õ¥¡¥¤¥ë̾ (¥Ñ¥¹Ì¾¤Î¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤Ï´Þ¤Þ¤ì¤Ê¤¤)
143 .TP
144 %c
145 ¥¯¥é¥Ã¥·¥å¤·¤¿¥×¥í¥»¥¹¤Î¥³¥¢¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤Ë´Ø¤¹¤ë¥½¥Õ¥È¥ê¥½¡¼¥¹¾å¸Â
146 (Linux 2.6.24 °Ê¹ß)
147 .PD
148 .RE
149 .PP
150 ¥Æ¥ó¥×¥ì¡¼¥È¤ÎËöÈø¤Ë 1 ¸Ä¤À¤± % ¤¬¤¢¤ë¾ì¹ç¡¢
151 ¤½¤Î % ¤Ï¥³¥¢¥Õ¥¡¥¤¥ë̾¤Ë¤Ï´Þ¤á¤é¤ì¤Ê¤¤¡£¤Þ¤¿¡¢¾å¤ÇÎóµó¤µ¤ì¤Æ
152 ¤¤¤Ê¤¤ % ¤Èʸ»ú¤ÎÁȤ߹ç¤ï¤»¤¬¤¢¤Ã¤¿¾ì¹ç¤âƱÍͤǤ¢¤ë¡£
153 ¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤ª¤±¤ë¾¤Îʸ»ú¤Ï¡¢
154 ¥³¥¢¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ¤½¤Î¤Þ¤Þ»È¤ï¤ì¤ë¡£
155 ¥Æ¥ó¥×¥ì¡¼¥È¤Ë¤Ï \(aq/\(aq Ê¸»ú¤òÆþ¤ì¤ë¤³¤È¤¬¤Ç¤­¡¢
156 ¥Ç¥£¥ì¥¯¥È¥ê̾¤Î¶èÀÚ¤êʸ»ú¤È²ò¼á¤µ¤ì¤ë¡£
157 ·ë²Ì¤È¤·¤ÆÀ¸À®¤µ¤ì¤ë¥³¥¢¥Õ¥¡¥¤¥ë̾¤ÎºÇÂ祵¥¤¥º¤Ï 128 ¥Ð¥¤¥È¤Ç¤¢¤ë
158 (2.6.19 ¤è¤êÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï 64 ¥Ð¥¤¥È)¡£
159 ¤³¤Î¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤϠ"core" ¤Ç¤¢¤ë¡£
160 °ÊÁ°¤Î¤â¤Î¤È¤Î¸ß´¹À­¤Î¤¿¤á¡¢
161 .I /proc/sys/kernel/core_pattern
162 ¤Ë "%p" ¤¬´Þ¤Þ¤ì¤º¡¢
163 ¤«¤Ä
164 .I /proc/sys/kernel/core_uses_pid
165 (²¼µ­»²¾È) ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢.PID ¤¬¥³¥¢¥Õ¥¡¥¤¥ë̾¤ËÄɲ䵤ì¤ë¡£
166
167 ¥Ð¡¼¥¸¥ç¥ó 2.4 °Ê¹ß¤Î Linux ¤Ç¤Ï
168 ¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Î̾Á°¤òÀ©¸æ¤¹¤ë¸¶»ÏŪ¤ÊÊýË¡¤âÄ󶡤µ¤ì¤Æ¤¤¤ë¡£
169 .I /proc/sys/kernel/core_uses_pid
170 ¥Õ¥¡¥¤¥ë¤ËÃÍ 0 ¤¬½ñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Ïñ½ã¤Ë
171 .I core
172 ¤È¤¤¤¦Ì¾Á°¤Ë¤Ê¤ë¡£¤³¤Î¥Õ¥¡¥¤¥ë¤Ë 0 °Ê³°¤ÎÃͤ¬½ñ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¡¢
173 ¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Ï
174 .I core.PID
175 ¤È¤¤¤¦·Á¼°¤Î̾Á°¤Ë¤Ê¤ê¡¢¥Õ¥¡¥¤¥ë̾¤Ë¥×¥í¥»¥¹ ID ¤¬´Þ¤Þ¤ì¤ë¡£
176 .SS ¥³¥¢¥À¥ó¥×¤Î¥×¥í¥°¥é¥à¤Ø¤Î¥Ñ¥¤¥×
177 ¥«¡¼¥Í¥ë 2.6.19 °Ê¹ß¤Ç¤Ï¡¢Linux ¤Ï
178 .I /proc/sys/kernel/core_pattern
179 ¥Õ¥¡¥¤¥ë¤ÎÊ̤ι½Ê¸¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£
180 ¤³¤Î¥Õ¥¡¥¤¥ë¤ÎºÇ½é¤Îʸ»ú¤¬¥Ñ¥¤¥×µ­¹æ (\fB|\fP) ¤Ç¤¢¤ì¤Ð¡¢
181 ¤½¤Î¹Ô¤Î»Ä¤ê¤ÎÉôʬ¤Ï¼Â¹Ô¤¹¤ë¥×¥í¥°¥é¥à¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£
182 ¥³¥¢¥À¥ó¥×¤Ï¡¢¥Ç¥£¥¹¥¯¾å¤Î¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢
183 ¥×¥í¥°¥é¥à¤Îɸ½àÆþÎϤȤ·¤ÆÅϤµ¤ì¤ë¡£
184 °Ê²¼¤ÎÅÀ¤ËÃí°Õ¤¹¤ë¤³¤È¡£
185 .IP * 3
186 ¥×¥í¥°¥é¥à¤ÏÀäÂХѥ¹Ì¾ (¤â¤·¤¯¤Ï¥ë¡¼¥È¥Ç¥£¥ì¥¯¥È¥ê \fI/\fP ¤«¤é¤Î
187 ÁêÂХѥ¹Ì¾) ¤Ç»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
188 ¤Þ¤¿¡¢'|' Ê¸»ú¤Îľ¸å¤«¤é»Ï¤á¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
189 .IP *
190 ¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤ËÀ¸À®¤µ¤ì¤ë¥×¥í¥»¥¹¤Ï¡¢
191 ¥æ¡¼¥¶¡¢¥°¥ë¡¼¥×¤È¤â
192 .I root 
193 ¤È¤·¤Æ¼Â¹Ô¤µ¤ì¤ë¡£
194 .IP *
195 ¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤ò¥×¥í¥°¥é¥à¤ËÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­ (¥«¡¼¥Í¥ë 2.6.24 °Ê¹ß)¡¢
196 °ú¤­¿ô¤Ï¥Û¥ï¥¤¥È¥¹¥Ú¡¼¥¹¤Ç¶èÀÚ¤ë
197 (1¹Ô¤ÎºÇÂçĹ¤Ï 128 ¥Ð¥¤¥È¤¬¾å¸Â¤Ç¤¢¤ë)¡£
198 .IP *
199 ¥³¥Þ¥ó¥É¥é¥¤¥ó°ú¤­¿ô¤Ë¤Ï¡¢¾åµ­¤Î¥ê¥¹¥È¤Ë¤¢¤ë % »Ø¼¨»Ò¤ò´Þ¤á¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
200 Î㤨¤Ð¡¢¥À¥ó¥×¤µ¤ì¤ë¥×¥í¥»¥¹¤Î PID ¤òÅϤ¹¤Ë¤Ï¡¢
201 °ú¤­¿ô¤Ë
202 .I %p
203 ¤ò»ØÄꤹ¤ë¡£
204 .SS ¤É¤Î¥Þ¥Ã¥Ô¥ó¥°¤ò¥³¥¢¥À¥ó¥×¤Ë½ñ¤­¹þ¤à¤«¤òÀ©¸æ¤¹¤ë
205 ¥«¡¼¥Í¥ë 2.6.23 °Ê¹ß¤Ç¤Ï¡¢Linux ¸ÇÍ­¤Î¥Õ¥¡¥¤¥ë
206 .I /proc/PID/coredump_filter
207 ¤ò»È¤Ã¤Æ¡¢Âбþ¤¹¤ë¥×¥í¥»¥¹ ID ¤ò»ý¤Ä¥×¥í¥»¥¹¤ËÂФ·¤Æ¥³¥¢¥À¥ó¥×¤¬¹Ô¤ï¤ì¤ë
208 ºÝ¤Ë¡¢¤É¤Î¥á¥â¥ê¥»¥°¥á¥ó¥È¤ò¥³¥¢¥À¥ó¥×¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤à¤«¤òÀ©¸æ¤Ç¤­¤ë¡£
209
210 ¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÃͤϥá¥â¥ê¥Þ¥Ã¥Ô¥ó¥°¼ïÊÌ
211 .RB ( mmap (2)
212 »²¾È) ¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£
213 ¥Þ¥¹¥¯Æâ¤Î¤¢¤ë¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤ë¤È¡¢¤½¤Î¥Ó¥Ã¥È¤ËÂбþ¤¹¤ë¼ïÊ̤Î
214 ¥á¥â¥ê¥Þ¥Ã¥Ô¥ó¥°¤¬¥À¥ó¥×¤µ¤ì¤ë¡£¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤Ï¥À¥ó¥×¤µ¤ì¤Ê¤¤¡£
215 ¤³¤Î¥Õ¥¡¥¤¥ë¤Î³Æ¥Ó¥Ã¥È¤Ï°Ê²¼¤Î°ÕÌ£¤ò»ý¤Ä¡£
216 .PP
217 .PD 0
218 .RS 4
219 .TP
220 bit 0
221 ̵̾¤Î¥×¥é¥¤¥Ù¡¼¥È¥Þ¥Ã¥Ô¥ó¥° (anonymous private mappings) ¤ò¥À¥ó¥×¤¹¤ë¡£
222 .TP
223 bit 1
224 ̵̾¤Î¶¦Í­¥Þ¥Ã¥Ô¥ó¥° (anonymous shared mappings) ¤ò¥À¥ó¥×¤¹¤ë¡£
225 .TP
226 bit 2
227 ¥Õ¥¡¥¤¥ë¤È´ØÏ¢ÉÕ¤±¤é¤ì¤¿¥×¥é¥¤¥Ù¡¼¥È¥Þ¥Ã¥Ô¥ó¥°
228 (file-backed private mappings) ¤ò¥À¥ó¥×¤¹¤ë¡£
229 .TP
230 bit 3
231 ¥Õ¥¡¥¤¥ë¤È´ØÏ¢ÉÕ¤±¤é¤ì¤¿¶¦Í­¥Þ¥Ã¥Ô¥ó¥°
232 (file-backed shared mappings) ¤ò¥À¥ó¥×¤¹¤ë¡£
233 .\" file-backed shared mappings of course also update the underlying
234 .\" mapped file.
235 .TP
236 bit 4 (Linux 2.6.24 °Ê¹ß)
237 ELF ¥Ø¥Ã¥À¤ò¥À¥ó¥×¤¹¤ë¡£
238 .TP
239 bit 5 (Linux 2.6.28 °Ê¹ß)
240 ¥×¥é¥¤¥Ù¡¼¥È¤Ê¥Ò¥å¡¼¥¸¥Ú¡¼¥¸ (private huge page) ¤ò¥À¥ó¥×¤¹¤ë¡£
241 .TP
242 bit 6 (Linux 2.6.28 °Ê¹ß)
243 ¶¦Í­¤µ¤ì¤¿¥Ò¥å¡¼¥¸¥Ú¡¼¥¸ (shared huge page) ¤ò¥À¥ó¥×¤¹¤ë¡£
244 .RE
245 .PD
246 .PP
247 ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥Ó¥Ã¥È 0, 1, 4, 5 ¤¬¥»¥Ã¥È¤µ¤ì¤ë¡£
248 (¥Ó¥Ã¥È 4 ¤¬¥»¥Ã¥È¤µ¤ì¤ë¤Î¤Ï¡¢¥«¡¼¥Í¥ë¤¬ÀßÄꥪ¥×¥·¥ç¥ó
249 .B CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS
250 ¤òÍ­¸ú¤Ë¤·¤ÆºîÀ®¤µ¤ì¤¿¾ì¹ç¤Ç¤¢¤ë)¡£
251 ¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÃͤϠ16 ¿Ê·Á¼°¤Çɽ¼¨¤µ¤ì¤ë
252 (¤·¤¿¤¬¤Ã¤Æ¡¢¥Ç¥Õ¥©¥ë¥ÈÃͤϠ33 ¤Èɽ¼¨¤µ¤ì¤ë)¡£
253
254 .I coredump_filter
255 ¤ÎÃͤ˴ؤï¤é¤º¡¢¥Õ¥ì¡¼¥à¥Ð¥Ã¥Õ¥¡¤Ê¤É¤Î memory-mapped I/O ¤Ë´Ø¤¹¤ë
256 ¥Ú¡¼¥¸¤Ï·è¤·¤Æ¥À¥ó¥×¤µ¤ì¤º¡¢²¾ÁÛ DSO ¥Ú¡¼¥¸¤Ï¾ï¤Ë¥À¥ó¥×¤µ¤ì¤ë¡£
257
258 .BR fork (2)
259 ¤ÇºîÀ®¤µ¤ì¤ë»Ò¥×¥í¥»¥¹¤Ï¿Æ¥×¥í¥»¥¹¤Î
260 .I coredump_filter
261 ¤ÎÃͤò·Ñ¾µ¤¹¤ë¡£
262 .BR execve (2)
263 ¤ÎÁ°¸å¤Ç
264 .I coredump_filter
265 ¤ÎÃͤÏÊÝ»ý¤µ¤ì¤ë¡£
266
267 Îã¤Î¤è¤¦¤Ë¡¢¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¿Æ¥·¥§¥ë¤Î
268 .I coredump_filter
269 ¤òÀßÄꤷ¤Æ¤ª¤¯¤ÈÌòΩ¤Ä¤³¤È¤¬¤¢¤ë¡£
270
271 .in +4n
272 .nf
273 .RB "$" " echo 0x7 > /proc/self/coredump_filter"
274 .RB "$" " ./some_program"
275 .fi
276 .in
277 .PP
278 ¤³¤Î¥Õ¥¡¥¤¥ë¤¬Ä󶡤µ¤ì¤ë¤Î¤Ï¡¢¥«¡¼¥Í¥ë¤¬ÀßÄꥪ¥×¥·¥ç¥ó
279 .B CONFIG_ELF_CORE
280 ¤òÍ­¸ú¤Ë¤·¤ÆºîÀ®¤µ¤ì¤¿¾ì¹ç¤À¤±¤Ç¤¢¤ë¡£
281 .SH È÷¹Í
282 .BR gdb (1)
283 ¤Î
284 .I gcore
285 ¥³¥Þ¥ó¥É¤ò»ÈÍѤ¹¤ë¤È¡¢¼Â¹ÔÃæ¤Î¥×¥í¥»¥¹¤Î¥³¥¢¥À¥ó¥×¤ò¼èÆÀ¤Ç¤­¤ë¡£
286
287 ¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥×¥í¥»¥¹
288 (¤è¤êÀµ³Î¤Ë¤Ï¡¢
289 .BR clone (2)
290 ¤Î
291 .B CLONE_VM
292 ¤ÇÀ¸À®¤µ¤ì¤¿ÊÌ¥×¥í¥»¥¹¤È¥á¥â¥ê¤ò¶¦Í­¤·¤Æ¤¤¤ë¥×¥í¥»¥¹)
293 ¤¬¥³¥¢¥À¥ó¥×¤òÀ¸À®¤¹¤ë¾ì¹ç¡¢
294 ¥³¥¢¥Õ¥¡¥¤¥ë̾¤Ë¥×¥í¥»¥¹ ID ¤¬É¬¤ºÉղ䵤ì¤ë¡£
295 ¤¿¤À¤·¡¢
296 .I /proc/sys/kernel/core_pattern
297 ¤Î %p »ØÄê¤Ë¤è¤ê¥³¥¢¥Õ¥¡¥¤¥ë̾¤Î¤É¤³¤«Â¾¤Î¾ì½ê¤Ë¥×¥í¥»¥¹ ID ¤¬
298 ¤¹¤Ç¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥×¥í¥»¥¹ ID ¤¬ËöÈø¤ËÉղ䵤ì¤Ê¤¤¡£
299 (¤³¤Îµ¡Ç½¤¬¤Þ¤ºÌò¤ËΩ¤Ä¤Î¤Ï LinuxThreads ¼ÂÁõ¤òÍøÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ç¤¢¤ë¡£
300 LinuxThreads ¼ÂÁõ¤Ç¤Ï¡¢¥×¥í¥»¥¹Æâ¤Î¸Ä¡¹¤Î¥¹¥ì¥Ã¥É¤Ï°Û¤Ê¤ë¥×¥í¥»¥¹ ID
301 ¤ò»ý¤Ä¡£)
302 .\" Always including the PID in the name of the core file made
303 .\" sense for LinuxThreads, where each thread had a unique PID,
304 .\" but doesn't seem to serve any purpose with NPTL, where all the 
305 .\" threads in a process share the same PID (as POSIX.1 requires).  
306 .\" Probably the behavior is maintained so that applications using 
307 .\" LinuxThreads continue appending the PID (the kernel has no easy 
308 .\" way of telling which threading implementation the userspace 
309 .\" application is using). -- mtk, April 2006
310 .SH Îã
311 °Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï
312 .I /proc/sys/kernel/core_pattern
313 ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¤¥×¹½Ê¸¤Î»ÈÍÑÎã¤ò¼¨¤·¤Æ¤¤¤ë¡£
314 °Ê²¼¤Î¥·¥§¥ë¤Î¥»¥Ã¥·¥ç¥ó¤Ï¤³¤Î¥×¥í¥°¥é¥à¤Î»ÈÍÑÎã¤ò¼¨¤¹¤â¤Î¤Ç¤¢¤ë
315 (¥³¥ó¥Ñ¥¤¥ë¤·¤Æ
316 .I core_pattern_pipe_test
317 ¤È¤¤¤¦Ì¾Á°¤Î¼Â¹Ô¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Æ¤¤¤ë)¡£
318 .PP
319 .in +4n
320 .nf
321 .RB "$" " cc \-o core_pattern_pipe_test core_pattern_pipe_test.c"
322 .RB "$" " su"
323 Password:
324 .RB "#" " echo \(aq|$PWD/core_pattern_pipe_test %p \
325 UID=%u GID=%g sig=%s\(aq > \e"
326 .B "    /proc/sys/kernel/core_pattern"
327 .RB "#" " exit"
328 .RB "$" " sleep 100"
329 .BR "^\e" "                     # type control-backslash"
330 Quit (core dumped)
331 .RB "$" " cat core.info"
332 argc=5
333 argc[0]=</home/mtk/core_pattern_pipe_test>
334 argc[1]=<20575>
335 argc[2]=<UID=1000>
336 argc[3]=<GID=100>
337 argc[4]=<sig=3>
338 Total bytes in core dump: 282624
339 .fi
340 .in
341 .SS ¥×¥í¥°¥é¥à¤Î¥½¡¼¥¹
342 \&
343 .nf
344 /* core_pattern_pipe_test.c */
345
346 #define _GNU_SOURCE
347 #include <sys/stat.h>
348 #include <fcntl.h>
349 #include <limits.h>
350 #include <stdio.h>
351 #include <stdlib.h>
352 #include <unistd.h>
353
354 #define BUF_SIZE 1024
355
356 int
357 main(int argc, char *argv[])
358 {
359     int tot, j;
360     ssize_t nread;
361     char buf[BUF_SIZE];
362     FILE *fp;
363     char cwd[PATH_MAX];
364
365     /* Change our current working directory to that of the
366        crashing process */
367
368     snprintf(cwd, PATH_MAX, "/proc/%s/cwd", argv[1]);
369     chdir(cwd);
370
371     /* Write output to file "core.info" in that directory */
372
373     fp = fopen("core.info", "w+");
374     if (fp == NULL)
375         exit(EXIT_FAILURE);
376
377     /* Display command\-line arguments given to core_pattern
378        pipe program */
379
380     fprintf(fp, "argc=%d\\n", argc);
381     for (j = 0; j < argc; j++)
382         fprintf(fp, "argc[%d]=<%s>\\n", j, argv[j]);
383
384     /* Count bytes in standard input (the core dump) */
385
386     tot = 0;
387     while ((nread = read(STDIN_FILENO, buf, BUF_SIZE)) > 0)
388         tot += nread;
389     fprintf(fp, "Total bytes in core dump: %d\\n", tot);
390
391     exit(EXIT_SUCCESS);
392 }
393 .fi
394 .SH ´ØÏ¢¹àÌÜ
395 .BR bash (1),
396 .BR gdb (1),
397 .BR getrlimit (2),
398 .BR mmap (2),
399 .BR prctl (2),
400 .BR sigaction (2),
401 .BR elf (5),
402 .BR proc (5),
403 .BR pthreads (7),
404 .BR signal (7)