google-breakpadã使ãã 01
ã¯ããã«
google-breakpadã¯ããªã¼ãã³ã½ã¼ã¹ã§ãã«ããã©ãããã©ã¼ã ã«å¯¾å¿ããã¯ã©ãã·ã¥ã¬ãã¼ãã£ã³ã°ã·ã¹ãã ã ãFirefoxã®ããã«ãé·æéé£ç¶ç¨¼åããããçµæ§ã¯ã©ãã·ã¥ãããã¨ãå¤ãããã°ã©ã ãã§çªç¶ãç³ã訳ãããã¾ãããã¨ã¢ããªã±ã¼ã·ã§ã³ãå¼æãå§ãããã¨ããããããããæ ãã®ããã®ããã ãåé¡ãåºããã¢ããªã±ã¼ã·ã§ã³ã®ã¯ã©ãã·ã¥ãã³ããã¢ããªã±ã¼ã·ã§ã³ãã°ãã¾ã¨ãã¦ãµã¼ãå´ã«èªåçã«éä¿¡ãããã¨ã§åé¡ã®è§£æ±ºãè¡ãããããããã¨ãç®çã ã
ãªããã¢ããªã±ã¼ã·ã§ã³ãã¯ã©ãã·ã¥ããã³ããªã³ã°ããªãã¨ã代ããã«ãã®è¦ªã§ããOSãå¼æããå§ããã
ããã¡ã
ãã®ã©ã¤ãã©ãªã®æ¡ç¨å®ç¸¾ã¨ãã¦ã¯ã以ä¸ã®ãããªãã®ãããã
- Google Chrome
- Firefox
- ãã¼ã¸ã§ã³3.0ãã使ãããããã«ãªãããã
- Breakpad - MozillaZine Knowledge Base
- ãã©ã¦ã¶æä¾è ã¨ããæå³ã§ã¯ç«¶åã ããGoogleã¯Mozillaã¨ä»²ãããããã
- モジラCEO、「Google Chrome」のリリースを歓迎 - builder by ZDNet Japan
詳ãã調ã¹ãããã§ã¯ãªããããã®2ã¤ã®å·¨å¤§ããã¸ã§ã¯ãã§æ¡ç¨ããã¦ããã®ã§ä¿¡é ¼æ§ã¯é«ãããã«æãããåããããªã·ã¹ãã ãèªãéçºããããããä¸çã®ä¸ã§é¸ããããããéçºè
ãã¡ããã§ã«å®è£
ãããã®ã使ã£ãæ¹ãå¹çã¯ãããä»®ã«åé¡ããã£ã¦ãBSDã©ã¤ã»ã³ã¹ãªã®ã§åæã«ä¿®æ£ãã¦é
å¸ãã¦ãããï¼ããï¼ï¼ã
ä½ããã£ã¦ãããã®ã
主ãªæ©è½ã¯ä»¥ä¸ã®3ã¤ã§ããã
- ä¾å¤ãã³ãã©ã®æä¾
- ã¯ã©ãã·ã¥ãã³ãã®çæ
- ä¾ãã°Windowsã§ã¯ã¯ã©ãã·ã¥ãã³ããçæããããã©ããã¯ã¯ãã½ã³å士ãªã©ã®è¨å®ã«ãã
- ããã«ä¾åããã«ã¯ã©ãã·ã¥ãã³ããçæããããã¨ãã§ãã
- ã¨ã©ã¼å ±å
ããã¯ClientDesign - google-breakpad - Breakpad Client Libraries Design Document - Google Codeã«è¨è¿°ããã¦ããããç§ã«ã¨ã£ã¦ã¯è±èªã®æç« ãç解ãããããã³ã¼ãããã§ãã¯ã¢ã¦ããã¦http://google-breakpad.googlecode.com/svn/trunk/src/client/windows/breakpad_client.slnã¨ããVisual Studioã®ã½ãªã¥ã¼ã·ã§ã³ãã¡ã¤ã«ãéãã¦ç¢ºèªããæ¹ãç´æçã ã£ããã½ãªã¥ã¼ã·ã§ã³ãéãã¨3ã¤ã®ããã¸ã§ã¯ãããããã¨ãåããããããä¸è¨ã®3ã¤ã®æ©è½ã«ãããã対å¿ãã¦ãããããã3ã¤ã®æ©è½ããã¹ã¦ä½¿ã£ã¦ãããããå¿
è¦ãªãã®ã ãé¸ãã§ä½¿ã£ã¦ããããããã¸ã§ã¯ãã¯ãã¹ã¦ã¹ã¿ãã£ãã¯ã©ã¤ãã©ãªããã¸ã§ã¯ãã«ãªã£ã¦ãã¦ãããããexception_handlerãcrash_generationãcrash_report_senderã¨ããååãã¤ãã¦ãããå¿
è¦ã«å¿ãã¦ãCRTãéçãªã³ã¯ãããåçãªã³ã¯ããããé¸æã§ããããã ããUnicodeã§ã¯ãªãMBCSãé¸æãããã¨ã¯ã§ããªããx64ã¿ã¼ã²ããã®ãã«ãæ§æãåå¨ããªãããx86(Win32)ã®ãã®ããã¼ã¹ã«ã³ãã¼ããã°ãããããã®ã¾ã¾åãã ããã
ãã以å¤ãä¾ãã°ã¨ã©ã¼å ±åã®ããã®ãã¤ã¢ãã°ãªã©ã¯æä¾ããã¦ããªãã®ã§ãã¢ããªã±ã¼ã·ã§ã³å´ã§å®è£ ããå¿ è¦ãããããã«ããã©ãããã©ã¼ã ã«å¯¾å¿ããã¨ã©ã¼å ±åãã¤ã¢ãã°ãå®è£ ããã®ã¯éª¨ãæããããã¢ããªã±ã¼ã·ã§ã³ã®çãåºãé¨åãªã®ã§ãããã¯ããã§åé¡ãªãã ããã
ã¡ãªã¿ã«ããªããããã£ãæ©è½ãå¿ è¦ãã¨è¨ãã¨ããã°ã®ãªã大è¦æ¨¡ãªã½ããã¦ã§ã¢ãä½ãã®ã¯ä¸å¯è½ã ããã ããããªãã¨ããã°ãèµ·ãã¦ãè¿ éã«ä¿®æ£ã§ããããã«ãããããªãããã®ããã«ã¯ãã°ãåç¾ãããã¨ãã§ããæ£ç¢ºãªæ å ±ãå¿ è¦ã ããã¦ã¼ã¶ãããã°ã®ä¿®æ£ã«å¿ è¦ãªæ£ç¢ºãªæ å ±ãå¼ãåºããã¨ã¯é常ã«é£ãããããããæ£ç¢ºãªæ å ±ã¨ããã®ãé£ããããããç¨åº¦æ å ±ããã£ã¦ãåç¾ãããã¨ã¯é£ãããããªããããä½ããã®ã½ããã¦ã§ã¢ãéçºãããã°å ±åãåãããã¨ããããªããããã«ãã®æ å ±ãææ§ãªãã®ãã¯åããã ããï¼ãåãã¾ãããã¨ã ãããæ å ±ãç¡ããã¨ãå¤ã ããã®ã ï¼ããããªãã¨æã£åãæ©ãã®ã¯ã¯ã©ãã·ã¥ãã³ãããããã¨ãããã¨ã«å°½ãããã¯ã©ãã·ã¥ãã³ãã¨ããã«å¯¾å¿ããã³ã¼ãã®ãªãã¸ã§ã³ãããã°ãéçºè ã¯æ¯è¼ç容æã«ãã°ã追跡ãããã¨ãå¯è½ã«ãªããVisual Studioã§Windowsã¢ããªã±ã¼ã·ã§ã³ãéçºãããã¨ã®ãã人ãªããã¢ããªã±ã¼ã·ã§ã³ã®ã¯ã©ãã·ã¥ãã³ããIDEã«èªã¿è¾¼ã¾ããã¨ã½ã¼ã¹ã³ã¼ãã¬ãã«ã§ã©ãã§ã¯ã©ãã·ã¥ãçºçä½ç½®ããã®ã¨ãã®ã¹ã¿ãã¯ã®æ å ±ãªã©ãç¹å®ã§ããã¨ãããã¨ãç¥ã£ã¦ããã¯ãã ãããã¯ãã°ãæ¨æ¸¬ãããããã¯ããã«ç°¡åãªä½æ¥ã§æ¸ããç°¡åã«ä½æ¥ã§ããã°ããã°ã®ä¿®æ£ãè¿ éã«è¡ããå¯è½æ§ãé«ããªããæçµçã«ã¯ã¦ã¼ã¶ã¨éçºè ã®åæ¹ã«ã¡ãªããããããããã¨ã«ãªãã ããã
ãªããä¸è¨ã§è¿°ã¹ããããªãã¨ã¯ã¯ã©ã¤ã¢ã³ãã¢ããªã±ã¼ã·ã§ã³éçºã«å¤ãããWebã¢ããªã±ã¼ã·ã§ã³ã§ãä»å¾ã¯ãããã£ãå¿ è¦æ§ãåºã¦ããã®ãããããªããããã¯ajaxã®åºç¾ã«ãã£ã¦Webã¢ããªã±ã¼ã·ã§ã³ãè¤éåãã¦ããã¨ãããã¨ããPCãã¢ãã¤ã«ç«¯æ«ã§JavaScriptãåä½ãããªãããã©ã¦ã¶ã®æ¡å¤§ã¨ããèæ¯ãããããã ãç§ã¯Webã¢ããªã±ã¼ã·ã§ã³ã®éçºãããã¾ã§ãã£ããã¨ããªãã®ã§ããããã£ãäºæ ã詳ããã¯ç¥ããªãã
ã§ã¯ãå®éã«ã©ããªã£ã¦ããã®ãã詳ããã¿ã¦ãããããã ããWindowsçã«éå®ããã¦ããã ãããã
詳細
exception_handler
exception_handlerã¯3ã¤ã®ä¸ã§2çªç®ã«è¦æ¨¡ã大ãããã®ã ãä¸è¨ã®ãããªä¾å¤ãæãããã¨ãã§ããã
- Windowsã®æ§é åä¾å¤å¦çã§æãããã¨ã®ã§ããä¾å¤
- SetUnhandledExceptionFilterã«ãã£ã¦å®ç¾ããã
- å ·ä½çãªå 容ã¯ä»¥ä¸ã«è¨è¿°ããã
- http://msdn.microsoft.com/ja-jp/library/cc428942.aspx
- EXCEPTION_RECORD Structure (Windows)
- CRTã®_set_invalid_parameter_handlerã«ãã£ã¦å®ç¾ããã
- _set_invalid_parameter_handler (CRT)
- ç´ç²ä»®æ³é¢æ°ã®å¼ã³åºã
- CRTã®_set_purecall_handlerã«ãã£ã¦å®ç¾ããã
- _set_purecall_handler、_set_purecall_handler_m (CRT)
ãããã«ãã£ã¦ãéçºè ãã³ã¼ãã§æ³å®ã§ãã¦ããªãä¾å¤ã¯ããããè£è¶³ã§ããããã®ã©ã¤ãã©ãªã使ãã¨ãä¾å¤ãè£è¶³ããã¨ãã«ã¯ã©ãã·ã¥ãã³ãï¼ãããã³ãï¼ãçæããããçæãçµãã£ãå¾ã«ä½ãããããå®ç¾©ãããã¨ãã§ããã
crash_generation
crash_generationã¯3ã¤ã®ä¸ã§ä¸çªè¦æ¨¡ã大ãããã®ã ãããã«ã¤ãã¦ã¯æ¬¡åã§åãä¸ããã
crash_report_sender
crash_report_senderã¯3ã¤ã®ä¸ã§ä¸çªè¦æ¨¡ã®å°ãããã®ã ã
- HTTP/HTTPSã§ã¬ãã¼ããPOSTãããã¨ãã§ãã
- HTTPéä¿¡ã¯WinInetã«ãã£ã¦å®ç¾ããã
- User-Agentã¯ãBreakpad/1.0 (Windows)ãã¨ãªã£ã¦ãã
- multipart/form-dataã§è¤æ°ã®ãã¡ã¤ã«ãã¬ãã¼ããããã¨ãã§ãã
- ãã¡ã¤ã«åã®æåã³ã¼ãã¯UTF-8ã§è¡¨ç¾ããã
- ãããã·è¨å®ã¯ãã¤ã³ã¿ã¼ããããªãã·ã§ã³ã®ãããã·è¨å®ãè¸è¥²ãã
- InternetOpen()ã®å¼ã³åºãã«INTERNET_OPEN_TYPE_PRECONFIGãã©ã°ãæå®ãã¦ãããã
ããã¾ãã«ã¯ãããªã¨ããã ãã以ä¸ã®ãããªãã¨ã«æ°ãã¤ããå¿ è¦ãããã
- ãµã¼ãèªè¨¼ããããã·èªè¨¼ãå¿
è¦ãªå ´åã¯ã¢ãããã¼ãã§ããªã
- WinInetã¯Internet Explorerãªã©ãä¿æãã¦ãããã¹ã¯ã¼ããèªåçã«å©ç¨ãã¦ããããããªã
- ãã®ããã¸ã§ã¯ãã§æä¾ãããã¯ã©ã¹ã«ã¯ãã®ããã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã¯ãªã
- ãµã¼ãã¯èªè¨¼ä¸è¦ã«ãã¦ããã
- ã¤ã³ã¿ã¼ããããªãã·ã§ã³ã®ãããã·è¨å®ããè¨å®ãèªåçã«æ¤åºããããèªåæ§æã¹ã¯ãªããã使ç¨ãããã®å ´å
- INTERNET_OPEN_TYPE_PRECONFIGãã©ã°ã§ã¯ãããã·ã®éçè¨å®ããè¦ã¦ãããªããããããã·ãè¶ ãããã¨ãã§ããªã
- ä¼æ¥ãªã©ã§ãããã·é ä¸ã«ç«¯æ«ãããç°å¢ãã¿ã¼ã²ããã¨ãªãå ´åã¯è¦æ³¨æ
- ã¬ãã¼ãã®é²æãç¥ãè¡ããªã
- ã¬ãã¼ãå®äºã«æéããããå ´åã¯è¦æ³¨æ
ã³ã¼ãã¯300è¡è¶³ãããªã®ã§ãå¿ è¦ã«å¿ãã¦æ¸ãæãããã¨ã容æã ã¨æããWinInet APIãè¿ããã³ãã«ãRAIIã§ç®¡çãã¦ãããããã¯ãããã ã
ã¾ã¨ã
- 大è¦æ¨¡ãªéçºã«ã¯ã©ãã·ã¥ã¬ãã¼ãã£ã³ã°ã·ã¹ãã ã¯æ¬ ãããã¨ãã§ããªã
- google-breakpadã¯ãããå®ç¾ããããã«ã·ã³ãã«ã§ãã¯ãã«ãªæ©è½ãæä¾ãã¦ããã
次åã«åãã¦
次åã¯ãä»ååãä¸ããªãã£ããcrash_generationããä»ã«ä½ãã§ããã®ãããé¡ä¼¼ããã©ã¤ãã©ãªããgoogle-breakpadã®ä¸ã®äººããã¢ããªã±ã¼ã·ã§ã³è¨è¨ã®ã¬ã¤ãã©ã¤ã³ããªã©ã«ã¤ãã¦åãä¸ãã¦ããã