🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
16 messages
16 total messages Started by Mark W Modrall Fri, 12 Jan 2001 23:01
perl filter crashing INND - why?
#49824
Author: Mark W Modrall
Date: Fri, 12 Jan 2001 23:01
29 lines
1582 bytes
Hi...

	i've written a perl filter that's going to pass the
message off to a java program for analysis...  unfortunately,
the innd server crashes as soon as the perl code is executed
without a core dump, a log message or anything...

	in my code (which does compile-i tested that), i was
adding some entries to the PATH and CLASSPATH environment
variables, opening a pipe to a java process, writing things
to its input, and setting the environment variables back again.

	i expected the crash to be something to do with the
pipe, but i commented that code out, and it still crashed...
i then commented out the env variable setting, and it stayed
up...

	why would 
$ENV{"PATH"}=$oldPath.":/usr/local/java/bin";
becausing inn to crash silently?  Is there somewhere else
i should be looking for core dumps?

	I'm running inn 2.3 on a red hat linux pentium
box...

thanks
-mark

Re: perl filter crashing INND - why?
#49825
Author: Russ Allbery
Date: Sat, 13 Jan 2001 01:17
16 lines
1276 bytes
Mark W Modrall <modrall@world.std.com> writes:

> 	why would 
> $ENV{"PATH"}=$oldPath.":/usr/local/java/bin";

Have you commented out everything except for that line from the filter?

> becausing inn to crash silently?  Is there somewhere else i should be
> looking for core dumps?

~news/spool/articles.  innd dumps core at the top level of that directory
by default.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>
Re: perl filter crashing INND - why?
#49826
Author: another Saturday night and I ain...
Date: Sat, 13 Jan 2001 01:59
13 lines
1550 bytes
Mark W Modrall <modrall@world.std.com> wrote:

> 	why would 
> $ENV{"PATH"}=$oldPath.":/usr/local/java/bin";
> becausing inn to crash silently?

innd doesn't want to be left alone on a Friday night?

>  Is there somewhere else i should be looking for core dumps?

Try patharticles from inn.conf, that is innd's working dir for most of
its lifetime.
Re: perl filter crashing INND - why?
#49832
Author: Mark W Modrall
Date: Sat, 13 Jan 2001 16:27
34 lines
1794 bytes
In article <ylr9286yj6.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
>Mark W Modrall <modrall@world.std.com> writes:
>
>> 	why would 
>> $ENV{"PATH"}=$oldPath.":/usr/local/java/bin";
>
>Have you commented out everything except for that line from the filter?

	actually, i commented out everything but
$oldPath=$ENV{"PATH"};
$oldClass=$ENV{"CLASSPATH"};
$ENV{"PATH"}=$oldPath.":/usr/local/java/bin";
$ENV{"CLASSPATH"}=$oldClass.":one class path"
	.":another class path"
	.":a third class path";
...
$ENV{"PATH"}=$oldPath;
$ENV{"CLASSPATH"}=$oldClass;

	so i don't know precisely if it's getting the variables out
of %ENV that crash it or setting the new values in..

>> becausing inn to crash silently?  Is there somewhere else i should be
>> looking for core dumps?
>
>~news/spool/articles.  innd dumps core at the top level of that directory
>by default.

	thanks for the tip; i'll check it out on monday...

-mark

Re: perl filter crashing INND - why?
#49855
Author: Mark W Modrall
Date: Mon, 15 Jan 2001 17:49
49 lines
2218 bytes
	tried commenting swaps some more, and i found that it crashes
upon setting an amended variable into the %ENV array...  I found the
core, but it didn't have any symbols, so i wasn't able to make out
much...

	anyone familiar with perl and inn have any idea why setting
an environment variable would crash inn?

thanks
-mark

In article <G740D9.o1@world.std.com>,
Mark W Modrall <modrall@world.std.com> wrote:
>In article <ylr9286yj6.fsf@windlord.stanford.edu>,
>Russ Allbery  <rra@stanford.edu> wrote:
>>Mark W Modrall <modrall@world.std.com> writes:
>>
>>> 	why would 
>>> $ENV{"PATH"}=$oldPath.":/usr/local/java/bin";
>>
>>Have you commented out everything except for that line from the filter?
>
>	actually, i commented out everything but
>$oldPath=$ENV{"PATH"};
>$oldClass=$ENV{"CLASSPATH"};
>$ENV{"PATH"}=$oldPath.":/usr/local/java/bin";
>$ENV{"CLASSPATH"}=$oldClass.":one class path"
>	.":another class path"
>	.":a third class path";
>...
>$ENV{"PATH"}=$oldPath;
>$ENV{"CLASSPATH"}=$oldClass;
>
>	so i don't know precisely if it's getting the variables out
>of %ENV that crash it or setting the new values in..
>
>>> becausing inn to crash silently?  Is there somewhere else i should be
>>> looking for core dumps?
>>
>>~news/spool/articles.  innd dumps core at the top level of that directory
>>by default.
>
>	thanks for the tip; i'll check it out on monday...
>
>-mark
>


