Discussion Forums

GSoC - Improve the SonATA Software Infrastructure

17 replies [Last post]
jrseti
jrseti's picture
Offline
Joined: 2010-07-22
Posts: 250

Improve the SonATA Software Infrastructure

This is a general discussion area for the Google Summer of Code project. See SonATA_Porting for full details on this project.

The GSoC student working on this project is Khurram Baig

If you have any comments or questions about this project - please jump into the conversation. We may need help from time to time with sticky issues.

 

See http://issues.setiquest.org/projects/sonata-porting for a list of issues we are working on.

 

--jrseti

-jrseti

jrseti
jrseti's picture
Offline
Joined: 2010-07-22
Posts: 250
SonATA porting problem with sudo

We are currently working on a weird problem.

See http://issues.setiquest.org/issues/325

On OpenSUSE 11.4 the dx and channelizer do not work. The problem has been tracked down to Task.cpp. The pthread_create is failing, returning an error of EPERM. This means it does not have permissions to bump up the priority scheduler. This must be the result to sudo not being configured correctly in 11.4. 

 

This problem does NOT exist on 11.3. So it is either a bug in 11.4, or there is some setting incorrect in the default install of 11.4

-jrseti

khrm
Offline
Joined: 2011-03-20
Posts: 39
I found an interesting thing

I found an interesting thing that I am getting  EPERM with root also.

jrseti
jrseti's picture
Offline
Joined: 2010-07-22
Posts: 250
Well, that cancels out my

Well, that cancels out my theory! I just assumed (incorrectly) that it is a sudo problem.

 

I would suggest that you write a very small program in C++ to try to duplicate this problem with pthread_create. You'll have to figure out how the priority attributes are set.

-jrseti

khrm
Offline
Joined: 2011-03-20
Posts: 39
After comparing the packages

After comparing the packages in OS in which it is working and on another it is not working I did the follwoing :

  1. sudo zypper ar -f -n packman http://packman.inode.at/suse/openSUSE_11.4 packman
  2. sudo zypper update

I believe first step is not essential. But I did it.
Also I have installed smplayer as my working OS had that. But that too is not important. But it might be pulling some dependecies that are needed by SonATA also.I will check again by reinstalling.

I used this scrip whenever I needed to check. :   https://gist.github.com/1059613

khrm
Offline
Joined: 2011-03-20
Posts: 39
I again install the SonATA

I again install the SonATA and this time I just updated using zypper update .Then I got EPERM. But when I restarted the computer after update it works. Channelizer and dx get connected. 
I installed using this: http://download.opensuse.org/distribution/11.4/iso/openSUSE-11.4-GNOME-LiveCD-x86_64.iso
Can you check again after restarting?
I will download dvd and see whether this works on it.

jrseti
jrseti's picture
Offline
Joined: 2010-07-22
Posts: 250
Khrm, I installed fresh a

Khrm,

  • I installed fresh a new instance of 11.4 from the Live CD.
  • The wje_q program did get the EPERM error. Even with sudo
  • I did a sudo zypper update
  • The wje_q program did get the EPERM error. Even with sudo
  • I rebooted
  • The wje_q program DID WORK WITH SUDO!

So, there is some package that is being installed that makes the thread priorities not have permission.

 

maybe you should try to install each package with zypper one at a time, and after each install see if wje_q still fails. That way you may be able to determine which package is making wje_q fail.

-jrseti

khrm
Offline
Joined: 2011-03-20
Posts: 39
A new bug in ubuntu

I am facing a new bug in ubuntu and debian.
Seeker crashed when dx tries to connect. And shows a memory map and backtrace on its own.
http://setiquest.org/wiki/index.php/File:Screenshot-Untitled_Window.png
http://setiquest.org/wiki/index.php/File:Memorymap-2.png

khrm
Offline
Joined: 2011-03-20
Posts: 39
I am getting this error on

I am getting this error on centos also. But it crashed when dx cennects. I get the memory map on its own.

khrm
Offline
Joined: 2011-03-20
Posts: 39
I am not able to understand

I am not able to understand why this error is arising.
To build SonATA on deboan. Do the follwoing:

Change the following line (1635)in sse-pkg/util/controlcomponents.expect :

 trap quit {INT TERM QUIT ABRT ILL HUP }
to
 trap quit {INT TERM QUIT ABRT HUP }

Also you will have to change the 52 and 53 line in tclreadline.c from
#define MALLOC(size) Tcl_Alloc((int) size)
#define FREE(ptr) if (ptr) { Tcl_Free((char*) ptr); ptr = 0; }
to
#define MALLOC(size) malloc((int) size)
#define FREE(ptr) if (ptr) { free((char*) ptr); ptr = 0; }

Then follow the steps mentioned here excpet that you will have to use the https://raw.github.com/khrm/SonATA/gsoc/gsoc/deb_preins.sh instead of sonata_i.sh:
http://setiquest.org/forum/topic/gsoc-improve-sonata-software-infrastructure#comment-2219

