{"id":305556,"date":"2020-06-18T15:01:28","date_gmt":"2020-06-18T15:01:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=305556"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=305556","title":{"rendered":"One more Heisenbug \u043c\u0438\u043c\u043e \u043a\u0440\u043e\u043a\u043e\u0434\u0438\u043b"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/507142\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/eo\/bc\/id\/eobciddyw-criwjg-08elhsj0lo.jpeg\"><\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$&gt; set -o pipefail  $&gt; fortune | head -1 &gt; \/dev\/null &amp;&amp; echo &quot;\u041f\u043e\u0432\u0435\u0437\u043b\u043e!&quot; || echo &quot;\u0412\u044b \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b\u0438&quot; \u041f\u043e\u0432\u0435\u0437\u043b\u043e!  $&gt; fortune | head -1 &gt; \/dev\/null &amp;&amp; echo &quot;\u041f\u043e\u0432\u0435\u0437\u043b\u043e!&quot; || echo &quot;\u0412\u044b \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b\u0438&quot; \u0412\u044b \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b\u0438<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c <code>fortune<\/code> \u0443\u0441\u043b\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0431\u0435\u0437 <code>exit(rand())<\/code>.<\/p>\n<p>  <\/p>\n<h2 id=\"cmozhete-obyasnit\">C\u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c?<\/h2>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041b\u0438\u0440\u0438\u0447\u043d\u043e-\u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0441 \u044d\u0442\u0438\u043c \u0413\u0435\u0439\u0437\u0435\u043d\u0431\u0430\u0433\u043e\u043c \u044f \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0441\u044f \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u044c \u0432\u0435\u043a\u0430 \u043d\u0430\u0437\u0430\u0434. \u0422\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u0448\u043b\u044e\u0437\u0430 \u0432 FaxNET \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0442\u0438\u043b\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9A%D0%BE%D0%BD%D0%B2%D0%B5%D0%B9%D0%B5%D1%80_(Unix)\" rel=\"nofollow\">pipes<\/a> \u00ab\u0438\u0433\u0440\u0430\u044e\u0449\u0438\u0445 \u0432 \u0448\u0430\u0448\u043a\u0438\u00bb \u043f\u043e\u0434 FreeBSD. \u041a\u0430\u043a \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043e, \u044f \u0441\u0447\u0438\u0442\u0430\u043b \u0441\u0435\u0431\u044f \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u043c \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u043f\u044b\u0442\u043d\u044b\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c\u0435\u0440\u0435\u0432\u0430\u043b\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0451 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u0438 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0443\u0434\u0435\u043b\u0438\u0432 \u043e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043e\u0448\u0438\u0431\u043e\u043a\u2026 <\/p>\n<p>  <\/p>\n<p>\u0423\u0441\u0435\u0440\u0434\u0438\u044f \u0432 \u00ab\u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043e\u0448\u0438\u0431\u043e\u043a\u00bb \u043c\u043d\u0435 \u0442\u043e\u0433\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043e\u043f\u044b\u0442 \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u0431\u0430\u0433\u0430\u043c\u0438 \u0432 sendmail \u0438 uucp\/uupc. \u041f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0435\u0442\u0430\u043b\u0438 \u0442\u043e\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0441\u043c\u044b\u0441\u043b\u0430 \u043d\u0435\u0442, \u043d\u043e \u0431\u043e\u0440\u043e\u043b\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u0413\u0435\u0439\u0437\u0435\u043d\u0431\u0430\u0433\u043e\u043c \u044f \u043d\u0435\u0434\u0435\u043b\u0438 \u0434\u0432\u0435 \u043f\u043e 10-14 \u0447\u0430\u0441\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043b\u043e\u0441\u044c, \u0438 \u0432\u043e\u0442 \u0432\u0447\u0435\u0440\u0430 \u044d\u0442\u043e\u0442 \u0441\u0442\u0430\u0440\u044b\u0439 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u043b \u0432 \u0433\u043e\u0441\u0442\u0438.<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">TL;DR \u041e\u0442\u0432\u0435\u0442<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 <code>head<\/code> <em>\u043c\u043e\u0436\u0435\u0442<\/em> \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u043a\u0430\u043d\u0430\u043b \u043e\u0442 <code>fortune<\/code> <em>\u0441\u0440\u0430\u0437\u0443<\/em> \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443. \u0415\u0441\u043b\u0438 <code>fortune<\/code> \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u0437\u043e\u0432 <code>write()<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443, \u043b\u0438\u0431\u043e \u0441\u043e\u043e\u0431\u0449\u0438\u0442 \u043e \u0432\u044b\u0432\u043e\u0434\u0435 \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0431\u0430\u0439\u0442 \u0447\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043e. \u0412 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0441 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u043e\u0448\u0438\u0431\u043e\u043a <code>fortune<\/code> \u0432\u043f\u0440\u0430\u0432\u0435 \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0432 \u0441\u0432\u043e\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441\u0435 \u0432\u044b\u0445\u043e\u0434\u0430. \u0422\u043e\u0433\u0434\u0430 \u0438\u0437-\u0437\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 <code>set -o pipefail<\/code> \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <code>|| echo &quot;\u0412\u044b \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b\u0438&quot;<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e, <code>head<\/code> <em>\u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0443\u0441\u043f\u0435\u0442\u044c<\/em> \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a <code>fortune<\/code> \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442 \u0432\u044b\u0432\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u043e\u0433\u0434\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <code>&amp;&amp; echo &quot;\u041f\u043e\u0432\u0435\u0437\u043b\u043e!&quot;<\/code>.<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043c\u043e\u0438\u0445 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0445 <a href=\"https:\/\/github.com\/erthink\/libmdbx\/blob\/master\/GNUmakefile\" rel=\"nofollow\"><code>GNUMakefile<\/code><\/a> \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 <a href=\"https:\/\/github.com\/erthink\/libmdbx\/blob\/35313d18bce36e9306c12bd3674e7fbe15eebb55\/GNUmakefile#L81-L86\" rel=\"nofollow\">\u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">echo '#define MDBX_BUILD_COMPILER &quot;$(shell set -o pipefail; $(CC) --version | head -1 || echo 'Please use GCC or CLANG compatible compiler')&quot;'<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0412 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 \u043d\u0430 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u0439<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u0417\u0434\u0435\u0441\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0434\u043b\u044f <a href=\"https:\/\/www.opennet.ru\/docs\/RUS\/gnumake\/\" rel=\"nofollow\">GNU Make<\/a> \u0438 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Bash\" rel=\"nofollow\">bash<\/a> \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0443 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043e\u043f\u0446\u0438\u0438 <code>--version<\/code> \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0442\u043e \u043e\u043d \u0442\u0430\u043a\u043e\u0439, \u0430 \u0435\u0441\u043b\u0438 \u043e\u043f\u0446\u0438\u044f \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0442\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0430 <em>&quot;Please use GCC or CLANG compatible compiler&quot;<\/em>.<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Boilerplate_code\" rel=\"nofollow\">boilerplate<\/a> \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0433\u0434\u0435 \u0443\u0433\u043e\u0434\u043d\u043e. \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043e\u043d \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0434\u0430\u0432\u043d\u043e \u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0432\u0435\u0437\u0434\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b (Linux, Solaris, OSX, FreeBSD, <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Windows_Subsystem_for_Linux\" rel=\"nofollow\">WSL<\/a> \u0438 \u0442.\u0434.). \u041d\u043e \u0432\u0447\u0435\u0440\u0430 \u0432 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/ALT_Linux_(%D0%B4%D0%B8%D1%81%D1%82%D1%80%D0%B8%D0%B1%D1%83%D1%82%D0%B8%D0%B2_Linux)\" rel=\"nofollow\">AltLinux<\/a> \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%AD%D0%BB%D1%8C%D0%B1%D1%80%D1%83%D1%81_2000\" rel=\"nofollow\">\u042d\u043b\u044c\u0431\u0440\u0443\u0301\u0441 2000 (E2K)<\/a> \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b: <\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">#define MDBX_BUILD_COMPILER &quot;lcc:1.23.20:Sep--4-2019:e2k-v3-linux Please use GCC or CLANG compatible compiler&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0437\u043d\u0430\u0442\u044c\u0441\u044f \u044f \u043d\u0435 \u0441\u0440\u0430\u0437\u0443 \u0440\u0430\u0437\u0433\u043b\u044f\u0434\u0435\u043b \u0441\u0442\u0430\u0440\u043e\u0433\u043e &quot;\u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0433\u043e&quot;. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043f\u0440\u043e\u0435\u043a\u0442 \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0441\u044f \u043d\u0430 &quot;\u042d\u043b\u044c\u0431\u0440\u0443\u0441\u0430\u0445&quot; \u0438 \u043f\u043e\u0434 \u043c\u0430\u0441\u0441\u043e\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441 &quot;\u0410\u043b\u044c\u0442\u043e\u043c&quot;. \u0421 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438, \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 GNU Make \u0438 bash. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0432\u043e\u0435\u0439 \u043e\u043f\u043b\u043e\u0448\u043d\u043e\u0441\u0442\u0438 \u044f \u0442\u0443\u0442 \u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0445\u043e\u0442\u0435\u043b.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0438\/\u0438\u043b\u0438 \u043f\u043e\u043d\u044f\u0442\u044c \u0432 \u0447\u0435\u043c \u0434\u0435\u043b\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u0442\u0430\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435.<br \/>  \u0417\u0430\u043a\u043b\u0438\u043d\u0430\u043d\u0438\u0435 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">echo &quot;#define MDBX_BUILD_COMPILER '$(set -o pipefail; LC_ALL=C cc --version | head -1 || echo \\&quot;Please use GCC or CLANG compatible compiler\\&quot;)'&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0435\u0440\u0435\u0437-\u0440\u0430\u0437 \u0442\u043e \u0432\u044b\u0434\u0430\u0432\u0430\u043b\u043e \u043b\u0438\u0448\u043d\u0438\u0439 \u0442\u0435\u043a\u0441\u0442, \u0442\u043e \u043d\u0435\u0442\u2026 \u041d\u0435\u0440\u0435\u0434\u043a\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0437\u0430\u043b\u0438\u043f\u0430\u043b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0433\u043e, \u043d\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u0442\u044b\u043a\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u043b\u044c\u0448\u0435 \u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0438\u0441\u044c \u043e\u0431\u0430!<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, <a href=\"https:\/\/en.wikipedia.org\/wiki\/Strace\" rel=\"nofollow\"><code>strace<\/code><\/a> \u043d\u0430\u0448\u0435 \u0432\u0441\u0451! \u0418 \u0432\u043e\u0442 \u043d\u0430\u0431\u0440\u0430\u0432 strace-\u0442\u0438\u0440\u0430\u0434\u0443, \u043d\u043e \u043d\u0435 \u0443\u0441\u043f\u0435\u0432 \u043d\u0430\u0436\u0430\u0442\u044c Enter \u044f \u0443\u0437\u043d\u0430\u043b \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0433\u043e \u043c\u0438\u0441\u0442\u0435\u0440\u0430 \u0413\u0435\u0439\u0437\u0435\u043d\u0431\u0430\u0433\u0430, \u0430 \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u0445 <a href=\"https:\/\/www.altlinux.org\/%D0%AD%D0%BB%D1%8C%D0%B1%D1%80%D1%83%D1%81\/lcc\" rel=\"nofollow\">\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430<\/a> \u0441\u0435\u0431\u044f \u0441\u0430\u043c\u043e\u0433\u043e 25 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434, <a href=\"https:\/\/www.youtube.com\/watch?v=PeShS2kxDJ0\" rel=\"nofollow\">Nostalgie&#8230;<\/a> \u0418 \u0440\u0435\u0448\u0438\u043b <del>\u0432\u0437\u0433\u0440\u0443\u0441\u0442\u043d\u0443\u0442\u044c<\/del> \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0443 \u0437\u0430\u043c\u0435\u0442\u043a\u0443 \ud83d\ude09<\/p>\n<p>  <\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043a\u0430\u043a \u043b\u044e\u0431\u043e\u0439 \u0443\u0432\u0430\u0436\u0430\u044e\u0449\u0438\u0439 \u0441\u0435\u0431\u044f <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%93%D0%B5%D0%B9%D0%B7%D0%B5%D0%BD%D0%B1%D0%B0%D0%B3\" rel=\"nofollow\">\u0413\u0435\u0439\u0437\u0435\u043d\u0431\u0430\u0433<\/a>, \u043f\u043e\u0434 <code>strace<\/code> \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0435\u0442 \u043d\u0435 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>  <\/p>\n<h4 id=\"tak-chto-zhe-proishodit\">\u0422\u0430\u043a \u0447\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?<\/h4>\n<p>  <\/p>\n<ul>\n<li>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 <code>head<\/code> \u0432\u043f\u0440\u0430\u0432\u0435 (\u0441\u043a\u043e\u0440\u0435\u0435 \u0434\u0430\u0436\u0435 \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d\u0430) \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u043a\u0430\u043d\u0430\u043b, \u0441\u0440\u0430\u0437\u0443 \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a.<\/li>\n<li>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430-\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044c (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>cc<\/code>) <em>\u043c\u043e\u0436\u0435\u0442<\/em> \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u0438 <em>\u0432\u043e\u043b\u044c\u043d\u0430<\/em> \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <code>write()<\/code>.<\/li>\n<li><em>\u0415\u0441\u043b\u0438<\/em> \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0443\u0441\u043f\u0435\u0435\u0442 \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u043a\u0430\u043d\u0430\u043b \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0434\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044f, \u0442\u043e \u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u0438\u043b\u0435\u0442\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0430.<\/li>\n<li>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430-\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044c <em>\u0432\u043f\u0440\u0430\u0432\u0435<\/em> \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043a\u0430\u043d\u0430\u043b, \u0442\u0430\u043a \u0438 \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u044c \u0435\u0451 \u0432 \u0441\u0432\u043e\u0435\u043c \u043a\u043e\u0434\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f.<\/li>\n<li>\u0412\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 <code>set -o pipefail<\/code> \u043a\u043e\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u043c (\u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u043c) \u043f\u0440\u0438 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u043e\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0438 \u0442\u043e\u0433\u0434\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <code>|| echo &quot;Please use GCC or CLANG compatible compiler&quot;<\/code>.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430-\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0441\u0438\u0433\u043d\u0430\u043b\u0430\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430 (\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e\/\u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f), \u043b\u0438\u0431\u043e <code>write()<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0431\u0430\u0439\u0442\u043e\u0432 \u0447\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043e \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 <code>errno = EPIPE<\/code>.<\/p>\n<p>  <\/p>\n<h4 id=\"kto-vinovat\">\u041a\u0442\u043e \u0432\u0438\u043d\u043e\u0432\u0430\u0442?<\/h4>\n<p>  <\/p>\n<p><strong>\u041d\u0438\u043a\u0442\u043e, \u043a\u0440\u043e\u043c\u0435 \u043c\u0435\u043d\u044f<\/strong> \u0432 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 <code>cc<\/code> (lcc:1.23.20:Sep&#8212;4-2019:e2k-v3-linux) <em>\u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0439<\/em> \u0438 \u044f \u043d\u0435 \u043d\u0430\u043c\u0435\u0440\u0435\u043d \u0437\u0430\u0441\u043e\u0440\u044f\u0442\u044c \u0431\u0430\u0433\u0437\u0438\u043b\u043b\u0443. \u0412 \u0446\u0435\u043b\u043e\u043c \u044d\u0442\u043e \u0432\u0435\u0440\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434, \u0445\u043e\u0442\u044f \u0438 \u0432\u044b\u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u044b\u0435 \u043d\u0435\u0434\u043e\u0447\u0435\u0442\u044b \u0432 boilerplate.<\/p>\n<p>  <\/p>\n<h4 id=\"chto-delat\">\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c?<\/h4>\n<p>  <\/p>\n<p>\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">fortune | head -1 &amp;&amp; echo &quot;\u041f\u043e\u0432\u0435\u0437\u043b\u043e, \u043d\u043e \u0432\u044b \u0440\u0438\u0441\u043a\u0443\u0435\u0442\u0435!&quot; || echo &quot;WTF?&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">fortune | cat - | head -1 &amp;&amp; echo &quot;\u0423\u0441\u043f\u0435\u0448\u043d\u043e&quot; || echo &quot;\u041e\u0448\u0438\u0431\u043a\u0430&quot;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041b\u0438\u0431\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">(fortune &amp;&amp; echo &quot;\u0423\u0441\u043f\u0435\u0448\u043d\u043e&quot; || echo &quot;\u041e\u0448\u0438\u0431\u043a\u0430&quot;) | head -1<\/code><\/pre>\n<p>  <\/p>\n<hr>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0441\u043b\u0443\u0447\u0430\u0435\u043c \u0445\u043e\u0447\u0443 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u0438\u0432\u0430\u043c <a href=\"http:\/\/www.mcst.ru\/\" rel=\"nofollow\">\u041c\u0426\u0421\u0422<\/a> \u0438 <a href=\"https:\/\/www.basealt.ru\/\" rel=\"nofollow\">AltLinux<\/a> \u0437\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u0443\u044e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u0412\u0430\u0448\u0430 \u0446\u0435\u043b\u0435\u0443\u0441\u0442\u0440\u0435\u043c\u043b\u0451\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0441\u0445\u0438\u0449\u0430\u0435\u0442!<br \/>  \u0422\u0430\u043a \u0434\u0435\u0440\u0436\u0430\u0442\u044c Camarades, \u0434\u043e <a href=\"https:\/\/www.basealt.ru\/about\/news\/archive\/view\/semnadcataja-konferencija-razrabotchikov-svobodnykh-prog\/\" rel=\"nofollow\">\u0432\u0441\u0442\u0440\u0435\u0447\u0438 \u043e\u0441\u0435\u043d\u044c\u044e<\/a>!<\/p>\n<p>  <\/p>\n<p>\u041a\u0414\u041f\u0412 \u043e\u0442 <a href=\"https:\/\/yandex.ru\/collections\/user\/kislorod001\/\" rel=\"nofollow\">\u0413\u0435\u043e\u0440\u0433\u0438\u0439 \u0410.<\/a><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/507142\/\"> https:\/\/habr.com\/ru\/post\/507142\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/507142\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/eo\/bc\/id\/eobciddyw-criwjg-08elhsj0lo.jpeg\"><\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$&gt; set -o pipefail  $&gt; fortune | head -1 &gt; \/dev\/null &amp;&amp; echo &quot;\u041f\u043e\u0432\u0435\u0437\u043b\u043e!&quot; || echo &quot;\u0412\u044b \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b\u0438&quot; \u041f\u043e\u0432\u0435\u0437\u043b\u043e!  $&gt; fortune | head -1 &gt; \/dev\/null &amp;&amp; echo &quot;\u041f\u043e\u0432\u0435\u0437\u043b\u043e!&quot; || echo &quot;\u0412\u044b \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b\u0438&quot; \u0412\u044b \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b\u0438<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c <code>fortune<\/code> \u0443\u0441\u043b\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0431\u0435\u0437 <code>exit(rand())<\/code>.<\/p>\n<p>  <\/p>\n<h2 id=\"cmozhete-obyasnit\">C\u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c?<\/h2>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-305556","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=305556"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305556\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=305556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=305556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}