Duane,

It looks like you are running Python from Python via popen().  It may be that 
when the child instance of Python quits, the sockets library is cleaning up 
after itself and closing/confusing any open sockets.

The destructor for EfiSocketLib attempts to shutdown the service and disconnect 
from the network controller.  It is possible that some state within the UEFI 
network stack is getting changed by the child application which is then 
unexpected and confusing to the parent application.

Every StdLib-based application will create a new, unique, environment at 
startup.  When the application finishes, it tries to clean up and de-allocate 
the environment it created.  Since there is no sharing between instances of 
StdLib it is easy for a child application to change the state of a shared 
resource (anything managed by the UEFI firmware, such as the network stack) in 
a manner that is unexpected and can't be handled by the parent application.


Daryl McDaniel

"In the pun, two strings of thought are tangled into one acoustic knot."
-- Arthur Koestler

From: Duane Voth [mailto:dua...@gmail.com]
Sent: Monday, March 04, 2013 12:15 PM
To: edk2-devel@lists.sourceforge.net
Subject: [edk2] StdLibPkg - spawn*/exec*/system/popen - chdrive/chdir

chdir() that includes the volume (drive) is in the works.  There is already a 
system() that mostly works (spawn and the exec* functions all require a lot of 
additional support that uEFI may never provide).  Attached is a StdLib patch 
(to StdLib/LibC/StdLib/Environs.c) I'm working with to get popen() like 
functionality.

I'm using popen() with Python at the moment (which is an StdLib based app). The 
problem I have right now is that if Python has open sockets, they are all 
broken/closed after calling my os.popen('fs0:\python.efi test.py').  Perhaps 
the second Python/StdLib is re-initializing the network stack?  If someone who 
knows EDK2 StdLib can comment on this aspect of socket support, I would 
appreciate it.
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to