sigblips
sigblips's picture
Offline
Joined: 2010-04-20
Posts: 733
Wow, I thought the problem

Wow, I thought the problem was related to libACE but now it looks like it is related to the TCL malloc and free commands. Am I understanding this correctly? So were the mmap and munmap related errors in the backtrace a red herring? Or is the recent version of Debian's TCL internally using mmap instead of malloc as a sort of optimization?

Could you post the TCL version numbers of the different Linux distributions that work without any SonATA modification and the TCL version numbers that require the malloc/free #defines?

From man Tcl_Alloc:

   "These procedures provide a platform and compiler independent  interface
   for  memory  allocation.   Programs  that need to transfer ownership of
   memory blocks between Tcl and other modules should use  these  routines
   rather  than  the native malloc() and free() routines provided by the C
   run-time library."

This brings up a couple questions:

  • What will the ramifications of changing Tcl_Alloc() to malloc() be? 
  • Why did the original author add that #define MALLOC in SonATA/tclreadline/tclreadline.c?
  • Is this really a TCL bug or is it related to something else?
  • What is the history of SonATA, libACE, TCL, and tclreadline.c?
khrm
Offline
Joined: 2011-03-20
Posts: 39
"#define MALLOC(size)

"#define MALLOC(size) Tcl_Alloc((int) size)
#define FREE(ptr) if (ptr) { Tcl_Free((char*) ptr); ptr = 0; }
to
#define MALLOC(size) malloc((int) size)
#define FREE(ptr) if (ptr) { free((char*) ptr); ptr = 0; }"

This is a different bug.  In this when seeker is started and then enter is pressed or any command is given it gives: alloc invalid bloc.

This bug too arises because threaded tcl is being used. When tclreadline was written then there existed no threaded tcl. And even now debian and ubuntu are few of the distros doing so.
Tcl versions are same. It's is just that one distro is giving tcl compiled using threading enabled and other don't.

sigblips
sigblips's picture
Offline
Joined: 2010-04-20
Posts: 733
There was some discussion of
khrm
Offline
Joined: 2011-03-20
Posts: 39
I have found out that this

I have found out that this arises because free is used instead of Tcl_Free to free *argvPtr pointer of  Tcl_SplitList. While in OpenSuse and fedora there is no restriction on that. You can interchange both. In debian this is not allowed.
So we will have to change all free((char *) maskv);
Tcl_Free((char *) maskv);

This is because debian and ubuntu are using threaded tcl which is strict about this.

khrm
Offline
Joined: 2011-03-20
Posts: 39
Now to install and build

Now to install and build SonATA you have to follwo these steps:

Add the following line at the last to /etc/sudoers

{username}           ALL=(ALL) NOPASSWD: ALL

Then use this script:
http://gist.github.com/1081601

Then:

./configure --with-tcl=/usr/lib64 -C
make
sudo make install
sudo chown -R `whoami` ~/sonata_install

Test it by typing in the terminal :
test_sonata
(These steps are valid for my gsoc branch of the fork of SonATA at github).

khrm
Offline
Joined: 2011-03-20
Posts: 39
I have resync my local  repo

I have resync my local  repo to my remote repo at github.

Now to test and build SonATA. You have to follow the following steps:

1. Add the following line at the last to /etc/sudoers

{username}           ALL=(ALL) NOPASSWD: ALL

2 Run the Script sonata_i.sh here:
raw.github.com/khrm/SonATA/gsoc/gsoc/sonata_i.sh

(You don't need to clone my repo. Script will ask the question to do so. These steps are valid for my repo only.)

3 Run
./autogen.sh
./configure
make
sudo make install
sudo chown -R `whoami` ~/sonata_install

To test type in the terminal:
test_sonata
Then in the seeker window:
source vger-dmo-xpol.tcl

And then open:
waterfallDisplay

khrm
Offline
Joined: 2011-03-20
Posts: 39
I have decided to use a

I have decided to use a external macro ax_ext_have_lib to determine whether library is available in external. If not then stopping the build process. Currently, there is only yes and no and build process doesn't stop. Though that can be done with ac_check_lib and ac_msg_error but ac_check_ lib doesn't give check in many of the places. Also now if you get any error in configure steps it's is due to missing package or putting libraries in a obscure place. ( which is rarely the case).  

khrm
Offline
Joined: 2011-03-20
Posts: 39
On page

On page http://setiquest.org/content/sonata-build
After line:
In your .bashrc add these and resource your environment (restart the terminal after saving changes to the .bashrc):
It should be :

  • export ACE_ROOT=$HOME/SonATA/packages/ACE_wrappers
  • export PACKAGES_PATH=$HOME/SonATA/packages

I had use what is currently ( without export) on the page. That would give error ( though not with mine script as I change ACE_ROOT in configure.ac but now  I will not) while compiling.