cvs: php-bugs-web / bugs-generating-backtrace-win32.php /backtrace-images-win32 analyze.jpg backtrace.jpg dbg_options.png dbg_select_php.png
dbg_wizard_1.png dbg_wizard_2.png rules.jpg

From: Date: Sat, 30 Jun 2007 16:57:09 +0000
Subject: cvs: php-bugs-web / bugs-generating-backtrace-win32.php /backtrace-images-win32 analyze.jpg backtrace.jpg dbg_options.png dbg_select_php.png
dbg_wizard_1.png dbg_wizard_2.png rules.jpg
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-35855@lists.php.net to get a copy of this message
bjori Sat Jun 30 16:57:09 2007 UTC Added files: /php-bugs-web/backtrace-images-win32 analyze.jpg backtrace.jpg rules.jpg dbg_options.png dbg_select_php.png dbg_wizard_1.png dbg_wizard_2.png Modified files: /php-bugs-web bugs-generating-backtrace-win32.php Log: Add "Generating backtrace, without compiler, on Win32" section (completely stolen from Pierre, with permission, see http://blog.thepimp.net/index.php/post/2007/06/10/debug-pack-or-how-to-generate-backtrack-on-windows-without-compiling) http://cvs.php.net/viewvc.cgi/php-bugs-web/bugs-generating-backtrace-win32.php?r1=1.2&r2=1.3&diff_format=u Index: php-bugs-web/bugs-generating-backtrace-win32.php diff -u php-bugs-web/bugs-generating-backtrace-win32.php:1.2 php-bugs-web/bugs-generating-backtrace-win32.php:1.3 --- php-bugs-web/bugs-generating-backtrace-win32.php:1.2 Wed Jan 17 11:41:34 2007 +++ php-bugs-web/bugs-generating-backtrace-win32.php Sat Jun 30 16:57:09 2007 @@ -3,7 +3,7 @@ commonHeader("Generating a backtrace on Win32"); ?> -<h1>Generating a backtrace on Win32</h1> +<h1>Generating a backtrace, <u>with</u> a compiler, on Win32</h1> <p>You'll need to install MSVC6 and you'll also need to</p> <ul> @@ -35,5 +35,55 @@ KERNEL32! 77e81af6() </code></pre> +<!-- + Everything below is stolen from Pierre, + http://blog.thepimp.net/index.php/post/2007/06/10/debug-pack-or-how-to-generate-backtrack-on-windows-without-compiling +--> +<h1>Generating backtrace, <u>without</u> compiler, on Win32</h1> +<p>You'll need:</p> +<ul> +<li>A PHP <a href="http://snaps.php.net/">snapshot</a> or <a href="http://www.php.net/downloads.php">stable</a> release</li> +<li>PHP Debug pack (<a href="http://snaps.php.net/">snapshot</a> or stable <a href="http://php.net/get/php-debug-pack-5-LATEST-Win32.zip/from/a/mirror">thread safe</a> or <a href="http://php.net/get/php-debug-pack-5-LATEST-nts-Win32.zip/from/a/mirror">non thread safe</a></li> +<li>Microsoft <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=28bd5941-c458-46f1-b24d-f60151d875a3&amp;displaylang=en">Debug Diagnostic Tools</a></li> +<li>Evil script to crash PHP</li> +</ul> +<p>For the sake of this example, we will simply use PHP in the shell. +The same method can be used for IIS or any other process or services.</p> + + +<p>Once you have installed the Debug diagnostic tools and uncompressed +PHP and its debug pack (they can be kept in two separate folders), the +first step is to configure the diagnostic tools. Select the +tools menu and click on "Options and settings". The first tab contains +the path to the symbols files, add the "debug folder" to the existing +list using the "browse" button:</p> +<p><img src="backtrace-images-win32/dbg_options.png" alt="Options"></p> + +<p>Now we are ready to generate our backtrace.</p> +<p>We will use the wizard, click the "Add a rule" button and choose "Crash" as the rule type:</p> +<p><img src="backtrace-images-win32/dbg_wizard_1.png" alt="Wizard #1"></p> + +<p>In the next window, select "a specific process":</p> +<p><img src="backtrace-images-win32/dbg_wizard_2.png" alt="Wizard #2"></p> + +<p>Add a "sleep(10);" for the first run (from the cmd: "php.exe +crashme.php"), it will let you enough time to click "next" and select +the php process:</p> +<p><img src="backtrace-images-win32/dbg_select_php.png" alt="Select the php process"></p> + +<p>Click again next and let it crash. If everything went well, you should see your new rule as shown in the image below:</p> +<p><img src="backtrace-images-win32/rules.jpg" alt="rules list"></p> + +<p>It also detected that "php.exe" was used. A rule has been created +for all instance of "php.exe". It will save you the sleep and process +selection.</p> +<p>Now you can click the "Analyze data" button:</p> +<p><img src="backtrace-images-win32/analyze.jpg" alt="Analyze"></p> + +<p>Et voila, the complete report will show up in your internet explorer (compressed html):</p> +<p><img src="backtrace-images-win32/backtrace.jpg" alt="Debug report backtrace screenshot"></a></p> + +<p>What we need is the backtrace itself which can be found under "Thread X - System ID XXX".</p> + <?php commonFooter(); ?>

« previous php.mirrors (#35855) next »