Re: perl filter crashing INND - why?
#49874
Author: Russ Allbery
Date: Tue, 16 Jan 2001 09:51
18 lines
1639 bytes
Mark W Modrall <modrall@world.std.com> writes:

> tried commenting swaps some more, and i found that it crashes upon
> setting an amended variable into the %ENV array...  I found the core,
> but it didn't have any symbols, so i wasn't able to make out much...

> anyone familiar with perl and inn have any idea why setting an
> environment variable would crash inn?

That's very odd.  I'd try recompiling with -g to see if that gives you a
binary with debugging symbols so that you can figure out what's crashing.

INN does change its environment (setting TMPDIR), but it does that before
it ever initializes the Perl interpretor.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>
Re: perl filter crashing INND - why?
#49882
Author: Mark W Modrall
Date: Tue, 16 Jan 2001 15:30
49 lines
2934 bytes
In article <ylg0ijesf2.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
>Mark W Modrall <modrall@world.std.com> writes:
>
>> tried commenting swaps some more, and i found that it crashes upon
>> setting an amended variable into the %ENV array...  I found the core,
>> but it didn't have any symbols, so i wasn't able to make out much...
>
>> anyone familiar with perl and inn have any idea why setting an
>> environment variable would crash inn?
>
>That's very odd.  I'd try recompiling with -g to see if that gives you a
>binary with debugging symbols so that you can figure out what's crashing.
>
>INN does change its environment (setting TMPDIR), but it does that before
>it ever initializes the Perl interpretor.

	Actually, i found it was gdb that was touchy about the innd image;
if i used gdb <full image path from another directory>, it wouldn't show
the symbols...  If i switched directories to be in the news/bin directory
and did gdb innd news/spool/articles/core, then it would show me the
symbols...

	It was crashing in free, called out of Perl_my_setenv(), which
is part of the perl link library...  why it doesn't crash with perl
being run from the command line, i don't know...

	I tried to set the variables in my environment before launching
