Welcome to iraf.net Friday, March 29 2024 @ 03:10 PM GMT


 Forum Index > Help Desk > Systems New Topic Post Reply
 Issue with Iraf module in Pyraf (imstat: 32, 'Broken pipe')) on Ubuntu (Xenial)
   
akerfeldt
 02/15/2018 05:03PM (Read 6510 times)  
+----
Newbie
confused

Status: offline


Registered: 02/15/2018
Posts: 7
I'm trying to use the iraf module in pyraf. I'm launching this from my conda environment where I have iraf and pyraf installed. I'm running this in bash on ubuntu. I get the following error message when I try to run iraf.imstat on a file:

\$this->_split2($m[0])\$this->_split2($m[0])\$this->_split2($m[0]) iraf.imstat()
**execvp failed, '[Errno 8] Exec format error'**
Killing IRAF task `imstatistics'
Traceback (most recent call last):
File "", line 1, in
File "/home/sam/miniconda2/envs/iraf27/lib/python2.7/site-packages/pyraf/iraftask.py", line 767, in __call__
return self.run(*args, **kw)
File "/home/sam/miniconda2/envs/iraf27/lib/python2.7/site-packages/pyraf/iraftask.py", line 359, in run
self._run(redirKW, specialKW)
File "/home/sam/miniconda2/envs/iraf27/lib/python2.7/site-packages/pyraf/iraftask.py", line 811, in _run
"\n"+str(value))
stsci.tools.irafglobals.IrafError: Error running IRAF task imstatistics
('Not a legal IRAF pipe record: ', 32, 'Broken pipe')

I have checked the help pages and FAQ, and the only advice available was to increase my stacksize limit to unlimited (ulimit -s unlimited). However, this does not solve the problem and it still persists.

I later found that trying to do mkiraf and cl gave the following response too:

$ cl
/home/sam/miniconda2/envs/iraf27/iraf//bin.linux/ecl.e: 1: /home/sam/miniconda2/envs/iraf27/iraf//bin.linux/ecl.e: Syntax error: "(" unexpected

$ xgterm
-su: /home/sam/miniconda2/envs/iraf27/bin/xgterm: cannot execute binary file: Exec format error

I think it's an issue with my ubuntu not having the libraries for 32-bit IRA, I'm on 64bit arch.

I have followed the instructions from the astroconda FAQ:

Debian \$this->_split2($m[0])=7, Ubuntu \$this->_split2($m[0])=14.04

# If on Debian execute this first (not required on Ubuntu):
sudo dpkg --add-architecture i386

sudo apt-get update
sudo apt-get install libc6:i386 libz1:i386 libncurses5:i386 libbz2-1.0:i386 libuuid1:i386 libxcb1:i386 libxmu6:i386

However, I am still getting an error message when I cl:

(iraf27) sam@user:~/iraf$ cl
/home/sam/miniconda2/envs/iraf27/bin/cl: 28: ulimit: error setting limit (Invalid argument)
/home/sam/miniconda2/envs/iraf27/iraf//bin.linux/ecl.e: 1: /home/sam/miniconda2/envs/iraf27/iraf//bin.linux/ecl.e: Syntax error: "(" unexpected

Anyone know a solution to this?

Thanks.

 
Profile Email
 Quote
olebole
 02/15/2018 07:54PM  
++++-
Regular Member

Status: offline


Registered: 05/01/2014
Posts: 103
/home/sam/miniconda2/envs/iraf27/iraf//bin.linux/ecl.e: 1: /home/sam/miniconda2/envs/iraf27/iraf//bin.linux/ecl.e: Syntax error: "(" unexpected

Looks like the files are somehow scrambled.

Could you do a

SHELL Formatted Code

$ file /home/sam/miniconda2/envs/iraf27/iraf//bin.linux/ecl.e
 

and also maybe check the content of the file (with "less" or so)? If this is not containing like "ELF 32-bit LSB executable, Intel 80386", then something is wrong with your installation of the IRAF package.

If this is correct, you can try
SHELL Formatted Code

$ ldd /home/sam/miniconda2/envs/iraf27/iraf//bin.linux/ecl.e
 

and post the result here.

 
Profile Email Website
 Quote
akerfeldt
 02/15/2018 08:06PM  
+----
Newbie

Status: offline


Registered: 02/15/2018
Posts: 7
Thanks for the quick response.

This is the output if I run file on it:

file /home/user/miniconda2/envs/iraf27/iraf//bin.linux/ecl.e: ELF 32-bit LSB executable,
Intel 80386, version 1 (SYSV), dynamically linked,
interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.9, not stripped
and ldd:

ldd /home/user/miniconda2/envs/iraf27/iraf//bin.linux/ecl.e
not a dynamic executable

 
Profile Email
 Quote
olebole
 02/15/2018 08:18PM  
++++-
Regular Member

Status: offline


Registered: 05/01/2014
Posts: 103
OK, so the executable seems intact. So the file "/lib32/ld-linux.so.2" may be missing. Can you check that this link is there and is pointing to a proper file? Try

SHELL Formatted Code

$ file -L /lib32/ld-linux.so.2
 

 
Profile Email Website
 Quote
akerfeldt
 02/15/2018 08:22PM  
+----
Newbie

Status: offline


Registered: 02/15/2018
Posts: 7
file -L /lib32/ld-linux.so.2
/lib32/ld-linux.so.2: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=bcd6a98ecd8fe3842fb679d0e0727fc307ffce90, stripped

Hope this helps, thanks.

 
Profile Email
 Quote
olebole
 02/15/2018 08:26PM  
++++-
Regular Member

Status: offline


Registered: 05/01/2014
Posts: 103
And the same for /lib/ld-linux.so.2?

 
Profile Email Website
 Quote
akerfeldt
 02/15/2018 08:29PM  
+----
Newbie

Status: offline


Registered: 02/15/2018
Posts: 7
file -L /lib/ld-linux.so.2
/lib/ld-linux.so.2: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=40fd637716e3f67e8a058ce4b5c03b3b335786d1, stripped

 
Profile Email
 Quote
olebole
 02/15/2018 08:32PM  
++++-
Regular Member

Status: offline


Registered: 05/01/2014
Posts: 103
That is mystic. Just to be sure: The system is not somehow "special"? It does allow the execution of 32-bit x86 binaries? I am asking, since also the line
OUTUT Formatted Code
/home/sam/miniconda2/envs/iraf27/bin/cl: 28: ulimit: error setting limit (Invalid argument)
 

is unusual (and will make the next problem once we got it running at all).


 
Profile Email Website
 Quote
akerfeldt
 02/15/2018 08:38PM  
+----
Newbie

Status: offline


Registered: 02/15/2018
Posts: 7
I just think this (ulimit problem) has something to do with the fact that I can't change the hard limits of some things e.g. stack size (unless the sudo user).

I'm not too sure if my system is 'special', because I'm using the windows ubuntu shell, I suppose that falls under special as it wouldn't surprise me if it didn't behave like typical ubuntu. However, I assumed this would be fine for the applications I use it for. I'm performing this all within the Astroconda environment that I have installed Iraf and Pyraf from.

Is there some test I can perform to check if I can run 32-bit x86 binaries?

Thanks.

 
Profile Email
 Quote
olebole
 02/15/2018 08:48PM  
++++-
Regular Member

Status: offline


Registered: 05/01/2014
Posts: 103
I just think this (ulimit problem) has something to do with the fact that I can't change the hard limits of some things e.g. stack size (unless the sudo user).

On (normal) Linux, this would be a big problem: Since 2004, IRAF has a very dirty hack to workaound a bug in its memory management system that requires to set the stacksize to unlimited. However, you don't use Linux, but "something" that looks like Linux, and this may behave differently...

I'm not too sure if my system is 'special', because I'm using the windows ubuntu shell, I suppose that falls under special as it wouldn't surprise me if it didn't behave like typical ubuntu.

That makes it clear. Probably (please check that yourself) the LInux kernel emulation in WIndows does not emulate 32 bit system calls; then you just are out of luck here.

Is there some test I can perform to check if I can run 32-bit x86 binaries?

You could try to install a 32-bit package with a program and see whether it runs.

 
Profile Email Website
 Quote
akerfeldt
 02/15/2018 09:10PM  
+----
Newbie

Status: offline


Registered: 02/15/2018
Posts: 7
It allowed me to install aapt: https://packages.ubuntu.com/search?keywords=aapt. This runs fine. So I'm puzzled.

 
Profile Email
 Quote
akerfeldt
 02/15/2018 10:22PM  
+----
Newbie

Status: offline


Registered: 02/15/2018
Posts: 7
and strangely I get a syntax error if I run in sh/dash:

root@user:/home/sam/miniconda2/envs/iraf64/iraf/bin.linux# bash ecl.e
ecl.e: ecl.e: cannot execute binary file

root@user:/home/sam/miniconda2/envs/iraf64/iraf/bin.linux# sh ecl.e
ecl.e: 1: ecl.e: Syntax error: "(" unexpected

I don't know if that's common. In that case, if I change the shebang in cl (where ecl.e is called) to #!/bin/sh I get the syntax and #!/bin/bash I get the cannot execute...

Don't know if this helps.

 
Profile Email
 Quote
olebole
 02/16/2018 07:28AM  
++++-
Regular Member

Status: offline


Registered: 05/01/2014
Posts: 103
The point is that your system is just not able to run 32 bit binaries because of missing kernel support.You could try to install wcstools:i386 (giving the arch is important!), and then just try "wcshead".
But it will not work. You are out of luck. Install a 64-bit IRAF or use a real Linux system (with a real Linux kernel).

 
Profile Email Website
 Quote
olebole
 02/16/2018 07:33AM  
++++-
Regular Member

Status: offline


Registered: 05/01/2014
Posts: 103
Also check https://github.com/Microsoft/WSL/issues/228
and googling "windows linux subsystem 32 bit" give a lot more pointers.

 
Profile Email Website
 Quote
   
Content generated in: 0.32 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login