PHPのマニュアルにないことをしてphp-srcへバグ報告をした

 PHPのマニュアルにないことをしてphp-srcへバグ報告をした

マニュアルにないことをするとどうなるのか、どうなったのか、
そしてSegfaultが発生してバグを報告したという内容を共有します。

D5c60d3b90d3e0ad0c190adb197e45d1?s=128

てきめん tekimen

March 31, 2019
Tweet

Transcript

  1. 1)1ͷόάΛݟ͚ͭͨ ϚχϡΞϧʹͳ͍Ҿ਺ೖΕΔͱͲ͏ͳΔͰ͠ΐ͏

  2. ࣗݾ঺հ w͖ͯΊΜ w IUUQTUFLJUPINFNEIPJJOGP
 Α͘͜͜Ͱௐ΂෺ॻ͍ͯΔ w IUUQTUXJUUFSDPNZPVLJEFBSJUBJ

  3. ཁ໿ w 1)1ͷϏϧτΠϯؔ਺ͷҾ਺Λؒҧ͑Δ w NCTUSJOHؔ਺ͷ1)1ͱʙɺҎ߱ͷҧ͍ w QIQTSD NCTUSJOH ͷόάΛใࠂͨ͠ ใࠂΛͨ͜͠ͱ͕ΩϞͰ͸͋Δ͚Ͳɺ

    ͦΕΛઆ໌͢Δͷʹ্ͭͷઆ໌͕ඞཁͩͬͨ
  4. Ҿ਺ͷσʔλܕΛؒҧ͑Δͱ /6--͕ฦΔ w IUUQTXXXQIQOFUNBOVBMKB GVODUJPOTJOUFSOBMQIQ w ͭ·Γɺ/6--ͷ͜ͱ͕ଟ͍͚Ͳɺ/6--Ͱͳ͍͔΋͠Ε ͳ͍

  5. ྫTUSMFO Ҿ਺ʹTUSJOHΛཁٻ͞Ε͍ͯΔ ฦΓ஋͸JOU͕ฦͬͯ͘Δ

  6. ྫNC@TUSMFO Ҿ਺ʹTUSJOHΛཁٻ͞Ε͍ͯΔ ฦΓ஋͸JOU͕ฦͬͯ͘Δ FODPEJOH͕͓͔͍͠ͱ'"-4&

  7. ྫTUSMFOͱNC@TUSMFO ͭͷؔ਺ʹɺීஈೖΕͳ͍Α͏ͳ஋΋ Ҿ਺ʹͱͬͯΈΔ

  8. ྫTUSMFOͱNC@TUSMFO 1)1·Ͱ͸BSSBZ΍PCKFDUͳͲΛҾ਺ʹऔΔͱ TUSMFO͸/6--ʹͳΔ͕ɺNC@TUSMFO͸GBMTFʹͳΔ

  9. ༨ஊͰ͕͢ ݹ͍1)1 ʙ Ͱ͸ TUSMFO BSSBZ ΍TUSMFO OFXTUE$MBTT  ͰJOU͕ฦΔ

    l"SSBZz΍l0CKFDUzͱ͍͏จࣈྻʹม׵͞ΕͯҾ਺ͱͳΔ ˠTUSMFO l"SSBZz TUSMFO l0CKFDUz ͱಉ͡
  10. ͜͜·Ͱͷ·ͱΊ w ϚχϡΞϧʹͳ͍ࣄ͢ΔͱɺະఆٛͷڍಈʹͳΔ w TUSJOH͕ཁٻ͞ΕͯΔͱ͜ΖʹBSSBZೖΕͨΓ͢Δͱ/6-- ͕ฦͬͯ͘Δɻؔ਺ͷϚχϡΞϧʹͳͯ͘΋/6-- w NCTUSJOHؔ਺͸1)1·ͰGBMTFΛͣͬͱฦͯͨ͠

  11. ཁ໿ w 1)1ͷϏϧτΠϯؔ਺ͷҾ਺Λؒҧ͑Δ w NCTUSJOHؔ਺ͷ1)1ͱʙɺҎ߱ͷҧ͍ w QIQTSD NCTUSJOH ͷόάΛใࠂͨ͠

  12. ྫTUSMFOͱNC@TUSMFO 1)1·Ͱ͸BSSBZ΍PCKFDUͳͲΛҾ਺ʹऔΔͱ TUSMFO͸/6--ʹͳΔ͕ɺNC@TUSMFO͸GBMTFʹͳΔ 1)1Ҏ߱͸Ͳ͏ͳͬͨͷ

  13. ྫTUSMFOͱNC@TUSMFO 1)1͔Β͸/6--ʹͳΓ·ͨ͠ɻ

  14. NCTUSJOHͷ໭Γ஋͕/6-- w IUUQTHJUIVCDPNQIQQIQTSDDPNNJU DCGBGCDECDECBFE Ͱೖͬͨ w NCTUSJOHؔ਺ͷGBMTF͕/6--ʹվΊΒΕͨ

  15. NCTUSJOHͷ໭Γ஋͕/6-- w IUUQTHJUIVCDPNQIQQIQTSDDPNNJU DCGBGCDECDECBFE Ͱೖͬͨ w NCTUSJOHؔ਺ͷGBMTF͕/6--ʹվΊΒΕͨ NCTUSJOHશ෦ͦ͏ͳͷ͔ͳʁ

  16. ௐ΂ͯΈΑ͏ ͦ͏ࢥͬͨͷ͕೥݄Ͱͨ͠ 1)13$͕࠷৽ͩͬͨ

  17. શ෦/6--ͳͷ͔ௐ΂Δ ͜ͷϓϩάϥϜΛಈ͔͢ͱͦΕͧΕ/6--ͷ͸ͣ

  18. શ෦/6--ͳͷ͔ௐ΂Δ ͓͜ͱΘΓɿ1)13$͸WMPSHͰ ࢖͑ͳ͘ͳͬͯͨͷͰɺଞͷόάͰ࠶ݱͯ͠·͢ɻ ʮଞͷόάʯIUUQTCVHTQIQOFUCVHQIQ JE Ͱमਖ਼͞Εͨ 1SPDFTTFYJUFEXJUIDPEF

  19. ίϯύΠϧ͢Δ w 1)13$ͷιʔεΛμ΢ϯϩʔυ͢Δ͔HJUϦϙδ τϦ͋Ε͹͔ͦ͜ΒDIFDLPVUͯ͠औͬͯ͘Δ w IUUQTHJUIVCDPNQIQQIQTSDSFMFBTFTUBH QIQ3$ w ࢲ͕࠶ݱͨ͠ͱ͖ͷίϯύΠϧΦϓγϣϯ DPOpHVSFŠFOBCMFNCTUSJOHŠFOBCMFEFCVHŠEJTBCMFBMM

  20. Μʁ

  21. None
  22. 1SPDFTTFYJUFEXJUIDPEF ͱ͸ For the shell's purposes, a command which exits

    with a zero exit status has succeeded. An exit status of zero indicates success. A non-zero exit status indicates failure. When a command terminates on a fatal signal N, bash uses the value of 128+N as the exit status. NBOCBTIΑΓ ਖ਼ৗʹऴྃ͠ͳ͔ͬͨͱ͖ɺCBTI͸ /Λग़͢ /͸ͱͳΔ
  23. 1SPDFTTFYJUFEXJUIDPEF ͱ͸ SIGKILL 9 Term Kill signal SIGSEGV 11 Core

    Invalid memory reference SIGPIPE 13 Term Broken pipe: write to pipe with no readers NBOTJHOBMΑΓ ͱ͍͏ͷ͸4*(4&(7ɺͭ·Γ4FHNFOUBUJPO'BVMU
  24. 4FHNFOUBUJPO'BVMU NC@DPOWFSU@LBOB·Ͱ͸ಈ͍ͨ

  25. όάΛݟ͚ͭΔ w NC@DPOWFSU@LBOB·Ͱಈ͍ͯͨ w ࣍ͷNC@DIFDL@FODPEJOH͔ͳʁ

  26. όάΛݟ͚ͭͨ όάʹͳΔ࠷খͷίʔυΛൃݟͨ͠

  27. ·ͣམͪண͍ͯ֬ೝ͢Δ w 1)13$ͰNC@DIFDL@FODPEJOHͰBSSBZ ΛೖΕ ͨΒ4FHNFOUBUJPOGBVMU w ଞͷόʔδϣϯͰ͸࠶ݱ͠ͳ͍͜ͱ͸WMͰ֬ೝࡁΈ w BSSBZ ͸ۭͷBSSBZ͕ͩɺۭͰ͸ͳ͍BSSBZΛ֬ೝͯ͠

    ͳ͍
  28. ཁ໿ w 1)1ͷϏϧτΠϯؔ਺ͷҾ਺Λؒҧ͑Δ w NCTUSJOHؔ਺ͷ1)1ͱʙɺҎ߱ͷҧ͍ w ใࠂͨ͠

  29. ใࠂΛ͠Α͏ ͋ͳ͕ͨͦͷόάΛใࠂ͠ͳ͍ݶΓɺ 1)1ͷ։ൃऀ͕ͦͷόάΛ஌Δ͜ͱ͸ڪΒ͘ͳ͍ όάใࠂͷ࢓ํΛಡ΋͏

  30. ใࠂΛ͠Α͏ ͋ͳ͕ͨͦͷόάΛใࠂ͠ͳ͍ݶΓɺ 1)1ͷ։ൃऀ͕ͦͷόάΛ஌Δ͜ͱ͸ڪΒ͘ͳ͍ όάใࠂͷ࢓ํΛಡ΋͏

  31. w 5IFCBTJDTXIBUZPVEJE XIBUZPVXBOUFEUPIBQQFO BOEXIBUBDUVBMMZIBQQFOFE
 جຊ͋ͳ͕ͨԿΛͯ͠ɺԿΛ๬ΜͰͯɺͦ͏ͳͬͨͷ͔ w "MXBZTTFBSDIBCVHEBUBCBTFpSTU
 ࠷ॳʹόάͷσʔλϕʔε୳͍ͯͩ͘͠͞ w *GZPVVOEFSTUBOEFSSPSNFTTBHF

    BTLGPSIFMQ
 ΤϥʔϝοηʔδΛཧղͰ͖ͳ͍ͳΒɺॿ͚ΛݺΜͰ͍ͩ͘͞ʢ͜͜Ͱ͸ͳ͍ʣ w #FCSJFG CVUEPO`UMFBWFBOZJNQPSUBOUEFUBJMTPVU
 ୹͘؆ܿʹɺ͔͠͠ॏཁͳ͜ͱ͸ൈ͔͞ͳ͍Ͱ͍ͩ͘͞ w 6TF&OHMJTI w %PO`USFQPSUCVHTBCPVUPMEWFSTJPOT
 ݹ͍όʔδϣϯͷόάΛใࠂ͠ͳ͍Ͱ͍ͩ͘͞ w 0OMZSFQPSUPOFQSPCMFNJOFBDICVHSFQPSU
 ҰͭͷόάʹҰͭͷใࠂΛॻ͍͍ͯͩ͘͞
  32. ӳޠ͸Ͱ͖Δ΂͖͕ͩ w .Z&OHMJTIJTQPPS w 1)1ͷCVHΛใࠂ͢Δ৔ɻӳޠͷΫΦϦςΟΑΓɺ1)1 ͷίʔυΛࣔͯ͠ɺ&YQFDUFE"DUVBMΛࣔͤ͹͖ͬͱΘ ͔ͬͯ͘ΕΔʢ͸ͣʣ w ใࠂ͢Δ͜ͱ͕େࣄɺߩݙ͢Δͱ͍͏ؾ͕࣋ͪେࣄ w

    ؾΛ࢖ΘͤΔ͚ͩͰ͸ਃ͠༁ͳ͍ͷͰɺӳޠΛษڧ͠ͳ͍ ͱ͍͚ͳ͍ͳͱ͸ࢥ͏ɻ
  33. όάΛใࠂ͢ΔϖʔδCVHTQIQOFU

  34. ӈ্ͷHPUPCVHJEPSTFBSDICVHTGPSΛ࢖ͬͯ NC@DIFDL@FODPEJOHͱ͔4FHNFOUBUJPOGBVMUΛௐ ΂Δ ࣅͨΑ͏ͳใࠂ͸ͳ͔ͬͨ

  35. None
  36. w 1)1WFSTJPO1)13$ w 1BDLBHFB⒎FDUFE(FOFSBM*TTVFT 3FQSPEVDJCMF DSBTI w #VHUZQF#VH w 0QFSBUJOHTZTUFN-JOVY

    w 4VNNBSZ 5FTU4DSJQU "DUVBMSFTVMU &YQFDUFESFTVMU ͕ॏཁ
  37. 4VNNBSZ w ؆ܿʹจͰΘ͔ΔΑ͏ͳจষΛॻ͘Α͏౒ΊΔ w όάΛߏ੒͢ΔཁૉNC@DIFDL@FODPEJOH DSBTI 4FHNFOUBUJPO GBVMU 4FHGBVMU 4&(7ʜ

    BSHVNFOU BSSBZ w NC@DIFDL@FODPEJOHͳͷ͔ʁ w DSBTIͰ௨͡Δ͔ʁ w BSHVNFOU͸Ҿ਺͕ͩɺͲͷҾ਺͔ʁ w BSSBZʹ΋ཁૉͷ͋ΔBSSBZͱແ͍BSSBZͱ͕͋Δ͕ɺ྆ํௐ΂͔ͨʁ
  38. 4VNNBSZͷจষͷ֬ೝ w όάΛߏ੒͢ΔཁૉNC@DIFDL@FODPEJOH DSBTI BSHVNFOU BSSBZ w DSBTIͰ௨͡Δ͔ʁ w ଞͷ4FHNFOUBUJPOGBVMUͷνέοτΛಡΜͰΈ͕ͨɺ໰୊ͳ͍Α͏ͩ

    w BSHVNFOU͸Ҿ਺͕ͩɺͲͷҾ਺͔ʁ w ࠷ॳͷҾ਺ͰҾ͖ى͜͞ΕΔɻୈೋҾ਺ͷFODPEJOHͰ͸ى͜Βͳ͔ͬͨ w BSSBZʹ΋ཁૉͷ͋ΔBSSBZͱແ͍BSSBZͱ͕͋Δ͕ɺ྆ํௐ΂͔ͨʁ w ۭͰ͸ͳ͍BSSBZ l΄͛z ͳͲΛௐ΂ͨΒɺ௨ৗऴྃͨ͠ͷͰɺۭͷBSSBZ ͷͱ͖ͷΈى͜Δ
  39. 4VNNBSZͷจষͷߏங w ཁૉΛվΊΔNC@DIFDL@FODPEJOH DSBTI pSTU BSHVNFOU FNQUZBSSBZ w NC@DIFDL@FODPEJOH DSBTIFTXIFOpSTUBSHVNFOU

    JTBOFNQUZBSSBZͱͨ͠
  40. %FTDSJQUJPO w ࢲ΋ӳޠ͕ಘҙͰͳ͍ͷͰɺଞͷνέοτΛࢀߟʹͯ͠ॻ ͍ͨɻ w WMPSHͰ΋࠶ݱͰ͖ͨͱ͍͏จষ͕ॻ͖͔ͨͬͨ

  41. &YQFDUFESFTVMU w ຊདྷਖ਼͍͠ڍಈ͸ͲΕʹͳΔͷ͔ͱ͍͏ͷΛ౴͑Δɻ1)1 ͷ݁ՌΛฦͤ͹͍͍ͷͰܦݧଇʢຊεϥΠυલ൒෦෼ʣ্ /6--ͱ͓ͯ͠͠·͍ʜͱࢥ͍͖΍ w WMͷ݁ՌΛݟͯΈ·͠ΐ͏

  42. 1)1·Ͱ͸/6--Λฦ͍ͯ͠Δͷʹɺ 1)1͔Β͸CPPM USVF ͱͳͬͯΔ

  43. 1)1ͷ$IBOHFMPHʹॻ͍ͯ͋ͬͨ

  44. &YQFDUFESFTVMU w ϚχϡΞϧʹͳ͘ɺ$IBOHFMPHʹ"EEFEBSSBZTVQQPSU UPNC@DIFDL@FODPEJOH͕͋ͬͨɻ w ݁Ռɺ͜ͷཝʹ͸CPPM USVF ͕ೖΔ

  45. "DUVBMSFTVMU w 4FHNFOUBUJPOGBVMUͱೖྗͨ͠

  46. ૹ৴ w 1SFWJFXΛԿ౓͔ԡͯ͠ࢼߦࡨޡͯ͠ૹ৴ w ͜ͷνέοτݸॻ͘ͷʹ࣌ؒҐ͔͔ͬͨɺ֬ೝ͢Δ͜ͱ͕༧ ૝Ҏ্ʹଟ͔ͬͨɻ w Ͳ͏͢Ε͹όά͕ൃੜ͢Δͷ͔ w Ͳ͏͢Ε͹όά͕ൃੜ͠ͳ͍ͷ͔

    w ͦͷόά͸طʹใࠂ͞Ε͍ͯͳ͍͔ w IUUQTCVHTQIQOFUCVHQIQ JE
  47. DMPTF͞Ε·ͨ͠ ෼͘Β͍ͰDMPTF͞Εͨ

  48. ൓লࣄ߲࣮͸ใࠂʹϛε͕ ͋ͬͨ w NC@DIFDL@FODPEJOHͱ͍͏ͷ͸ɺ಺෦తʹ͸ NC@DPOWFSU@FODPEJOHͷUP@FODPEJOHͱGSPN@FODPEJOH Λಉ͡ʹͯ͠ɺฦ٫஋͕ಉ͔͡Ͳ͏͔Λݟ͍ͯΔ w TUSNC@DPOWFSU@FODPEJOH TUS l65'z

     l65'z  w ͭ·ΓɺNC@DIFDL@FODPEJOHʹ໰୊͕͋Δͱ͍͏͜ͱ ͸ɺNC@DPOWFSU@FODPEJOHʹ໰୊͕͋ΔՄೳੑ͕ߴ͍ͱ ͍͏͜ͱ
  49. NC@DIFDL@FODPEJOHͷฦΓ ஋ʹ͍ͭͯ w NC@DIFDL@FODPEJOHฒͼʹNC@DPOWFSU@FODPEJOH͸ɺ 1)1͔ΒBSSBZΛड͚ೖΕΒΕΔΑ͏ʹͳͬͨ w NC@DIFDL@FODPEJOH BSSBZ l65'z ͸ɺ1)1Ͱ

    GBMTFɺ1)1ɺ1)1Ͱ/6--ɺ1)1ͰUSVFͱ ͳΔ
  50. NC@DIFDL@FODPEJOHͷฦΓ ஋ʹ͍ͭͯ 1)1 1)1
 1)1 1)1PSIJHIFS '"-4& /6-- 536& NC@DIFDL@FODPEJOH

    BSSBZ ͸ɺ όʔδϣϯ͕มΘΔͱ࿦ཧ͕൓స͢Δ
  51. ײ૝ͳͲ w ڊେͳ044ͷ*TTVF͸ɺ֬ೝࣄ߲͕ଟ͘ɺ݅ใࠂ͢Δ͚ͩͰҙ ֎ͱ͕͔͔࣌ؒΔ w ใࠂ͢Δ·Ͱ͸Ͱ͖ΔݶΓͷਖ਼֬ͳใࠂʹ౒Ίͯͯເதͩͬͨɻ w ใࠂͯ͠ɺDMPTF͞Εͨͱ͖ɺੈքதʹӨڹΛٴ΅ͯ͠͠·ͬͨ ͜ͱʹؾ͕͍ͭͯಈ༳ͨ͠ɻ w

    ੈքதͷਓʑ͕ɺࢲͷ౿ΜͩόάΛ౿·ͳͯ͘ࡁΉɻخ͍͠ w ·ͩ݅ใࠂ͚ͨͩ͠ͳͷͰɺ΋ͬͱ΍͍͖͍ͬͯͨͰ͢Ͷ
  52. ͓͠·͍Ͱ͢ ͋Γ͕ͱ͏͍͟͝·ͨ͠

  53. ँࣙ w CVHͷใࠂͷ΍Γ͔ͨɾ৺ߏ͑Λڭ͑ͯ͘Ε·ͨ͠ɻ w IUUQTIOXIBUFOBCMPHDPNFOUSZ w 4VNNBSZͷॏཁ͞ΛؾΛ͚ͭΔ͜ͱ͕Ͱ͖·ͨ͠ɻ w IUUQTIJNPPLBIBUFCMPKQFOUSZ w

    ࠶ݱͰ͖ΔίʔυΛࣔͤΕ͹͍͍ΜͰ͢ɻݴ͍͍ͨ͜ͱ͕఻ΘΕ͹͍ ͍ΜͰ͢ɻ