inn (and i used -d -f to run it in foreground, but i was surprised to
find the values gone when inn was running...

	I'm guessing it was because rc.news is a bourne shell script and
i'm running in bash...  the eval in rc.news launches a sh process that
doesn't inherit currently set environment variables...

	eventually i got it all running by simply putting full path
qualifications on everything in the script...  still curious about
the crash though...

	by the by, i'm using the perl filter to launch a java processor
because that's the language i found a mime processor in...  anyone know
of any good perl mime parsing and uudecoding packages?  might be
simpler not to run java stuff...

thanks
-mark


Re: perl filter crashing INND - why?
#49883
Author: Russ Allbery
Date: Tue, 16 Jan 2001 15:51
28 lines
2102 bytes
Mark W Modrall <modrall@world.std.com> writes:

> It was crashing in free, called out of Perl_my_setenv(), which is part
> of the perl link library...  why it doesn't crash with perl being run
> from the command line, i don't know...

Perl is disagreeing with innd over which malloc to use, I bet.  What
version of Perl are you using, and what's the output of perl -V?

> I tried to set the variables in my environment before launching inn (and
> i used -d -f to run it in foreground, but i was surprised to find the
> values gone when inn was running...

inndstart strips out all environment variables intentionally (as a
security measure, as well as for other reasons).  Modifying inndstart to
set the environment variable would work, although it shouldn't be
necessary.

> by the by, i'm using the perl filter to launch a java processor because
> that's the language i found a mime processor in...  anyone know of any
> good perl mime parsing and uudecoding packages?  might be simpler not to
> run java stuff...

Have you looked at the MIME-tools Perl module collection?

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>
Re: perl filter crashing INND - why?
#49888
Author: Andrew Gierth
Date: Tue, 16 Jan 2001 16:49
31 lines
2395 bytes
>>>>> "Russ" == Russ Allbery <rra@stanford.edu> writes:

 > Mark W Modrall <modrall@world.std.com> writes:
 >> It was crashing in free, called out of Perl_my_setenv(), which is
 >> part of the perl link library...  why it doesn't crash with perl
 >> being run from the command line, i don't know...

 Russ> Perl is disagreeing with innd over which malloc to use, I bet.

I'm not so sure - some of the stuff in Perl's my_setenv is suspect,
it could easily die in free() if it concludes that it has already
copied the environment when this is not in fact the case. but...

 Russ> What version of Perl are you using, and what's the output of
 Russ> perl -V?

...this data is needed to draw any firm conclusions

 >> I tried to set the variables in my environment before launching inn (and
 >> i used -d -f to run it in foreground, but i was surprised to find the
 >> values gone when inn was running...

 Russ> inndstart strips out all environment variables intentionally
 Russ> (as a security measure, as well as for other reasons).

A largely bogus security measure, since last time I looked, anyone who
can run inndstart can trivially obtain a shell as the news user.

-- 
Andrew.
Re: perl filter crashing INND - why?
#49891
Author: Mark W Modrall
Date: Tue, 16 Jan 2001 17:15
30 lines
1743 bytes
In article <878zobigri.fsf@erlenstar.demon.co.uk>,
Andrew Gierth  <andrew@erlenstar.demon.co.uk> wrote:
>>>>>> "Russ" == Russ Allbery <rra@stanford.edu> writes:
>
> > Mark W Modrall <modrall@world.std.com> writes:
> >> It was crashing in free, called out of Perl_my_setenv(), which is
> >> part of the perl link library...  why it doesn't crash with perl
> >> being run from the command line, i don't know...
>
> Russ> Perl is disagreeing with innd over which malloc to use, I bet.
>
>I'm not so sure - some of the stuff in Perl's my_setenv is suspect,
>it could easily die in free() if it concludes that it has already
>copied the environment when this is not in fact the case. but...
>
> Russ> What version of Perl are you using, and what's the output of
> Russ> perl -V?
>
>...this data is needed to draw any firm conclusions

	I'm using perl 5.6.0 for intel linux...  does this make it
clearer? :)

thanks
-mark




Re: perl filter crashing INND - why?
#49893
Author: Mark W Modrall
Date: Tue, 16 Jan 2001 17:18
23 lines
1515 bytes
In article <ylzogr4hrp.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
>> by the by, i'm using the perl filter to launch a java processor because
>> that's the language i found a mime processor in...  anyone know of any
>> good perl mime parsing and uudecoding packages?  might be simpler not to
>> run java stuff...
>
>Have you looked at the MIME-tools Perl module collection?

	nope...  haven't heard of it... would you know a good place to
look it up?  seems like i might just be beating my head against a wall
trying to get out to another language if the same tools might exist
in perl...

	just curious, but are there any efforts to create a java filter
interface for inn?

thanks again
-mark



Re: perl filter crashing INND - why?
#49894
Author: Russ Allbery
Date: Tue, 16 Jan 2001 17:18
15 lines
1583 bytes
Andrew Gierth <andrew@erlenstar.demon.co.uk> writes:
>>>>>> "Russ" == Russ Allbery <rra@stanford.edu> writes:

>  Russ> inndstart strips out all environment variables intentionally
>  Russ> (as a security measure, as well as for other reasons).

> A largely bogus security measure, since last time I looked, anyone who
> can run inndstart can trivially obtain a shell as the news user.

True.  Maybe it shouldn't (although having a clean environment is
worthwhile for other reasons than security).

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>
Re: perl filter crashing INND - why?
#49895
Author: Russ Allbery
Date: Tue, 16 Jan 2001 18:53
26 lines
1864 bytes
Mark W Modrall <modrall@world.std.com> writes:
> Russ Allbery  <rra@stanford.edu> wrote:

>>> by the by, i'm using the perl filter to launch a java processor because
>>> that's the language i found a mime processor in...  anyone know of any
>>> good perl mime parsing and uudecoding packages?  might be simpler not to
>>> run java stuff...

>> Have you looked at the MIME-tools Perl module collection?

> nope...  haven't heard of it... would you know a good place to look it
> up?

<ftp://ftp.perl.org/pub/CPAN/modules/by-module/MIME/>

> seems like i might just be beating my head against a wall trying to get
> out to another language if the same tools might exist in perl...

> just curious, but are there any efforts to create a java filter
> interface for inn?

Can you embed Java the way you can Perl, Python, and Tcl?

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>
Re: perl filter crashing INND - why?
#49904
Author: Mark W Modrall
Date: Tue, 16 Jan 2001 19:13
18 lines
1199 bytes
In article <ylely3z5u9.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
><ftp://ftp.perl.org/pub/CPAN/modules/by-module/MIME/>

	Thanks!

>> just curious, but are there any efforts to create a java filter
>> interface for inn?
>
>Can you embed Java the way you can Perl, Python, and Tcl?

	it would take some work to write the glue, but i don't see
why not...

-mark


Re: perl filter crashing INND - why?
#49898
Author: Russ Allbery
Date: Tue, 16 Jan 2001 19:21
18 lines
1632 bytes
Mark W Modrall <modrall@world.std.com> writes:
> Russ Allbery  <rra@stanford.edu> wrote:

>> Can you embed Java the way you can Perl, Python, and Tcl?

> it would take some work to write the glue, but i don't see why not...

Perl, Python, and Tcl have it as a design goal and have an explicit
interface for doing it.  I didn't realize that Java did.  (Although come
to think of it I suppose that's what web browsers do.)

I've been threatening to rip out the filtering interface and rewrite it
for a while now, though, so anyone wanting to work on this should probably
wait until after I've done that.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>
Re: perl filter crashing INND - why?
#49900
Author: Meowbot Native Interface
Date: Wed, 17 Jan 2001 01:20
7 lines
1513 bytes
Russ Allbery <rra@stanford.edu> wrote:

> Can you embed Java the way you can Perl, Python, and Tcl?

Yeah.  This is what the JNI's Invocation API does.  Why they couldn't
call it embedding like everyone else is anyone's guess.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads