Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Errno 8 Exec format error

Reply
Thread Tools

Re: Errno 8 Exec format error

 
 
jepler@unpythonic.net
Guest
Posts: n/a
 
      10-25-2005
On Tue, Oct 25, 2005 at 04:11:39PM +0100, Matthew Fowler wrote:
> "problem with execution of xhpl on AxisProduct: [Errno 8] Exec format
> error"

In this case, it appears that Python is reporting the error of some operating
system call, such as execve.

On my operating system, here's a program which creates an executable file which
is not a valid ELF file. When it is executed with execve, -1 is returned and
errno is set to ENOEXEC ("Exec format error")

#-----------------------------------------------------------------------
import tempfile, os

t, n = tempfile.mkstemp()
os.write(t, "\x7fELF\1\1\1\0\0\0\0\0\0\0\0\0\0\0\0")
os.close(t)

os.chmod(n, 0700)
try:
print os.execv(n, ['example'])
finally:
os.unlink(n)
#-----------------------------------------------------------------------

$ python badexec.py
Traceback (most recent call last):
File "badexec.py", line 9, in ?
print os.execv(n, ['example'])
OSError: [Errno 8] Exec format error

Jeff

> Hi there
>
> I have been porting python to the Etrax platform and everything seems to
> be working.
>
> However when I run the program in question I get:
>
>
> Im looking for any help to try and solve this issue. Am I correct in
> thinking that Python is reporting this problem? If so has anybody
> experienced this problem before?
>
> Thank You
>
> Matt
> --
> http://mail.python.org/mailman/listinfo/python-list
>


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDXlBMJd01MZaTXX0RAnrgAJ9pRD6kIcYzyaRngJkIMj W07fc74ACgkoJ/
SCWyakRYeefr77onh7P1ahA=
=uBzu
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
errno 22 instead of errno 2 Glenn Linderman Python 0 01-28-2009 07:52 AM
&errno, sizeof errno viza C Programming 20 09-14-2008 09:53 PM
Trouble with subprocess.call(...) and zsh script (OSError: [Errno 8] Exec format error) Michael George Lerner Python 2 11-13-2007 11:41 PM
Errno 8 Exec format error Matthew Fowler Python 0 10-25-2005 03:11 PM
Backup Exec 9.1: The Backup Exec job engine system service is not responding Christian Falch Computer Support 1 06-23-2004 02:22 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57