<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Fab tool: watch</title>
	<atom:link href="http://openquery.com/blog/fab-tool-watch/feed" rel="self" type="application/rss+xml" />
	<link>http://openquery.com/blog/fab-tool-watch</link>
	<description>About MySQL, Drizzle, MariaDB and more!</description>
	<lastBuildDate>Wed, 13 Jan 2010 12:40:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sergei Golubchik</title>
		<link>http://openquery.com/blog/fab-tool-watch/comment-page-1#comment-1564</link>
		<dc:creator>Sergei Golubchik</dc:creator>
		<pubDate>Mon, 29 Jun 2009 21:19:42 +0000</pubDate>
		<guid isPermaLink="false">http://openquery.com/blog/?p=849#comment-1564</guid>
		<description>I wonder where you got it from. It sounded so unbelievable that I took the time to download the source of watch.c and look inside.

Indeed, no crazy program counter manipulations. Pretty ordinary stuff - popen(), getc() until eof, pclose(), wait, repeat. Nothing too fancy.</description>
		<content:encoded><![CDATA[<p>I wonder where you got it from. It sounded so unbelievable that I took the time to download the source of watch.c and look inside.</p>
<p>Indeed, no crazy program counter manipulations. Pretty ordinary stuff &#8211; popen(), getc() until eof, pclose(), wait, repeat. Nothing too fancy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wayne</title>
		<link>http://openquery.com/blog/fab-tool-watch/comment-page-1#comment-1561</link>
		<dc:creator>Wayne</dc:creator>
		<pubDate>Mon, 29 Jun 2009 17:49:28 +0000</pubDate>
		<guid isPermaLink="false">http://openquery.com/blog/?p=849#comment-1561</guid>
		<description>I&#039;m not quite sure where you got that idea from, but watch(1) uses popen(3) so it execs a new process every time.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not quite sure where you got that idea from, but watch(1) uses popen(3) so it execs a new process every time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Bergen</title>
		<link>http://openquery.com/blog/fab-tool-watch/comment-page-1#comment-1559</link>
		<dc:creator>Eric Bergen</dc:creator>
		<pubDate>Mon, 29 Jun 2009 16:51:39 +0000</pubDate>
		<guid isPermaLink="false">http://openquery.com/blog/?p=849#comment-1559</guid>
		<description>Looking at the source it does a popen() pclose() for each iteration. I don&#039;t see any poking in the version from:

cvs -d :pserver:anoncvs@sources.redhat.com:/cvs/procps co procps

The man page also says it&#039;s just passed to a shell.</description>
		<content:encoded><![CDATA[<p>Looking at the source it does a popen() pclose() for each iteration. I don&#8217;t see any poking in the version from:</p>
<p>cvs -d :pserver:anoncvs@sources.redhat.com:/cvs/procps co procps</p>
<p>The man page also says it&#8217;s just passed to a shell.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Cole</title>
		<link>http://openquery.com/blog/fab-tool-watch/comment-page-1#comment-1558</link>
		<dc:creator>Jeremy Cole</dc:creator>
		<pubDate>Mon, 29 Jun 2009 16:38:04 +0000</pubDate>
		<guid isPermaLink="false">http://openquery.com/blog/?p=849#comment-1558</guid>
		<description>Hi Arjen,

I&#039;m sorry, but unless you&#039;re talking about a different &#039;watch&#039; than the one that ships with, well probably every Linux out there, you&#039;re just wrong.  Where did you get this idea?  You didn&#039;t provide any reference whatsoever.

http://procps.cvs.sourceforge.net/viewvc/procps/procps/watch.c?view=markup

You can see quite clearly that it calls p = popen(...) ... getc(p) ... pclose(p)

Compare the file available at the above URL to the one available in your operating system of choice.  (Compared and matched to CentOS&#039;s myself.)

Regards,

Jeremy</description>
		<content:encoded><![CDATA[<p>Hi Arjen,</p>
<p>I&#8217;m sorry, but unless you&#8217;re talking about a different &#8216;watch&#8217; than the one that ships with, well probably every Linux out there, you&#8217;re just wrong.  Where did you get this idea?  You didn&#8217;t provide any reference whatsoever.</p>
<p><a href="http://procps.cvs.sourceforge.net/viewvc/procps/procps/watch.c?view=markup" rel="nofollow">http://procps.cvs.sourceforge.net/viewvc/procps/procps/watch.c?view=markup</a></p>
<p>You can see quite clearly that it calls p = popen(&#8230;) &#8230; getc(p) &#8230; pclose(p)</p>
<p>Compare the file available at the above URL to the one available in your operating system of choice.  (Compared and matched to CentOS&#8217;s myself.)</p>
<p>Regards,</p>
<p>Jeremy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Holger Hoffstätte</title>
		<link>http://openquery.com/blog/fab-tool-watch/comment-page-1#comment-1557</link>
		<dc:creator>Holger Hoffstätte</dc:creator>
		<pubDate>Mon, 29 Jun 2009 16:23:39 +0000</pubDate>
		<guid isPermaLink="false">http://openquery.com/blog/?p=849#comment-1557</guid>
		<description>I have no idea what version of watch you have been looking at, but the one from procps (on SourceForge) restarts the process after it terminates.</description>
		<content:encoded><![CDATA[<p>I have no idea what version of watch you have been looking at, but the one from procps (on SourceForge) restarts the process after it terminates.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giuseppe Maxia</title>
		<link>http://openquery.com/blog/fab-tool-watch/comment-page-1#comment-1555</link>
		<dc:creator>Giuseppe Maxia</dc:creator>
		<pubDate>Mon, 29 Jun 2009 07:37:34 +0000</pubDate>
		<guid isPermaLink="false">http://openquery.com/blog/?p=849#comment-1555</guid>
		<description>Arjen,
care to share the evidence on your claim? Looking at watch source code, I could only see a &quot;getc&quot; on the child process pointer (created by popen). Where did you get the &quot;poke&quot; stuff?

Giuseppe</description>
		<content:encoded><![CDATA[<p>Arjen,<br />
care to share the evidence on your claim? Looking at watch source code, I could only see a &#8220;getc&#8221; on the child process pointer (created by popen). Where did you get the &#8220;poke&#8221; stuff?</p>
<p>Giuseppe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: strcmp</title>
		<link>http://openquery.com/blog/fab-tool-watch/comment-page-1#comment-1554</link>
		<dc:creator>strcmp</dc:creator>
		<pubDate>Mon, 29 Jun 2009 07:25:11 +0000</pubDate>
		<guid isPermaLink="false">http://openquery.com/blog/?p=849#comment-1554</guid>
		<description>If you have a &#039;some ... kernel bug&#039;, you have other problems than watch causing a segfault in the watched program... If all it does is using official interfaces, this is not different than using a debugger, etc. I have seen more database errors than watch errors, watch doesn&#039;t seem to be that problematic.

I actually downloaded an read watch.c (from procps 3.2.7-9ubuntu2.1) to see how it works, if there are script interpreters, dynamic loading and initialization of global variables involved. In line 264 you have:

		if (!(p = popen(command, &quot;r&quot;))) {
			perror(&quot;popen&quot;);
			do_exit(2);
		}

Very hacky indeed :) Which (maybe prehistoric?) version of watch is you information about?</description>
		<content:encoded><![CDATA[<p>If you have a &#8217;some &#8230; kernel bug&#8217;, you have other problems than watch causing a segfault in the watched program&#8230; If all it does is using official interfaces, this is not different than using a debugger, etc. I have seen more database errors than watch errors, watch doesn&#8217;t seem to be that problematic.</p>
<p>I actually downloaded an read watch.c (from procps 3.2.7-9ubuntu2.1) to see how it works, if there are script interpreters, dynamic loading and initialization of global variables involved. In line 264 you have:</p>
<p>		if (!(p = popen(command, &#8220;r&#8221;))) {<br />
			perror(&#8221;popen&#8221;);<br />
			do_exit(2);<br />
		}</p>
<p>Very hacky indeed <img src='http://openquery.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Which (maybe prehistoric?) version of watch is you information about?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: figvam</title>
		<link>http://openquery.com/blog/fab-tool-watch/comment-page-1#comment-1553</link>
		<dc:creator>figvam</dc:creator>
		<pubDate>Mon, 29 Jun 2009 06:07:18 +0000</pubDate>
		<guid isPermaLink="false">http://openquery.com/blog/?p=849#comment-1553</guid>
		<description>&gt; That is, until you learn how it works. It does not re-load and run the program, oh no it’s much smarter than that: it goes in and resets the program counter. That’s right, it literally pokes into its child process!

Where did you get that? Looking at the source, it uses nothing more than popen/pclose to run a child program:
http://procps.cvs.sourceforge.net/viewvc/procps/procps/watch.c?revision=1.16&amp;view=markup

Indeed, if you check the process list while watch is running, you can see the pids of the child processes incrementing with each run. There&#039;s nothing suspicious here, and certainly no poking around the program counters.</description>
		<content:encoded><![CDATA[<p>&gt; That is, until you learn how it works. It does not re-load and run the program, oh no it’s much smarter than that: it goes in and resets the program counter. That’s right, it literally pokes into its child process!</p>
<p>Where did you get that? Looking at the source, it uses nothing more than popen/pclose to run a child program:<br />
<a href="http://procps.cvs.sourceforge.net/viewvc/procps/procps/watch.c?revision=1.16&amp;view=markup" rel="nofollow">http://procps.cvs.sourceforge.net/viewvc/procps/procps/watch.c?revision=1.16&amp;view=markup</a></p>
<p>Indeed, if you check the process list while watch is running, you can see the pids of the child processes incrementing with each run. There&#8217;s nothing suspicious here, and certainly no poking around the program counters.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->