<div dir="ltr">Well the author at my request was able to remove the call to os.getcwd() which allows the program to operate.<div><br></div><div><br></div><div>If anyone wants to tinker here is an example that will likely break on someones system.  I don't know if this is an LX bug, libc bug, python bug etc.</div><div><br></div><div><div># read a directory, stat all files</div><div><br></div><div>import os</div><div>import sys</div><div>from stat import *</div><div><br></div><div>def chdir(d):</div><div>    global cwdlist</div><div><br></div><div>    if d != '.':</div><div>        os.chdir(d)</div><div>        if d == '..':</div><div>            cwdlist.pop()</div><div>        else:</div><div>            cwdlist.append(d)</div><div>        print repr('/'.join(cwdlist))</div><div>        # Comment the line below to allow things to run</div><div>        os.getcwd()</div><div><br></div><div>def walk(d):</div><div>    chdir(d)</div><div>    dirlist = os.listdir('.')</div><div>    dirlist.sort()</div><div>    for f in dirlist:</div><div>        try:</div><div>            s = os.lstat(f)</div><div>            if S_ISDIR(s.st_mode):</div><div>                walk(f)</div><div>        except OSError, err:</div><div>            print err</div><div>    chdir('..')</div><div><br></div><div>if len(sys.argv) != 2:</div><div>    print 'need 1 arg, directory to scan'</div><div><br></div><div>os.chdir(sys.argv[1])</div><div>cwd = os.getcwd()</div><div>cwdlist = cwd.split('/')</div><div><br></div><div>walk('.')</div></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 13, 2017 at 4:06 PM, Mini Trader <span dir="ltr"><<a href="mailto:miniflowtrader@gmail.com" target="_blank">miniflowtrader@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Here is the code.  It will run just fine with Debian 8.6 or OmniOS.  It will fail on the LX zone with Debian.  The only way for it to fail is for the stat call to fail and this seems to happen because the system doen't know what directory it is in.  The files being looked at are static so not a race condition.<div><br></div><div>Simple python script.<br><div><br></div><div><div># read a directory, stat all files</div><div><br></div><div>import os</div><div>import sys</div><div>from stat import *</div><div><br></div><div>def walk(d):</div><div>    os.chdir(d)</div><div>    working = os.getcwd()</div><div>    print working</div><div>    dirlist = os.listdir('.')</div><div>    dirlist.sort()</div><div>    for f in dirlist:</div><div>        try:</div><div>            s = os.lstat(f)</div><div>            if S_ISDIR(s.st_mode):</div><div>                walk(f)</div><div>        except OSError, err:</div><div>            print "CurrentDIR: " + working</div><div>            print "CurrentFile: " + f</div><div>            print err</div><div>    os.chdir('..')</div><div>    print "DONE"</div><div><br></div><div>if len(sys.argv) != 2:</div><div>    print 'need 1 arg, directory to scan'</div><div><br></div><div>cwd = os.getcwd()</div><div>os.chdir(sys.argv[1])</div><div>walk('.')</div></div><div><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 13, 2017 at 3:52 PM, Dale Ghent <span dir="ltr"><<a href="mailto:daleg@omniti.com" target="_blank">daleg@omniti.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Could you provide some of your telemetry and background here? There might be a reasonable explanation, or a quick fix.<br>
<span class="m_2147939592418202814HOEnZb"><font color="#888888"><br>
/dale<br>
</font></span><div class="m_2147939592418202814HOEnZb"><div class="m_2147939592418202814h5"><br>
> On Jan 13, 2017, at 3:12 PM, Mini Trader <<a href="mailto:miniflowtrader@gmail.com" target="_blank">miniflowtrader@gmail.com</a>> wrote:<br>
><br>
> I have a small program that will reproduce the issue.  Where should the bug be sent?  It's pretty serious.  The system is forgetting the location of the current working directory in a recursive call.<br>
><br>
> On Fri, Jan 13, 2017 at 9:30 AM, Nahum Shalman <<a href="mailto:nshalman@omniti.com" target="_blank">nshalman@omniti.com</a>> wrote:<br>
> Have you tried simply tracing the lx-syscall probes?<br>
><br>
> On Fri, Jan 13, 2017 at 9:24 AM, Mini Trader <<a href="mailto:miniflowtrader@gmail.com" target="_blank">miniflowtrader@gmail.com</a>> wrote:<br>
> I followed these instructions prior to my post and my zone would not boot after doing the mod to add the flag to the file.<br>
><br>
><br>
> On Fri, Jan 13, 2017 at 8:55 AM Nahum Shalman <<a href="mailto:nshalman@omniti.com" target="_blank">nshalman@omniti.com</a>> wrote:<br>
> The short answer is yes.<br>
><br>
> My experience debugging LX was on SmartOS and there are some notes on <a href="https://wiki.smartos.org/display/DOC/LX+Branded+Zones#LXBrandedZones-Debugging" rel="noreferrer" target="_blank">https://wiki.smartos.org/displ<wbr>ay/DOC/LX+Branded+Zones#LXBran<wbr>dedZones-Debugging</a><br>
><br>
> Some of the details on that page are Specific to SmartOS, but some of it is generic to LX.<br>
><br>
> -Nahum<br>
><br>
> On Fri, Jan 13, 2017 at 12:46 AM, Mini Trader <<a href="mailto:miniflowtrader@gmail.com" target="_blank">miniflowtrader@gmail.com</a>> wrote:<br>
> Is there anything that can be done to trace a program having issues on an LX Zone.<br>
><br>
> I am seeing:<br>
><br>
> OSError: [Errno 2] No such file or directory:<br>
><br>
> Again under certain conditions which I am trying to trace - unfortunately this is a closed source program.  Can DTrace be used to help track something like this?<br>
><br>
> Thanks!<br>
><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
><br>
><br>
> OmniOS-discuss mailing list<br>
><br>
><br>
> <a href="mailto:OmniOS-discuss@lists.omniti.com" target="_blank">OmniOS-discuss@lists.omniti.co<wbr>m</a><br>
><br>
><br>
> <a href="http://lists.omniti.com/mailman/listinfo/omnios-discuss" rel="noreferrer" target="_blank">http://lists.omniti.com/mailma<wbr>n/listinfo/omnios-discuss</a><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> OmniOS-discuss mailing list<br>
> <a href="mailto:OmniOS-discuss@lists.omniti.com" target="_blank">OmniOS-discuss@lists.omniti.co<wbr>m</a><br>
> <a href="http://lists.omniti.com/mailman/listinfo/omnios-discuss" rel="noreferrer" target="_blank">http://lists.omniti.com/mailma<wbr>n/listinfo/omnios-discuss</a><br>
<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>