[SOLVED] Re: How to run shell command from response handler? (Apache2 child segmentation fault)

2012-01-03 Thread David Booth
Thanks for the suggestion. I tried it with prefork and the problem still occurred. HOWEVER, I then decided to remove all modules down to a minimal example, and discovered that the mere inclusion of the following module: use Test::MockObject; was causing the segmentation fault after several su

Re: How to run shell command from response handler? (Apache2 child segmentation fault)

2012-01-03 Thread Daniel Risacher
I think I've been bitten by this too, years ago. I *think* I solved it by switching to mpm_prefork, which was unsatisfying, but adequate for my needs. On Tue, Jan 3, 2012 at 5:21 PM, David Booth wrote: > I tried redirecting stderr to /dev/null and it did not help: > system("date >> $f 2> /dev/nu

Re: How to run shell command from response handler? (Apache2 child segmentation fault)

2012-01-03 Thread David Booth
I tried redirecting stderr to /dev/null and it did not help: system("date >> $f 2> /dev/null"); I am using the worker processing model. Does it work for you (or anyone else) without causing periodic child process segmentation faults? On Tue, 2012-01-03 at 16:29 -0500, Daniel Risacher wrote: > I

Re: How to run shell command from response handler? (Apache2 child segmentation fault)

2012-01-03 Thread Daniel Risacher
It's been a while since I looked at doing this, but IIRC it's fairly dependent on the processing model that Apache is using. Are you mpm_prefork, or mpm_worker? Also, I found it was important to redirect stderr to /dev/null: sub play { system "/usr/bin/xmms -t 2> /dev/null"; } On Tue, Jan

Re: Cannot retrieve empty keys from request using Apache2::Request.param

2012-01-03 Thread André Warnier
Josh Narins wrote: How about a little perl string manipulation? #my $a = 'key1=value1&key2=&key3=value3'; my $a = 'key1=value1&key2&key3=value3'; my $b = join "&", map { my $c = ($_ =~ m/(\S+)=(\S*)?/o) ? $_ : "$_="; $c; } split "&", $a; print "a= $a\nb= $b\n"; This is not a good idea becaus

RE: Cannot retrieve empty keys from request using Apache2::Request.param

2012-01-03 Thread Josh Narins
> How about a little perl string manipulation? > > #my $a = 'key1=value1&key2=&key3=value3'; > my $a = 'key1=value1&key2&key3=value3'; > > my $b = join "&", map { my $c = ($_ =~ m/(\S+)=(\S*)?/o) ? $_ : "$_="; > $c; } split "&", $a; > > print "a= $a\nb= $b\n"; This is not a good idea because of HT

FW: Cannot retrieve empty keys from request using Apache2::Request.param

2012-01-03 Thread James B. Muir
How about a little perl string manipulation? #my $a = 'key1=value1&key2=&key3=value3'; my $a = 'key1=value1&key2&key3=value3'; my $b = join "&", map { my $c = ($_ =~ m/(\S+)=(\S*)?/o) ? $_ : "$_="; $c; } split "&", $a; print "a= $a\nb= $b\n"; -James -Original Message- From: Randolf Ri

Re: Cannot retrieve empty keys from request using Apache2::Request.param

2012-01-03 Thread Randolf Richardson
> Tommaso Torti wrote: > > Hi all, > > > > i'm using mod_perl in order to retrieve all keys from a POST request with: > > > > my $request = Apache2::Request->new($r); > > my $data = $request->param(); > > > > When i receive something like > > key1=value1&key2=&key3=value3 > > $data contains all

How to run shell command from response handler? (Apache2 child segmentation fault)

2012-01-03 Thread David Booth
I am trying to run a shell command from a mod_perl2 response handler. It works properly for some number of HTTP requests, but sometimes it fails (somewhat randomly) and I see in my Apache2 error log that one of the Apache2 child processes has died with a segmentation fault. For example, /var/log/

Re: Cannot retrieve empty keys from request using Apache2::Request.param

2012-01-03 Thread Tommaso Torti
Hi Andrè the input i'm receiving is not directly invoked from an html form, but it could be built from java code or php or other sources i don't even know. So i can't use javascript to fix the problem .. Thank you,

Re: Cannot retrieve empty keys from request using Apache2::Request.param

2012-01-03 Thread André Warnier
Tommaso Torti wrote: Hi all, i'm using mod_perl in order to retrieve all keys from a POST request with: my $request = Apache2::Request->new($r); my $data = $request->param(); When i receive something like key1=value1&key2=&key3=value3 $data contains all 3 keys but with key1=value1&key2&key3=v

Cannot retrieve empty keys from request using Apache2::Request.param

2012-01-03 Thread Tommaso Torti
Hi all, i'm using mod_perl in order to retrieve all keys from a POST request with: my $request = Apache2::Request->new($r); my $data = $request->param(); When i receive something like key1=value1&key2=&key3=value3 $data contains all 3 keys but with key1=value1&key2&key3=value3 $data contains on