ϓϩϑΝΠϥͱ
w ϓϩάϥϜͷ͍෦Λಛఆ͢ΔͨΊͷπʔϧ
% perl -d:Profile program.pl
time elapsed (wall): 86.8212
time running program: 65.7657 (75.75%)
time profiling (est.): 21.0556 (24.25%)
number of calls: 647248
%Time Sec. #calls sec/call F name
31.74 20.8770 2306 0.009053 Configable::init_from_config
20.09 13.2116 144638 0.000091 Configable::init_field_from_config
17.49 11.5043 297997 0.000039 Configable::has_attr
8.22 5.4028 312 0.017317 MonEl::recycle
7.54 4.9570 64239 0.000077 Configable::inherit
5.02 3.3042 101289 0.000033 MonEl::unique
[...]
$PO
fi
HBCMFJOJU@GSPN@DPO
fi
HͰ
࣮ߦ࣌ؒͷΛͬͨ
ʢ͕͜͜ϘτϧωοΫ͔͠Εͳ͍ʣ
Slide 13
Slide 13 text
ϓϩϑΝΠϥ͍Ζ͍Ζ
w %FWFM1SP
fi
MF
%FWFM/:51SPG 1FSM
w QZTQZ 1ZUIPO
w QQSPG (P
w BTZODQSP
fi
MFS +BWB
w $ISPNF%FW5PPMT +BWB4DSJQU
w *OTUSVNFOUT 9DPEF
w QFSG -JOVY
Slide 14
Slide 14 text
झຯͰ3VCZϓϩϑΝΠϥΛ࡞͍ͬͯ·͢
HJUIVCDPNPTZPZVQG
w 3VCZͷ۱ʑ·Ͱਖ਼֬ʹ
ଌఆͰ͖Δ͜ͱΛΊ͟͢ϓϩϑ
ΝΠϥ
w 3VCZϑϨʔϜ
w $Ϩϕϧͷؔ
w ࠓ͜ͷͦΜͳʹ͋Γ·
ͤΜ
w 3VCZ,BJHJͷൃදΛݟͯ
Slide 15
Slide 15 text
ϏδϡΞϥΠζɺͰ͖·͢
εϨου͝ͱͷ༷ࢠͷ
τϥοΫ
ίʔϧπϦʔ
Flamegraph
Slide 16
Slide 16 text
Ͱ͖Ε͜͜ͰσϞΛ͍ͨ͠
Slide 17
Slide 17 text
ϓϩϑΝΠϥສೳͰͳ͍
'MBNFHSBQI͚ͩݟΕ͍͍ͬͯΜ͡Όͳ͍
w ສೳʹࢥ͑Δ'MBNFHSBQI͕ͩɺ
ݟམͱ͢͜ͱ݁ߏ͋Δ
w GFUDI@VTFS
ʹ͕͋Γͦ͏͕ͩ
͔Γ͘͢ग़ΔͱݶΒͳ͍
def a
u = fetch_user()
u.foo()
end
def b
u = fetch_user()
u.bar()
end
def c
u = fetch_user()
u.baz()
end
Slide 18
Slide 18 text
ʮܭଌʯ
Slide 19
Slide 19 text
ਓͳͥύϑΥʔϚϯεܭଌ͢Δͷ͔
w ؾ͕͍ͨͱ͖ʁ
w ࣗࣾͷ8FCαʔϏεͷಛఆͷΤϯυϙΠϯτ͕
͍͜ͱʹؾ͍ͮͨͱ͖ʁ
w ·ͬͨ͘Βͳ͍ίʔυϕʔεΛ͞Εɺ࣌ؒҎͷվળΛ໋͡ΒΕɺ
ສԁΛ͔͚ͯ૪͏ͱ͖ʁʢ݄ʣ
͍Ζ͍Ζ͋ͬͯɺਓͦΕͧΕ
Slide 20
Slide 20 text
ʮਪଌ͢ΔͳɺܭଌͤΑʯ
Slide 21
Slide 21 text
ʮਪଌ͢ΔͳɺܭଌͤΑʯ
w ͯͣͬΆ͏ͰͷύϑΥʔϚϯεվળΛռΊΔݴ༿
w ʮͳΜ͔͍͚Ͳɺଟ%#ͷΠϯσοΫε͕ෆͯ͠ΔΜͰ͠ΐʯ
w ʮ͜ͷลΛΩϟογϡ͢Ε͘ͳΔΑʯ
w ͜͏͍͏ͷΑ͘ͳ͍ΑͶ
w ͔ͩΒϓϩϑΝΠϥΛ͓͏Ͷɺͱ͍͏จ຺ͰΑ͘ొ͢Δ
Slide 22
Slide 22 text
Ͱʮܭଌʯ͢Ε͍͍ͷ͔ʁ
w ͑൱
w ͳΜͱͳ͘ϓϩϑΝΠϥΛೖΕͯɺͳΜͱͳ͘
fl
BNFHSBQIΛݟͯ
ͳΜͱͳ͘ॲཧ͕࣌ؒͦ͏ͳͱ͜ΖΛͬͯΈΔͷ
ʮͯͣͬΆ͏ͳվળʯʹଞͳΒͳ͍
w ֏Λ͍ͯ͠Δਓ͕དྷͨͱ͖ʹɺNͷλΠϜΛଌͬͯ͋·Γҙຯ͕ͳ͍
ͯͣͬΆ͏ͷվળແҙຯ͕ͩɺ
ͯͣͬΆ͏ͷܭଌʹҙຯ͕ͳ͍
Slide 23
Slide 23 text
ൃੜ ղܾ
ਪଌ ରԠ
ʘ΄Μͱʹ߹ͬͯΔ ʗ
ʮਪଌ͢Δʯ
Slide 24
Slide 24 text
ൃੜ ղܾ
ܭଌ ରԠ
ʘ͜Ε͕ݪҼͩʂʗ ຊʁ
ʮਪଌ͠ͳ͍Ͱɺܭଌ͢Δʯ
w ʮܭଌʯΛ͢Δ͚ͩͰɺͷਅҼ͕ಘΒΕΔͱ·ͬͨ͘ݶΒͳ͍
w ਅҼʹͨͲΓ͍͍ͭͯͳ͍ঢ়ଶͷʮରԠʯՁ͕͍
w ढज़ࣜύϑΥʔϚϯενϡʔχϯάͱݴ͑Α͏
ܭଌ͖͢ɺঢ়گͷதͰมԽͯ͠Ώ͘
w Λೝࣝͨ͠ॳظͷஈ֊ͰɺγϣοτΨϯతʜʜ
ͨ͘͞ΜͷࢦඪΛ֬ೝͯ͠ཧղΛܗ͢Δͷ͕༗ҙٛ
w ԾઆݕূͷதͰɺ࣍ʹܭଌ͖͢ରࣗͣͱܾ·ͬͯΏ͘
w ʢʜʜ͔ͱࢥ͍͖ɺͦ͏ͱݶΒͳ͍ʂʣ
Slide 41
Slide 41 text
ଘࡏ͢ΒΒͳ͍͜ͱௐΒΕͳ͍
w ্ͷίʔυԼͷίʔυͷഒ͍
w x[i][j]Λx[j][i]ʹ͢Δͱɺ
ଆͷྻ͕$16Ωϟογϡʹ
Βͳ͘ͳΔ
w ͜ΕʮܭଌʯͰൃݟՄೳͰ͋Δ
͕ɺʹೖͬͯ$16Ωϟογϡͷ
͜ͱΛΒͶվળͰ͖ͳ͍
int x[10000][10000];
for (i = 0; i < 10000; i++) {
for (j = 0; j < 10000; j++) {
puts(x[i][j]);
}
}
for (i = 0; i < 10000; i++) {
for (j = 0; j < 10000; j++) {
puts(x[j][i]);
}
}
͍͑ͭ༧֎ͷͱ͜Ζʹ͋Δ
༧Ͱ͖Δ͜ͱ༧͓ͯ͜͠͏
w 3PC1JLFઌੜͦ͏ड़͍ͯΔ 3VMFTPG1SPHSBNNJOH
w ϓϩάϥϜ͕Ͳ͜Ͱ࣌ؒΛফඅ͍ͯ͠Δ͔ΛͯΔ͜ͱ
͍͠ɻϘτϧωοΫ༧֎ͷͱ͜Ζʹ͋ΔͷͰɺ͍ॴΛಛఆͤͣ
ʹTQFFEIBDLΛೖΕΔ͜ͱ͢Δͳɻ
w ܭଌͷҧײʹؾ͖ͮ͘͢͢ΔͨΊʹɺ
ࣗͷίʔυϕʔε۱ʑ·ͰѲ͍͍ͯͨ͠
w ԿΛ͍ͯ͠Δͷ͔ʁԿͷͨΊʹ͍ͯ͠Δͷ͔ʁͲͷΑ͏ʹ͍ͯ͠Δͷ͔ʁ
࣌ؒͷܭଌ
def foo
start = Time.now
query("select *")
end = Time.now
elapsed = end - start
puts "query consumed #{elapsed}s"
end
Slide 51
Slide 51 text
࣌ؒͷܭଌ
def foo
start = Time.now
query("select *")
end = Time.now
elapsed = end - start
puts "query consumed #{elapsed}s"
end
w ճͷ࣮ߦͰ͍͍ͷʁ
w ͨ·ͨ·֎෦ͷӨڹ͕େ͖͍͔
͠Εͳ͍
w 5JNFOPXϞϊτχοΫ͡Όͳ͍
w RVFSZதʹݱࡏ࣌ࠁ͕มߋ͞Ε
ͨΒόάΔ
w ($(7-֫ಘͪRVFSZʹܭ
্͞Εͯ͠·͏
w ԿΑΓɺ͋ΒΏΔॴʹ͜ΕΛ
ࠐΉͷݱ࣮త͡Όͳ͍
Slide 52
Slide 52 text
ͦͦʮ࣌ؒʯʹ͍Ζ͍Ζ͋Δ
w ࣮࣌ؒ $-0$,@3&"-5*.&
w զʑ͕ೝ͍ࣝͯ͠Δʮ࣌ؒʯ
w ୯ௐ૿Ճͳ࣮࣌ؒ $-0$,@.0/050/*$
w γεςϜ͕ىಈ͔ͯ͠Βͷ࣌ؒʜʜͳͲ
w ר͖Βͳ͍
w $16࣌ؒ $-0$,@130$&44@$165*.&@*%
w $16͕ܭࢉΛߦ͍ͬͯͨ࣌ؒ
w *0 σΟεΫωοτϫʔΫ
ͷ࣌ؒআ͘
def foo
query("select *")
end
Slide 53
Slide 53 text
࣌ؒΛଌΔͷ͍͠
w ϢʔβʔϥϯυͰଌΕͳ͍छྨͷ࣌ؒ͋
Δ
w ʮ$16࣌ؒʯΧʔωϧͷΈ͕ΓಘΔ
w ϢʔβʔϥϯυͰVTFSͱJPXBJUΛ۠ผ
Ͱ͖ͳ͍
w εϨου QUISFBE
͝ͱʹͳΔͱঘߋ
w "͔Β#ͷ࣌ؒܭΕͯɺ
ʮNTඵ͝ͱʹλΠϚʔΛಈ͔͢ʯ࣮ݱ
Ͱ͖ͳ͍
w ׂΓࠐΈͰ͖ͳ͍ͱ͍͚ͳ͍
struct sigevent sigevent = {
.sigev_notify = SIGEV_THREAD_ID;
.sigev_signo = SIGPROF;
};
struct itimerspec timer = {
.it_interval = {
.tv_sec = 0;
.tv_nsec = 1000000; // 10 ms
}; ...
};
timer_create(CLOCK_MONOTONIC,
&sigevent, &timer)
Slide 54
Slide 54 text
ϓϩϑΝΠϥͷΈ ؆ུ൛
w ϓϩϑΝΠϥͷࣄʮҰఆ࣌ؒ͝ͱʹʯʮϓϩάϥϜ͕ԿΛͬͯΔ͔ʯ
ऩू͢Δ͜ͱ
Slide 55
Slide 55 text
ਤղɿγάφϧϋϯυϥΛͬͨεέδϡʔϦϯά
0ms 10ms 20ms 30ms
Thread 1
Thread 2
ΧʔωϧλΠϚʔʹΑΔׂΓࠐΈ
Using CPU
Using CPU Using CPU
γάφϧϋϯυϥ
࣮ߦதͷελοΫΛݴޠ VM or Χʔωϧ ʹΫΤϦ
ετϨʔδʹऔಘɾه
γάφϧϋϯυϥ
ΧʔωϧׂΓࠐΈ
Slide 56
Slide 56 text
࣌ؒͰͳ͘ɺϝϞϦͳΒͲ͏͔ʁ
w ϓϩηεશମͰͲͷΑ͏ʹϝϞϦΛ͍ͬͯΔ͔
ܭଌ͢ΔʹͲ͏͢Δ͔ʁ
w FH͜ͷछྨͷΦϒδΣΫτ͕ଟ͍Α͏ͩ
w 3VCZͷΑ͏ʹɺ7.ܕͷݴޠͳΒ7.ͰهͰ͖Δ
w ͦ͏Ͱͳ͚ΕɺΞϩέʔλ NBMMPD
ʹࠐΈ͕ඞཁʹͳΔ
w ʮܭଌʯ͢ΔͨΊʹɺԼͷϨΠϠͷࠐΈ͕ඞཁ
Slide 57
Slide 57 text
ϝϞϦϨΠςϯγʁ
w ϝϞϦʹΞΫηεͨ͠ͱ͖ͷϨΠςϯγ
w ͜ΕΞϓϦέʔγϣϯϨΠϠͰຊʹऔΓΑ͏͕ͳ͍
w $16͜͏͍͏͜ͱܭଌͰ͖ΔΑ͏ύϑΥʔϚϯεΧϯλΛඋ͍͑ͯΔ
ʮܭଌʯϨΠϠʔΛ·͙ͨܳज़
w ͋Δͷ͜ͱΛਫ਼៛ʹΔͨΊʹɺΑΓԼʹજΔʜʜ
w ਂ͘ɺਂ͘ʜʜ
w ͜͏͍ͬͨςΫχοΫͷΈ߹ΘͤͰܭଌπʔϧ࡞ΒΕ͍ͯΔ
Slide 62
Slide 62 text
ܭଌ
ԿΛܭଌ͢Δ͔
ͲͷΑ͏ʹܭଌ͢Δ͔
݁ՌΛͲ͏ධՁ͢Δ͔
Slide 63
Slide 63 text
ܭଌ
͍ͭܭଌ͢Δ͔
ԿΛܭଌ͢Δ͔
ͲͷΑ͏ʹܭଌ͢Δ͔
݁ՌΛͲ͏ධՁ͢Δ͔
ηοτ
Slide 64
Slide 64 text
ʮ͍ͭʯܭଌ͢Δ͔ɺͦͯ͠Ͳ͏ධՁ͢Δ͔
w ͜͜·Ͱɺ͕͋Δ߹ʹɺ͍͔ʹʮܭଌʯͯ͠
ݪҼʹഭΔ͔ͷΛ͖ͯͨ͠
w ͔͠͠ɺͦΕΛʮ͍ͭʯߦ͏͖͔ʁ
w ܭଌπʔϧɾϓϩϑΝΠϥ͜ͷࣔࠦΛ༩͑ͯ͘Εͳ͍
Slide 65
Slide 65 text
ʮ͍ͭʯΛओ؍ʹґଘͤ͞ͳ͍
w ʮͳΜ͔͍ʯΛओ؍Ͱஅ͢Δͱɺج४͕ϒϨΔ
w *46$0/ͰৗʹܭଌΛഭΒΕΔͷɺ
ৗʹʮͳΜ͔͍ʯঢ়ଶͰ͋ΔԾఆ͕͓͔ΕΔ͔Β
w γεςϜͷॏཁͳύϑΥʔϚϯεࢦඪΛࣄલʹఆٛͯ͠ΈΑ͏
Slide 66
Slide 66 text
ओ؍ʹґଘ͠ͳ͍ఆٛ
w γεςϜͷύϑΥʔϚϯεϨϕϧͷඪΛఆٛ͢Δ
w ϫʔΫϩʔυͷੑ࣭͔Βఆٛ͢Δɿܾࡁ·Ͱͷ౸ୡ
w γεςϜϝτϦΫε͔Βఆٛ͢Δɿ$16༻͕OҎԼ
w TPPO4-04-*
Slide 67
Slide 67 text
ϝτϦΫεɺ͋Δ͍ͦͷઌ
w ϝτϦΫεʮ͍͔ͭΒʯ
ʮ͍ͭ·Ͱʯͷఆٛʹ͍͍͢
w FHʮϨεϙϯελΠϜͷQ͕
NTΛ͍͑ͯͳ͍ঢ়ଶΛਖ਼ৗ
ͱ͢Δʯ
Slide 68
Slide 68 text
ϝτϦΫεɺ͋Δ͍ͦͷઌ
w ϝτϦΫεʮ͍͔ͭΒʯ
ʮ͍ͭ·Ͱʯͷఆٛʹ͍͍͢
w FHʮϨεϙϯελΠϜͷQ͕
NTΛ͍͑ͯͳ͍ঢ়ଶΛਖ਼ৗ
ͱ͢Δʯ
͜ΕͬͯܭଌͰʁ
Slide 69
Slide 69 text
ৗʹʮܭଌʯ͍ͯ͠Δ͜ͱͷՁ
w /FX3FMJD%BUBEPHͳͲͷ"1.ɺ
ʮৗʹʯܭଌ͍ͯ͠Δ͜ͱ͕࠷େͷՁ
w ͜ͷจ຺Ͱ$POUJOVPVT1SP
fi
MJOHͳͲۙ
ൃలΛݟ͍ͤͯΔ
w 1ZSPTDPQFFUD
w ࠓ·ͰʮॏްʯͳιϦϡʔγϣϯͩͬͨϓϩϑΝΠϦϯάΛ
ϞχλϦϯάͷΑ͏ʹ͑Δͱ͍͍͔͠Ε·ͤΜͶ
Slide 70
Slide 70 text
࠷ޙʹ
w ύϑΥʔϚϯεվળɺਖ਼͍͠ࢹΛ୳͢͜ͱ
w ਪଌ͢Δ͖ͩ͠ɺܭଌ͢Δ͖
w ଟ͘ͷࢹΛ࣋ͯΔͱɺଟ͘ͷਪଌ͕Ͱ͖Δ
w ଟ͘ͷਪଌ͕Ͱ͖Δͱɺਖ਼͍͠ԾઆʹͨͲΓண͚ΔՄೳੑ͕ߴ͘ͳΔ
w ͻͱͭͷ͜ͱʹৄ͍͚ͩ͠Ͱউͯͳ͍ɻશ෦Ζ͏ͱ͢Δͱ໘ന͍
Slide 71
Slide 71 text
ʮܭଌʯ৺ҙؾ͚ͩͰͲ͏ʹͳΒͳ͍
ͯ͢ΛΔؾ࣋ͪͰ͍ͬͯ͘
Slide 72
Slide 72 text
PTZPZVc:"1$)BLPEBUF
ϓϩϑΝΠϥ։ൃऀͱݟΔ
ʮਪଌ͢ΔͳɺܭଌͤΑʯ
Slide 73
Slide 73 text
No content
Slide 74
Slide 74 text
No content
Slide 75
Slide 75 text
%BJTVLF"SJUPNP PTZPZV
ϓϩϑΝΠϥ࡞ऀͷۤ
Slide 76
Slide 76 text
ຊฤͰ͢
͜ΕΛͨ͢ΊʹੵΈॏͶ͖ͯͨ
w ຊฤͰ͢
Slide 77
Slide 77 text
QQ!PTZPZV
w ͜Μʹͪʂ
w גࣜձࣾεϚʔτόϯΫۈ
w 3VCZ͍͖ͩ͢
ࢀՃऀʂൃදऀʂεϙϯαʔʂ
શ෦ืूதʂ
Slide 78
Slide 78 text
ʮܭଌͤΑʯਓͦ͏ݴ͏͚ΕͲʜʜ
Slide 79
Slide 79 text
ਖ਼͍͠ʮܭଌʯπʔϧ࡞Δͷɺ
ͱ͍ͬͬͬͬͬͬͬͯ͠ʂʂʂʂʂʂ
Slide 80
Slide 80 text
ϓϩϑΝΠϥ͕ύϑΥʔϚϯεΛΊΔ
͜ΕΑ͘ΒΕ͍ͯ·͢Ͷ
w ϓϩϑΝΠϥΛڬΉͱɺॲཧ͕૿͑Δ
w ͜ΕݪཧతʹճආෆՄೳ
w ॲཧ͕૿͑Δͱɺܭଌ͕ΊΒΕΔ
w LOPXOBT؍ऀޮՌ
Slide 81
Slide 81 text
؍ऀޮՌͱ͖߹͏
w ਖ਼֬Ͱ͋ΔͨΊʹใΛͨ͘͞ΜूΊ͍ͨ
w ใΛͨ͘͞ΜूΊΔͱΦʔόʔϔου͕େ͖͘ͳΓɺਖ਼֬Ͱͳ͘ͳΔ
w ࠔͬͨʜʜɻ
Slide 82
Slide 82 text
ͪΌΜͱʮܭଌʯ͠Α͏
w ϓϩϑΝΠϥΛಋೖͨ࣌͠ͷύϑΥʔϚϯεԼΛ
ϕϯνϚʔΫ͢Δ
w ඪΛઃఆ্ͨ͠Ͱ
w ୯ͳΔBWFSBHFϕʔεͷධՁͰͳ͘
w Ծઆݕఆ Uݕఆ
ͯ͠ΈΔ
Slide 83
Slide 83 text
ඪPWFSIFBEҎ
w ϓϩϑΝΠϥΛೖΕͯɺϓϩάϥϜ͕Ҏ্͘ͳΒͳ͍
w ଟେৎ
w 1GϓϩάϥϜΛҎ্͘͠·ͤΜ
Slide 84
Slide 84 text
ଞʹ͜ΜͳΈ͕
w ଟ͘ͷύϑΥʔϚϯεπʔϧ୯ҰͷతͷͨΊʹ࡞ΒΕ͍ͯΔ
w TUSBDF
JPTUBU
GSFF
TBS
UPQ
w UPQͱ͔ͦ͏Ͱͳ͍͔
w ϓϩϑΝΠϥɺԿΛٻΊΒΕ͍ͯΔ͔͔Βͳ͍ʂʂʂ
Slide 85
Slide 85 text
͜ͷεϥΠυɺ֮͑ͯ·͔͢
Slide 86
Slide 86 text
͜ͷεϥΠυɺ֮͑ͯ·͔͢
Ռͨͯ͜͠ΕͰྑ͍ͷͩΖ͏͔ʜʜ
Slide 87
Slide 87 text
ϓϩϑΝΠϥ͙͢ΕͨܭଌύοέʔδͰ͋Δ͖
ͦ͏৴͍ͯ͡·͢
w ʮܭଌʯʹؔ͢Δൣͳ͕ࣝͳ͍ਓͰ
w ͱΓ͋͑ͣΠϯετʔϧ͢Ε
w ϓϩάϥϜͷ࣮ߦʹؔ͢Δྑ͍ࣔࠦΛ༩͑ͯ͘ΕΔπʔϧͰ͋ͬͯ΄͍͠
w ʮ͋͊ɺ($ͷ͜ͱؾʹ͠ͳ͍ͱ͍͚ͳ͍Μͩʯ
w ʮ͋͊ɺ3VCZͰෳͷεϨουಉ࣌ʹಈ࡞Ͱ͖ͳ͍Μͩʯ
w 6OLOPXO6OLOPXOTΛͳ͘͢πʔϧʹͳΓ͍ͨ
Slide 88
Slide 88 text
ԶͳʹΛσϑΥϧτʹ͢Εʜʜ
w 'MBNFHSBQIΛग़͢ͷ͕͍͍ͷ͔ʁ
w 'MBNFHSBQI͕ສೳͰͳ͍͜ͱ͍ͬͯΔʜʜ
w ϝιουҰཡΛදࣔ͢Δͱ͖ɺݺͼग़͠ճͱ૯࣮ߦ࣌ؒͷ
ͲͪΒͰιʔτ͓͖ͯ͘͠ʁ
w ͲͪΒ͕༗ҙ͔ٛ߹ʹΑͬͯҧ͏ʜʜ
Slide 89
Slide 89 text
ԶͳʹΛσϑΥϧτʹ͢Εʜʜ
w 'MBNFHSBQIΛग़͢ͷ͕͍͍ͷ͔ʁ
w 'MBNFHSBQI͕ສೳͰͳ͍͜ͱ͍ͬͯΔʜʜ
w ϝιουҰཡΛදࣔ͢Δͱ͖ɺݺͼग़͠ճͱ૯࣮ߦ࣌ؒͷ
ͲͪΒͰιʔτ͓͖ͯ͘͠ʁ
w ͲͪΒ͕༗ҙ͔ٛ߹ʹΑͬͯҧ͏ʜʜ
🙃
Slide 90
Slide 90 text
͜ͷεϥΠυɺ֮͑ͯ·͔͢
Slide 91
Slide 91 text
ͭ·Γ3VCZϓϩϑΝΠϥ3VCZͰ࡞Εͳ͍
িܸͷਅ࣮
w 3VCZͰ3VCZͷ͜ͱΛ۱ʑ·ͰΔ͜ͱͰ͖ͳ͍͔Βʜʜ
w ࠷ݶ7.ͷڠྗ͍Δ
w ʮ͍·ԿΛ࣮ߦͯ͠ΔʁʯΛશʹѲͰ͖Δͷ7.͚ͩ
w
Slide 92
Slide 92 text
ͭ·Γ$Ͱ࣮͢Δ͜ͱʹ
w ݁ہ3VCZͷ͜ͱΛΔͨΊʹɺ$3VCZॲཧܥͷϨϕϧʹ߱Γͯ
$Λॻ͘͜ͱʹͳ͍ͬͯΔ
w ࣮ࡍ3VTUΛͬͯ·͕͢
w Ͳ͏ͯ͠ʜʜ
w $ࣗͷϓϩϑΝΠϧͰࣄมΘΒͳ͍ɻQFSGͭԼͷϨΠϠʔʹ
͋ͨΔ-JOVYΧʔωϧͷػೳͱ࣮ͯ͠͞Ε͍ͯΔ
Slide 93
Slide 93 text
ϓϩϑΝΠϥͷਖ਼͠͞ͷอূ
w ϓϩϑΝΠϥΛ࡞Γ·͢
w ͦΕͬΆ͍݁Ռ͕ग़·͢
w ͓͓ɺͳΜ͔ɺͦΕͬΆ͍ʜʜ
w ͦΕͬΆ͍͕ʜʜ
w ͜Εͬͯɺຊʹɺਖ਼͍͠ʁ
Slide 94
Slide 94 text
"ਖ਼͘͠ͳ͍
ݱ࣮ඇͰ͋Δ
w ϓϩϑΝΠϥݪཧతʹඇܾఆత
w ͋ΔϓϩάϥϜͷϓϩϑΝΠϧ݁Ռ͕
ʮਖ਼͍͠ʯ͔Λςετ͢Δͷࠔ
w ࣮ࡍɺΊͪΌͪ͘ΌόάΔ͠ɺͦΕʹ
ؾ͚ͳ͍
w ͩͬͯ
fl
BNFHSBQIͷܗͯ͠Δ͠
Slide 95
Slide 95 text
Θͨ͘͠ͷ߹
w ଞͷϓϩϑΝΠϥͱ͑߹ΘͤΛ͍ͯ͠Δ
w ·ͬͨ͘ํࣜͷҧ͏ϓϩϑΝΠϥɺ۩ମతʹQFSGͱൺֱ͍ͯ͠Δ
w ͱͯۤ௧Ͱ͋Δ
Slide 96
Slide 96 text
QFSGͰऔΕΔελοΫ
$ϨϕϧͷελοΫ
rb_hash_new()
rb_vm_exec()
vm_exec_core()
rb_main()
main()
__libc_start_main()
1GͰऔΕΔελοΫ
3VCZϨϕϧͷελοΫ
Hash#new()
foo()
w ͨΓલ͕ͩɺશવରԠ͠ͳ͍
w ؤுͬͯࢹ͢ΔͳΓɺ؆୯ͳεΫϦϓτΛ
ॻ͍ͨΓ
w ιΛ͔ͭͳ͍ϓϩϑΝΠϥͷಓԕ͍
Slide 97
Slide 97 text
ۤ͋Δ͕ɺͦΕͰɺ໘ന͍
w ϓϩϑΝΠϥΛ࡞Δͱɺීஈ͔͍ͭͬͯΔݴޠγεςϜͷཧղ͕
͘͢͝ਂ·Δ
w ΕΔ΄ͲɺΒͳ͍͜ͱ͕૿͍͑ͯ͘
w 1GΛ࡞Γ࢝Ίͨ͜ͱͰɺ$3VCZͷ͜ͱʹৄ͘͠ͳͬͨɺͱࢥ͏
Slide 98
Slide 98 text
ύϑΥʔϚϯεΤϯδχΞϦϯά
w ίϯϐϡʔλʹؔ͢ΔൣͳࣝΛࢼ͞ΕΔ
w ͜Ε΄Ͳ໘ന͍ͳ͍
w νϡʔχϯά͕όονϦܾ·Δͱؾ࣋ͪྑ͍
Slide 99
Slide 99 text
ʮૣ͗͢Δ࠷దԽॾѱͷࠜݯʯ
ͱݴ͏ͷͷ
Slide 100
Slide 100 text
ʮૣ͗͢Δ࠷దԽॾѱͷࠜݯʯ
ͱݴ͏ͷͷ
w ͍͜ͱ͍͍͜ͱ
w ࠷దԽ͍ํ͕͍͍ͷͰʁ
w ͘࠷దԽ͖ͯ͠·͠ΐ͏