Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

oorexx/linux: rexx stays in memory when run via cron?

17 views
Skip to first unread message

9ral4f

unread,
Oct 23, 2009, 12:21:02 PM10/23/09
to
My rather strange problem: on my small linux machine (a headerless
SheevaPlug with ubuntu 9.04 armel) oorexx v4 runs fine. But when
started via a cronjob, after succesfully executing my rexx programs
rexx doesn't exit, but stays in memory, occupying ~4 MB on each run,
filling up precious memory on the plug (512 MB). :-/

I'm quite new to linux and oorexx (I have used classic rexx on OS/2
and Windows often, though). So I do not even know if this is a problem
of oorexx or my linux installation.

Anyway, any thoughts, anyone?

Ralf

Michael Lueck

unread,
Oct 24, 2009, 10:11:24 PM10/24/09
to
9ral4f wrote:
> My rather strange problem: on my small linux machine (a headerless
> SheevaPlug with ubuntu 9.04

Which version of ooRexx?

Do you have the proper 'exit' at the end of the program?

Sincerely,

--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

9ral4f

unread,
Oct 25, 2009, 1:11:59 PM10/25/09
to
On 25 Okt., 03:11, Michael Lueck <mlu...@lueckdatasystems.com> wrote:
> 9ral4f wrote:
> > My rather strange problem: on my small linux machine (a headerless
> > SheevaPlug with ubuntu 9.04
>
> Which version of ooRexx?

Open Object Rexx Version 4.0.0
Build date: Oct 8 2009

I had to compile it myself for the SheevaPlug. My rexx programs/
scripts, wich I migrated from windows, work and exit flawlessly when
started from command line.

> Do you have the proper 'exit' at the end of the program?

Yes, checked that first. Even tried different exit codes ('exit 1',
'exit 255' etc.), no difference. Also tried running my rexx-scripts as
root (via /etc/crontab). I tried 'direct' calls ('/opt/ooRexx/bin/
rexx /opt/ooRexx/bin/myscript') vs. shebang. Even tried starting rexx
from a 'wrapper'-shellscript. It all makes no difference here.

Ralf

9ral4f

unread,
Oct 27, 2009, 2:57:04 AM10/27/09
to
I did a strace via htop on the idling rexx process. It reads: 'futex
(0x40160f18, FUTEX_WAIT_PRIVATE, 2, NULL'. Seems to be an endless wait
for a change of a memory address?

Actually, this left over process seems to get created by oorexx as a
child process, at least when started by cron on my machine.

A oorexx bug, maybe?

Ralf

wolfgang.riedel

unread,
Oct 27, 2009, 4:45:19 PM10/27/09
to

I think, each current rexx implementation starts (several) deamons/
services:
(on computer startup or first invocation), f.e.:
rxstack, rxqueue (Regina), ... some kind of MacroSpaceManager, etc.
I don't know, what it is in your case, but it migtht help to 'netstat'
'-an' or '-tua'

hth
Wolfgang

9ral4f

unread,
Oct 28, 2009, 2:20:02 AM10/28/09
to
On 27 Okt., 21:45, "wolfgang.riedel" <wolfgang.riede...@web.de> wrote:

> I think, each current rexx implementation starts (several) deamons/
> services:

This idle rexx instance is left over on each cron run of an rexx
script. I. e., after 4 runs of the script there are 4 idle instances
of rexx, waiting for something, each consuming about 4 MB of RAM. All
these processes can't be daemons/services.

BTW, on my windows machines the regina stack service is configurable
like any other service. If oorexx had a feature like that, it would be
configurable as well (and, at least, mentioned in its documentation).

Ralf

Swifty

unread,
Oct 28, 2009, 6:58:05 AM10/28/09
to
9ral4f wrote:
> This idle rexx instance is left over on each cron run of an rexx
> script. I. e., after 4 runs of the script there are 4 idle instances
> of rexx, waiting for something, each consuming about 4 MB of RAM. All
> these processes can't be daemons/services.

No, if its just rexx that's left, that's not one of the daemons.

If it possible that your cron task is simply not exiting? Possible
reasons might be:

1. You coded 'exit' instead of just exit, so your code carried on
2. You have a "Trace ?" statement which executes only when the code is
running as a cron task
3. You have a Pull/Parse Pull statement (same as #2)

If this were my code, I'd make sure there was just ONE exit, by using
"Call exit" instead of "Exit", then adding:

Exit:
'touch /home/9ral4f/exit_time' /* Change file to suit */
Exit

This way, you could look at the timestamp of the file, to see if the
"Exit:" routine had been called.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk

9ral4f

unread,
Oct 28, 2009, 1:16:50 PM10/28/09
to
On 28 Okt., 11:58, Swifty <steve.j.sw...@gmail.com> wrote:

> If it possible that your cron task is simply not exiting? Possible
> reasons might be:

> ...

Even this rexx code, executed by cron, leads to an left over rexx
process on my machine:
>>>(begin)
#!/opt/ooRexx/bin/rexx
say 'I am Rexx'
exit
<<<(end)

I thought after that I would rule out any faulty rexx scripting on my
side... :-)

When using any useful rexx program (let's call it
'nameofmyrexxprogram') I can actually see what's happening, using htop
in tree view:
1. cron starts bash as a child process
2. bash starts '/opt/ooRexx/bin/rexx nameofmyrexxprogramm' as a child
3. rexx runs, nameofmyrexxprogram is executing
4. before or while running, /opt/ooRexx/bin/rexx CREATES A CHILD
PROCESS with same name ('/opt/ooRexx/bin/rexx nameofmyrexxprogram').
5. after successful execution of the rexx program, /opt/ooRexx/bin/
rexx (the parent instance) exits WITHOUT CLOSING IT'S CHILD PROCESS
6. bash closes
7. cron sends mail to crontab-owner
8. rexx's former child process keeps idling away in memory, according
to strace waiting forever for an FUTEX event

For me it seems that the main instance of rexx fails to create the
FUTEX event it's child process is waiting for. To my very, very
limited knowledge FUTEX calls are often used to reserve shared memory.
IF rexx's child process is created to reserve memory for rexx and IF
rexx's main process is supposed to call a FUTEX function to free
reserved memory and thereby closing it's child process, THEN MAYBE
there is a bug in oorexx.

Despite the unusual hardware I'm running I have a quite normal ubuntu
9.04 (in it's armel incarnation). I've changed nothing about cron. I
compiled ooRexx from it's 'stable' v4 tarball, changed nothing. Only
ooRexx shows this behaviour on my machine, other binary programs run
fine with cron.

Ralf

Rick McGuire

unread,
Oct 28, 2009, 1:37:57 PM10/28/09
to

Are you sure you're picking up the 4.0.0 version? Previous versions
used shared memory, but that was all removed in 4.0. The only place
where any sort of child process with the same name might be created is
in some of the code involved with issuing shell commands in some
situations, but your small sample would not be hitting that code path.

Rick


>
> Ralf

9ral4f

unread,
Oct 29, 2009, 4:47:49 AM10/29/09
to
On 28 Okt., 18:37, Rick McGuire <object.r...@gmail.com> wrote:

> Are you sure you're picking up the 4.0.0 version?

Quite. I downloaded ooRexx-4.0.0.tar.gz following the link on
http://www.oorexx.org/, untared it and did what unix-like-build.txt
told me... :-)

This is what 'rexx -v' says:
-------------------------------------------


Open Object Rexx Version 4.0.0
Build date: Oct 8 2009

Addressing Mode: 32

Copyright (c) IBM Corporation 1995, 2004.
Copyright (c) RexxLA 2005-2009.
All Rights Reserved.
This program and the accompanying materials
are made available under the terms of the Common Public License v1.0
which accompanies this distribution.
http://www.oorexx.org/license.html

Syntax is "rexx [-v] filename [arguments]"
or "rexx [-e] program_string [arguments]".
-------------------------------------------

Also there never has been any other rexx installed on this fairly new
box.

Ralf

ML

unread,
Oct 29, 2009, 4:00:56 AM10/29/09
to

> I downloaded ooRexx-4.0.0.tar.gz

Why? And which new, unused feature is more important for your 'Hello
world!'-script than the problems you've now? It ain't the only broken
thing. Perhaps try a former 'stable' version. Or a Rexx-interpreter,
if available and acceptable fo your purposes.

ML

unread,
Oct 29, 2009, 5:17:07 PM10/29/09
to

>> A oorexx bug, maybe?

> I think, each current rexx implementation starts (several) deamons

'oorexx' isn't 'rexx'. Or 'oorexx' is the deamon started by Rexx.

---

0 new messages