<?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: &amp;quot;Hang&amp;quot; on return in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163275#M26389</link>
    <description>fwiw...&lt;BR /&gt;&lt;BR /&gt;There is (oddly?) no standard tool to do SET PROC/WAKE/ID=...&lt;BR /&gt;&lt;BR /&gt;Here is a trivial 'wake' tool.&lt;BR /&gt;&lt;BR /&gt;$ type wake.c&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;int pid, sys$wake();&lt;BR /&gt;main (int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;   sscanf( argv[1], "%X", &amp;amp;pid);&lt;BR /&gt;   return sys$wake(&amp;amp;pid,0);&lt;BR /&gt;}&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;And here is that tool in a test:&lt;BR /&gt;&lt;BR /&gt;$ type hiber.c&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;int sys$hiber();&lt;BR /&gt;main ()&lt;BR /&gt;{&lt;BR /&gt;   printf ("Hiber for %08X\n", getpid());&lt;BR /&gt;   sys$hiber();&lt;BR /&gt;   printf ("Goodbye.\n");&lt;BR /&gt;}&lt;BR /&gt;$&lt;BR /&gt;$ spawn/nowait run hiber&lt;BR /&gt;%DCL-S-SPAWNED, process HEIN_7111 spawned&lt;BR /&gt;$&lt;BR /&gt;  Hiber for 00000497&lt;BR /&gt;$&lt;BR /&gt;$ mcr sys$login:wake 497&lt;BR /&gt;Goodbye.&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;Goodbye,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;/STDIO.H&gt;&lt;/UNISTD.H&gt;&lt;/STDIO.H&gt;</description>
    <pubDate>Fri, 13 Mar 2009 15:07:25 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2009-03-13T15:07:25Z</dc:date>
    <item>
      <title>"Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163267#M26381</link>
      <description>VMS 7.3-2, Alpha&lt;BR /&gt;Login as TMG1_WILLEM (low-priv user), execute a command:&lt;BR /&gt;&lt;BR /&gt;$ SPAWN PIPE SETP tomg2 ; &lt;PROCEDURE&gt; ; SETENV TOMG1 &lt;BR /&gt;&lt;BR /&gt;SETENV is a procedure that changes the process and job environment to fit a particular environemnt, different from login: UIC, default, logicals, process rights and privileges (both AUTHORIZED and DEFAULT), using two (privileged) images and DCL. The user does have an account in this environment (TMG2_WILLEM) but can not normally log in directly into this environment.&lt;BR /&gt;&lt;PROCEDURE&gt; is executed in the context of user TMG2_willem - with elevated privileges.&lt;BR /&gt;&lt;BR /&gt;The source of the original images is lost, and the functionality has been reverse-engineered from the original, by examining what it does to process end job environment.&lt;BR /&gt;In most cases, it seems to work fine. Changes in the process environment can be observed in the attachment.&lt;BR /&gt;&lt;BR /&gt;However, above code sequence shows that there is still a difference to be handled.&lt;BR /&gt;Using the old images, it doesn't matter if &lt;PROCEDURE&gt; fails causing an $ EXIT; the subprocess will end and control will be returned to the main process (though the changes in the job environment will still be there). The new images however cause the main process to hang, and the process needs to be killed (^C nor ^Y have any effect).&lt;BR /&gt;&lt;BR /&gt;It seems to me that the subprocess does not signal the main process of it's termination.&lt;BR /&gt;&lt;BR /&gt;I also tried (to check process and devices:&lt;BR /&gt;&lt;BR /&gt;$ SPAWN PIPE SETP TOMG2 ; ANA/SYS&lt;BR /&gt;&lt;BR /&gt;and this also causes the main process to hang when SDA is exited, no matter how, when the new images are used.&lt;BR /&gt;&lt;BR /&gt;My thought is there must be some protection that needs to be altered, or an ACE added, (like I did on TT:) to signal the end of the subprocess, but I couldn't locate anything.&lt;BR /&gt;&lt;BR /&gt;Any idea on how to find out what device may be inaccessible?&lt;BR /&gt;&lt;/PROCEDURE&gt;&lt;/PROCEDURE&gt;&lt;/PROCEDURE&gt;</description>
      <pubDate>Fri, 13 Mar 2009 11:06:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163267#M26381</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-03-13T11:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163268#M26382</link>
      <description>No immediate help, just a couple of question which may help others.&lt;BR /&gt;&lt;BR /&gt;First, roughly, what does the new code do? Straight system service calls (impersonate!) or kernel mode hackery twidlling bits in Process control blocks, process headers?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;  TMG1_WILLEM (low-priv user), &lt;BR /&gt;&lt;BR /&gt;It looks to me that this username has all the priviliges in the world: CMKRNL (useful to grab any other priv, and to issue SET UIC), and WORLD and so on. Not low-priv and does nto need an installed helper.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; $ SPAWN PIPE &lt;BR /&gt;&lt;BR /&gt;What is the purpose of the SPAWN before the pipe?&lt;BR /&gt;&lt;BR /&gt;Are there DETACHED processes, or just changed to the sub-processed.&lt;BR /&gt;&lt;BR /&gt;I suspect that one of the processes is waiting for a MAILBOX message. Use ANALYZE/SYSTEM and SHOW PROC/CHAN looking for 'busy'. You may also want to use the SDA MBX extention.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps a little,&lt;BR /&gt;&lt;BR /&gt;Groetjes,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Mar 2009 11:58:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163268#M26382</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-03-13T11:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163269#M26383</link>
      <description>Does it stop when you wait about 10 minutes ?&lt;BR /&gt;&lt;BR /&gt;Does it use T2T ? If the receiver does an exit without reading/closing sys$net it will receive a wait of 5 minutes (was on VMS 6.2).&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Fri, 13 Mar 2009 13:09:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163269#M26383</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2009-03-13T13:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163270#M26384</link>
      <description>Actions of the new code: just what the old image seems to be doing (according SHOW PROCESS/ALL output and other information gathered), but basically as described in the attachment. No impersonation, plain system calls and direct access into system structures as well.&lt;BR /&gt;The images in the procedure are installed with the privs required, so any user can run the procedures, without elevated privs.&lt;BR /&gt;on SPAWN PIPE....The original sequence I got changes environment, copies a file in that environment that is otherwise inaccessible, changes ownership of this copy, restores the original environment and exits - as a single entity. There are other ways to achieve this but this is the code used in the production environment.&lt;BR /&gt;On mailbox: I guess so: My idea is that writing a message to a termination mailbox fails because the process' UIC has changed. However, I just noticed that the original program may change the process-UIC as well - but probably just in the process context, not in the JIB (as the new code does).&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Mar 2009 13:19:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163270#M26384</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-03-13T13:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163271#M26385</link>
      <description>Wim: hasn't been mentioned; worth giving it a try (but I think it won't stop)&lt;BR /&gt;No T2T - what's T2T? - AFAIK.</description>
      <pubDate>Fri, 13 Mar 2009 13:24:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163271#M26385</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-03-13T13:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163272#M26386</link>
      <description>T2T + SYS$NET = task to task. Could have thought about that: No, not involved.</description>
      <pubDate>Fri, 13 Mar 2009 13:26:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163272#M26386</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-03-13T13:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163273#M26387</link>
      <description>&lt;!--!*#--&gt;Wim; waited half an hour but still no reaction: subprocess is stopped, main process remains in HIB, no open channels.&lt;BR /&gt;&lt;BR /&gt;I looked into ACC for the last attempt ($ SPAWN PIPE SETENV TOMG2 ; ANA/SYS), that I stopped with ^Z (normal exit). It didn't return either, this is what ACC returns on this proces:&lt;BR /&gt;&lt;BR /&gt;SUBPROCESS Process Termination&lt;BR /&gt;------------------------------&lt;BR /&gt;Username:          TMG1_WILLEM       UIC:               [TMG2_P,TMG2_WILLEM]&lt;BR /&gt;Account:           TMG1_P            Finish time:       13-MAR-2009 15:06:17.30&lt;BR /&gt;Process ID:        20200155          Start time:        13-MAR-2009 15:06:12.64&lt;BR /&gt;Owner ID:          20200154          Elapsed time:                0 00:00:04.65&lt;BR /&gt;Terminal name:                       Processor time:              0 00:00:03.76&lt;BR /&gt;Remote node addr:                    Priority:          4&lt;BR /&gt;Remote node name:                    Privilege &amp;lt;31-00&amp;gt;: 521DB02D&lt;BR /&gt;Remote ID:                           Privilege &amp;lt;63-32&amp;gt;: 00000000&lt;BR /&gt;Remote full name:&lt;BR /&gt;Posix UID:         -2                Posix GID:         -2 (%XFFFFFFFE)&lt;BR /&gt;Queue entry:                         Final status code: 00F48009&lt;BR /&gt;Queue name:&lt;BR /&gt;Job name:&lt;BR /&gt;Final status text: &lt;NO text=""&gt;&lt;BR /&gt;Page faults:              479        Direct IO:                101&lt;BR /&gt;Page fault reads:          87        Buffered IO:              183&lt;BR /&gt;Peak working set:        5632        Volumes mounted:            0&lt;BR /&gt;Peak page file:        172912        Images executed:            7&lt;BR /&gt;&lt;/NO&gt;</description>
      <pubDate>Fri, 13 Mar 2009 14:00:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163273#M26387</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-03-13T14:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163274#M26388</link>
      <description>&lt;BR /&gt;The status is just the ANALYZE/SYSTEM you used:&lt;BR /&gt;&lt;BR /&gt;$ write sys$output f$mess(%x00F48009)&lt;BR /&gt;%SDA-S-NOMSG, Message number 00F48009&lt;BR /&gt;&lt;BR /&gt;The HIBER state is interesting.&lt;BR /&gt;It suggests it is NOT having a (mailbox) IO outstanding, but it may have an attention AST ready to fire. So I woudl still check for the channels and such.&lt;BR /&gt;&lt;BR /&gt;Have just tried whether a simple $WAKE call will make it happy?&lt;BR /&gt;&lt;BR /&gt;Does the tool need to have a SYS$WAKE call, to add a 'pending' wake, or use SYS$SCHDWK 'just in case'?&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Mar 2009 14:53:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163274#M26388</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-03-13T14:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163275#M26389</link>
      <description>fwiw...&lt;BR /&gt;&lt;BR /&gt;There is (oddly?) no standard tool to do SET PROC/WAKE/ID=...&lt;BR /&gt;&lt;BR /&gt;Here is a trivial 'wake' tool.&lt;BR /&gt;&lt;BR /&gt;$ type wake.c&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;int pid, sys$wake();&lt;BR /&gt;main (int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;   sscanf( argv[1], "%X", &amp;amp;pid);&lt;BR /&gt;   return sys$wake(&amp;amp;pid,0);&lt;BR /&gt;}&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;And here is that tool in a test:&lt;BR /&gt;&lt;BR /&gt;$ type hiber.c&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;int sys$hiber();&lt;BR /&gt;main ()&lt;BR /&gt;{&lt;BR /&gt;   printf ("Hiber for %08X\n", getpid());&lt;BR /&gt;   sys$hiber();&lt;BR /&gt;   printf ("Goodbye.\n");&lt;BR /&gt;}&lt;BR /&gt;$&lt;BR /&gt;$ spawn/nowait run hiber&lt;BR /&gt;%DCL-S-SPAWNED, process HEIN_7111 spawned&lt;BR /&gt;$&lt;BR /&gt;  Hiber for 00000497&lt;BR /&gt;$&lt;BR /&gt;$ mcr sys$login:wake 497&lt;BR /&gt;Goodbye.&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;Goodbye,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;/STDIO.H&gt;&lt;/UNISTD.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 13 Mar 2009 15:07:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163275#M26389</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-03-13T15:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163276#M26390</link>
      <description>Willem,&lt;BR /&gt;&lt;BR /&gt;is this SETENV the same as the one used in the environment we both have in our history? &lt;BR /&gt;If YES, then you probable should contact Oswald. &lt;BR /&gt;I no longer have the direct contact info, but I think you will know where to find him.&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Fri, 13 Mar 2009 15:12:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163276#M26390</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2009-03-13T15:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163277#M26391</link>
      <description>Willem,&lt;BR /&gt;&lt;BR /&gt;Rather than trying to plug all the inevitable holes in your SETENV utility (it will be a never ending task!), why not do this using existing, working and supported mechanisms?&lt;BR /&gt;&lt;BR /&gt;First thing that springs to mind is:&lt;BR /&gt;&lt;BR /&gt;$ SUBMIT/USER=TOMG2 &lt;PROCEDURE&gt;&lt;BR /&gt;$ SYNCHRONIZE/ENTRY='$ENTRY'&lt;BR /&gt;$ stat=$STATUS&lt;BR /&gt;&lt;BR /&gt;Yes, SUBMIT/USER is a privileged command, but you have the required privileges.&lt;BR /&gt;&lt;BR /&gt;There are many other possibilities.&lt;/PROCEDURE&gt;</description>
      <pubDate>Mon, 16 Mar 2009 02:08:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163277#M26391</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2009-03-16T02:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163278#M26392</link>
      <description>Hein: There is no SET PROCESS/HIBER either, so I'm not surprised ;)&lt;BR /&gt;Jan: No, entirely different&lt;BR /&gt;John: this might be a better solution _in this case_  but it's not always applicable. The same sequence can be executed by non-privileged users in which case SUBMIT/USER is not possible. Besides - the method has been in use over 10 years and is embedded in quite a few (production) scripts....</description>
      <pubDate>Mon, 16 Mar 2009 06:48:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163278#M26392</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-03-16T06:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163279#M26393</link>
      <description>set mes sys$message:prgdevmsg.exe&lt;BR /&gt;write sys$output f$mes(%xf48009)&lt;BR /&gt;%SDA-S-SUCCESS, success&lt;BR /&gt;&lt;BR /&gt;fwiw&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Mon, 16 Mar 2009 06:57:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163279#M26393</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2009-03-16T06:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163280#M26394</link>
      <description>Wim: Obvious :).  The problem is not SDA or any command or script executed when SETENV is run, but what happens id the subprocess is stopped (no matter what way). Normal exit of SDA will fail to wakeup the main process when the new exe is used, where the old one works fine.&lt;BR /&gt;&lt;BR /&gt;I've done some more investigation with two processes; one using the old image, the other using the new. In both; I executed SPAWN and SETENV; then, I analyzed the system and rercorded JIB, PCB and PHD, and compared the outcome (just the labels and values; addresses removed. The result v=can be found in the attachement. Most differences are obvious, but I do have one that I could not explain; that one is a few lines below PCB$L_INITIAL_KTB in the form,marked "******"in the center.&lt;BR /&gt;&lt;BR /&gt;Could it be that some P1 data needs to be altered? If so,what would I need to look at?</description>
      <pubDate>Mon, 16 Mar 2009 12:35:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163280#M26394</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-03-16T12:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163281#M26395</link>
      <description>Among other wrinkles, I've seen all manner of ownership and logical name table and mailbox issues when SPAWN is involve such as often arises within a PIPE.   &lt;BR /&gt;&lt;BR /&gt;DCL does not expect processes to swap identities on the fly.  &lt;BR /&gt;&lt;BR /&gt;SET UIC (deprecated) regularly blows up processing with DCL, for instance.&lt;BR /&gt;&lt;BR /&gt;Spoofing code also tends to break at upgrades.&lt;BR /&gt;&lt;BR /&gt;And some of the spoofing code I've reviewed has introduced more and larger security holes than its authors had intended to plug.&lt;BR /&gt;&lt;BR /&gt;Find and use another way to reach your goals here.   Create a server and pass command(s) into it.  Or better (since passing in user commands is a path for injection) pass in requests or codes using a fixed and known grammar.&lt;BR /&gt;&lt;BR /&gt;And yes, I know you'll ignore the comments here.  Why?  Well, I ignored the folks that tried to tell me this, too.  A design that allows spoofing the user security context on the fly in an interactive or command-level environment is generally somewhere between a Really Bad Idea and a Massively Bad Idea.  (qv: XSS, SQLI, etc.)  Simplify the design.  Mailboxes and hangs are the least of the issues.&lt;BR /&gt;&lt;BR /&gt;Put another way, I'd suggest a redesign here.  It'll be easier to support, easier to maintain, easier to lock down, and the results will survive upgrades.</description>
      <pubDate>Mon, 16 Mar 2009 13:04:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163281#M26395</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2009-03-16T13:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163282#M26396</link>
      <description>Hoff: I fully agree that redesign (of the whole environment) is the right way to go and if I had the chance of doing so, I would follow that direction. But I'm not in charge in planning or architecture of this project and just have to get things working, to meet the requirement that 'existing code should work unchanged'. No doubt that sounds familiar :( .&lt;BR /&gt;&lt;BR /&gt;We're well on the way for that: &lt;BR /&gt;Without SPAWN, it's fine. &lt;BR /&gt;With SPAWN, it's fine once the situation is set back to normal. But if the subprocess finishes before that, the main process is not notified.  There must be something within VMS that causes this to happen; the only question is: What. &lt;BR /&gt;&lt;BR /&gt;(Once I know that, the program could be altered to work properly. That will be the last change made to the code - further maintenance is not foreseen.)</description>
      <pubDate>Mon, 16 Mar 2009 14:31:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163282#M26396</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-03-16T14:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163283#M26397</link>
      <description>&lt;!--!*#--&gt;Your problem is because after your SETENV the sub-process no longer has write access to its termination mailbox.  The parent process is waiting with a write-attention AST on this mailbox and will not continue until a process termination accounting record is written there.&lt;BR /&gt;&lt;BR /&gt;This is easy to demonstrate:&lt;BR /&gt;$ SPAWN&lt;BR /&gt;%DCL-S-SPAWNED, process GOODMAN_55891 spawned&lt;BR /&gt;%DCL-S-ATTACHED, terminal now attached to process GOODMAN_55891&lt;BR /&gt;&lt;BR /&gt;$ SET UIC [100,1]&lt;BR /&gt;$ SET PROCESS/PRIV=NOBYPASS&lt;BR /&gt;$ LOG&lt;BR /&gt;  Process GOODMAN_55891 logged out at 16-MAR-2009 17:37:05&lt;BR /&gt;&lt;BR /&gt;(parent process hangs)&lt;BR /&gt;--------------------------------------------&lt;BR /&gt;$ SPAWN&lt;BR /&gt;%DCL-S-SPAWNED, process GOODMAN_13828 spawned&lt;BR /&gt;%DCL-S-ATTACHED, terminal now attached to process GOODMAN_13828&lt;BR /&gt;$ SAY F$GETJPI(0,"TMBU")&lt;BR /&gt;3078&lt;BR /&gt;$ SHOW DEVICE/FUL MBA3078:&lt;BR /&gt;&lt;BR /&gt;Device MBA3078:, device type local memory mailbox, is online, record-oriented&lt;BR /&gt;    device, shareable, mailbox device.&lt;BR /&gt;&lt;BR /&gt;    Error count                    0    Operations completed                  1&lt;BR /&gt;    Owner process                 ""    Owner UIC               [STAFF,GOODMAN]&lt;BR /&gt;    Owner process ID        00000000    Dev Prot                   S,O:RWPL,G,W&lt;BR /&gt;    Reference count                1    Default buffer size                 256&lt;BR /&gt;&lt;BR /&gt;$ SET SECURITY /CLASS=DEVICE MBA3078: /PROTECTION=W:RWED&lt;BR /&gt;$ SET UIC [100,1]&lt;BR /&gt;$ SET PROCESS/PRIV=NOBYPASS&lt;BR /&gt;$ LOG&lt;BR /&gt;  Process GOODMAN_13828 logged out at 16-MAR-2009 17:43:11&lt;BR /&gt;%DCL-S-RETURNED, control returned to process GOODMAN&lt;BR /&gt;$&lt;BR /&gt;(parent process resumes)</description>
      <pubDate>Mon, 16 Mar 2009 16:44:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163283#M26397</guid>
      <dc:creator>Jess Goodman</dc:creator>
      <dc:date>2009-03-16T16:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163284#M26398</link>
      <description>Hi Jess,&lt;BR /&gt;&lt;BR /&gt;Thanks for confirming what several suspected. &lt;BR /&gt;Nice &amp;amp; easy reproducer. So the solution for Wim will be to add code to change the process termination mailbox protection or owner.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;JPI$_TMBU&lt;BR /&gt;Returns the termination mailbox unit number, which is a longword integer value.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Mar 2009 17:00:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163284#M26398</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-03-16T17:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163285#M26399</link>
      <description>Willem,&lt;BR /&gt;&lt;BR /&gt;  (not sure why I bother answering your questions when you invariably ignore the advice, but anyway...)&lt;BR /&gt;&lt;BR /&gt;  OK, so the problem is really that your procedure exits abnormally, preventing your SETENV from reverting to the old environment, so it can't write to the mailbox etc...&lt;BR /&gt;&lt;BR /&gt;  Rather than trying to fix the flawed mechanism, how about trying to ensure the reversion happens regardless of what the procedure does? Since I don't know the nature of what it's doing, or how its failing, here are a few suggestions:&lt;BR /&gt;&lt;BR /&gt;$ SPAWN PIPE SETP tomg2 ; SET NOON ; &lt;PROCEDURE&gt; ; SETENV TOMG1 &lt;BR /&gt;&lt;BR /&gt;$ SPAWN PIPE SETP tomg2 ; SPAWN @procedure ; SETENV TOMG1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Failing that, you could use a big hammer and fix the protection on the mailbox prior to fiddling the UIC. Of course, this opens a potential security hole of sorts, as anyone will be able to write to the mailbox&lt;BR /&gt;&lt;BR /&gt;$ SPAWN PIPE SET SECURITY/CLASS=DEVICE/PROTECTION=(W:RW) DCL$ATTACH_'F$GETJPI("","PID")' ; SETP tomg2 ; &lt;PROCEDURE&gt; ; SETENV TOMG1 &lt;BR /&gt;&lt;BR /&gt;Note that the F$GETJPI executes in the context of the parent process, so it gets the correct mailbox name.&lt;BR /&gt;&lt;BR /&gt;To plug the security hole you could insert an ACE granting access only to the user to which you're going to SETP, rather than the blunt instrument "W:RW". Once that's done, you may even be able to eliminate the SETENV to revert.&lt;/PROCEDURE&gt;&lt;/PROCEDURE&gt;</description>
      <pubDate>Mon, 16 Mar 2009 21:09:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163285#M26399</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2009-03-16T21:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: "Hang" on return</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163286#M26400</link>
      <description>Jess: I already suspected that, just the point how to get that device ....&lt;BR /&gt;Hein: That will do for that; I already add an ACE to the terminal, I can easily add another device :)&lt;BR /&gt;John: See my comment on Hoff. I can't change things here. &lt;BR /&gt;Your last suggestion on how to change the ACL on the termination mailbox is what I will insert.</description>
      <pubDate>Tue, 17 Mar 2009 07:01:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/quot-hang-quot-on-return/m-p/5163286#M26400</guid>
      <dc:creator>Willem Grooters</dc:creator>
      <dc:date>2009-03-17T07:01:42Z</dc:date>
    </item>
  </channel>
</rss>

