<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why SQLite does not work on OpenVMS in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/why-sqlite-does-not-work-on-openvms/m-p/5874875#M37029</link>
    <description>&lt;DIV&gt;Running one instance of the pointed-to example test-fcntl for about 2 seconds (elapsed) &amp;nbsp;results in&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;...&lt;/FONT&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;Locking x.db ...&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;Unlocking x.db ...&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;Locking x.db ...&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;Unlocking x.db ...&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;Could not unlock x.db. Error : error 0&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;$&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;From what I conclude that this test program does show a problem but it very likely is not a - and seems unrelated to a (possible) SQLite3 or CRTL - deadlock problem. However, if I modify the sources to lock and unlock the very same range (no matter whether I set a reasonable file offset into l_start or not) two instances run and run and run and ... happily taking over the 2 CPUs of a DS20 running V8.3.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;$ mc GNV$GNU:[bin]diff -u test-fcntl.c~ test-fcntl.c&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;--- test-fcntl.c~ &amp;nbsp; &amp;nbsp; &amp;nbsp; Wed Nov 21 12:33:30 2012&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;+++ test-fcntl.c &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Wed Nov 21 12:47:35 2012&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;@@ -10,16 +10,7 @@&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;static int unixFileLock(int fd,int action)&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;{&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int rc;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;struct flock lock;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;-&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;lock.l_whence = SEEK_SET;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;if (action == F_UNLCK){&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lock.l_start=0;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lock.l_len = 0;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;} else {&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lock.l_start=SHARED_SIZE;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lock.l_len = 1;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;static struct flock lock = {0, SEEK_SET, 0, SHARED_SIZE};&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lock.l_type = action;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rc = fcntl(fd, F_SETLK, &amp;amp;lock);&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return rc;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;$&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 21 Nov 2012 19:12:28 GMT</pubDate>
    <dc:creator>H.Becker</dc:creator>
    <dc:date>2012-11-21T19:12:28Z</dc:date>
    <item>
      <title>Why SQLite does not work on OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/why-sqlite-does-not-work-on-openvms/m-p/5873367#M37028</link>
      <description>&lt;P&gt;Sure facts: &lt;A href="http://vouters.dyndns.org/tima/OpenVMS-SQLite-A_possible-reason_why_SQLite_does_not_work_under_OpenVMS.html" target="_blank"&gt;http://vouters.dyndns.org/tima/OpenVMS-SQLite-A_possible-reason_why_SQLite_does_not_work_under_OpenVMS.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Untested: SQLite executed in a threaded environment&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2012 21:21:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/why-sqlite-does-not-work-on-openvms/m-p/5873367#M37028</guid>
      <dc:creator>Ph Vouters</dc:creator>
      <dc:date>2012-11-20T21:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: Why SQLite does not work on OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/why-sqlite-does-not-work-on-openvms/m-p/5874875#M37029</link>
      <description>&lt;DIV&gt;Running one instance of the pointed-to example test-fcntl for about 2 seconds (elapsed) &amp;nbsp;results in&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;...&lt;/FONT&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;Locking x.db ...&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;Unlocking x.db ...&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;Locking x.db ...&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;Unlocking x.db ...&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;Could not unlock x.db. Error : error 0&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;$&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;From what I conclude that this test program does show a problem but it very likely is not a - and seems unrelated to a (possible) SQLite3 or CRTL - deadlock problem. However, if I modify the sources to lock and unlock the very same range (no matter whether I set a reasonable file offset into l_start or not) two instances run and run and run and ... happily taking over the 2 CPUs of a DS20 running V8.3.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;$ mc GNV$GNU:[bin]diff -u test-fcntl.c~ test-fcntl.c&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;--- test-fcntl.c~ &amp;nbsp; &amp;nbsp; &amp;nbsp; Wed Nov 21 12:33:30 2012&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;+++ test-fcntl.c &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Wed Nov 21 12:47:35 2012&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;@@ -10,16 +10,7 @@&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;static int unixFileLock(int fd,int action)&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;{&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int rc;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;struct flock lock;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;-&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;lock.l_whence = SEEK_SET;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;if (action == F_UNLCK){&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lock.l_start=0;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lock.l_len = 0;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;} else {&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lock.l_start=SHARED_SIZE;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lock.l_len = 1;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;static struct flock lock = {0, SEEK_SET, 0, SHARED_SIZE};&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lock.l_type = action;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rc = fcntl(fd, F_SETLK, &amp;amp;lock);&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return rc;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;$&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 21 Nov 2012 19:12:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/why-sqlite-does-not-work-on-openvms/m-p/5874875#M37029</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2012-11-21T19:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why SQLite does not work on OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/why-sqlite-does-not-work-on-openvms/m-p/5874935#M37030</link>
      <description>&lt;P&gt;Does SQLite work any better with the SSIO beta kit installed?&amp;nbsp; See &lt;A href="http://www.openvms.org/stories.php?story=12/10/15/5186309" target="_blank"&gt;http://www.openvms.org/stories.php?story=12/10/15/5186309&lt;/A&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2012 20:20:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/why-sqlite-does-not-work-on-openvms/m-p/5874935#M37030</guid>
      <dc:creator>Craig A Berry</dc:creator>
      <dc:date>2012-11-21T20:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Why SQLite does not work on OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/why-sqlite-does-not-work-on-openvms/m-p/5883425#M37031</link>
      <description>&lt;P&gt;Harmut,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As usual you do not give your test conditions. In consequence, your conclusions are always unexploitable and subject to caution. I ran the code on several three different VMS IA64 computers. When the test reproducer runs on VMS IA64 V8.4 with latest UPDATE patch, the test reproducer runs forever in a single VMS process. When in a second process you run sqlite&amp;gt; .read sqllite.cmd then the two VMS processes hang. This means even when non-threaded, the test reproducer hangs in such conditions. If you run the test reproducer in one process and sqlite&amp;gt; .read sqllite.cmd in parallel you will notice the hang even on a single CPU running OpenVMS IA64 V8.3 UPDATE 12. If you run the test reproducer in two VMS processses under OpenVMS IA64 V8.4 latest UPDATE, you will notice an apparent hang for a few seconds and one process will display errno = 0 and the other will continue in sequence.&lt;/P&gt;&lt;P&gt;The bug is NOT in the code I show on my Web site. There is a bug within your CRTL/VMS for it to return fcntl set to - 1 and errno set to 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Craig,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I won't beleive SQLite will run much better on OpenVMS whichever the SQLite code is. SQLite depends too much upon file locks. As long as this problem is not cured, SQLite won't run much better on OpenVMS. My guess is that this smells a race condition within the VMS kernel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2012 09:50:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/why-sqlite-does-not-work-on-openvms/m-p/5883425#M37031</guid>
      <dc:creator>Ph Vouters</dc:creator>
      <dc:date>2012-11-29T09:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why SQLite does not work on OpenVMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/why-sqlite-does-not-work-on-openvms/m-p/5884033#M37032</link>
      <description>&lt;DIV&gt;&lt;EM&gt;&amp;gt;&amp;gt; taking over the 2 CPUs of a DS20 running V8.3.&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;gt; As usual you do not give your test conditions&lt;/EM&gt;.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;What else do you need?&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;$ prod show hist&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;%PCSIUI-E-PRIVCLASS1, operation requires SYSLCK privilege&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;%PCSIUI-E-ABORT, operation terminated due to an unrecoverable error condition&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;$ set proc/priv=SYSLCK&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;%SYSTEM-W-NOTALLPRIV, not all requested privileges authorized&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;$ analyze/image decc$shr/sel=(id,b,l)&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;SYS$COMMON:[SYSLIB]DECC$SHR_EV56.EXE;1&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;"V8.3-01"&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;"XBCA-0080070010"&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;1-MAY-2007 07:04:56.15&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier"&gt;$&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Your test-fcntl.c ran into a resource&amp;nbsp;problem: not enough pgflquota, which as you probably know is a shared quota. (Does it ring a bell or what do you mean by "&lt;EM&gt;and sqlite&amp;gt; .read sqllite.cmd&amp;nbsp;in parallel"&lt;/EM&gt;?)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;But you can avoid that problem with just locking and unlocking the very same&amp;nbsp;range, as I tried to point out.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It seems SQLite isn't doing this. And with what I have for testing, I can't&amp;nbsp;reproduce the problem other than running into the pagefile limit.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;gt; this smells a race condition within the VMS kernel&lt;/EM&gt;.&lt;/DIV&gt;&lt;DIV&gt;What do you mean, the system image locking.exe? Possible but unlikely: it's not new and used almost everywhere in VMS. Or rather DECC$SHR aka CRTL,&amp;nbsp;which for user applications is not in the "kernel"? Possible, more likely. But what I see so far is a resource problem.&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Nov 2012 15:55:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/why-sqlite-does-not-work-on-openvms/m-p/5884033#M37032</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2012-11-29T15:55:45Z</dc:date>
    </item>
  </channel>
</rss>

