gman has asked for the wisdom of the Perl Monks concerning the following question:
Hello
I am building a web application based on CGI::Application. Also using Plugin::Session to keep session state. In one run mode of the application users are allow to upload a file. I am also saving session state in my post run using:
sub cgiapp_postrun { my $self = shift; #die Dumper($self); $self->session->save_param(); $self->session->flush(); }
my session Driver is file and I believe therefor uses Data::Dumper. Anytime I try to either Dump the session data using Dumper() or hit the pst run I get the following error:
Assertion ((buffer)->sv_flags & 0x00000400) failed: file "sv.c", line +1741 at /usr/lib/perl5/5.10.0/i386-linux-thread-multi/Data/Dumper.pm +line 190
Also if I die $q->param('bulk_upload'); the field is not populated. bulk_upload is the name of my upload field.
Has anyone seen this? I found this http://www.nntp.perl.org/group/perl.perl5.porters/2009/05/msg146341.html but don't know enough to know if this is the same issue.
Thanks in advance,
Cory
UPDATE:
perl 5.10.1 installed, getting same error, but found this post
postTalks about deleting the FH pointer in the session, I have both
$self->session->clear(['bulk_upload']);and $q->param('bulk_upload','' +); $self->session->clear('bulk_upload');
funny thing is it gets past this the first time, and if I clear the CGI session file,
_SESSION_REMOTE_ADDR' => '10.10.192.63','bulk_file' => bless( \*{'Fh:: +fh000018yy_import.txt'}, 'Fh' ),'_SESSION_CTIME' => 1261427840,'bntsu +bmit' => 'Upload File','_SESSION_ATIME' => 1261427915,'bulk_upload' = +> '','authen_loginbutton' => 'Sign In','Agree' => 'Agree','_SESSION_E +XPIRE_LIST' => {}};;$D[rootvi /var/www/chkdwn/cgi-bin/Sup*/Index.pm
After that I get the following Do not know how to reconstitute blessed object of base type GLOB
UPDATE: PROBLEM SOLVED
on the advice from ikegami and others, of not including the CGI upload FH in the session data. I realized that the CGI param had to be copied to a variable and removed from the CGI param list before the CGI::Session config
Here is what the I had to do in the CGI::Application setup stage.
my $q = $self->query(); $upload_file = $q->param('bulk_file'); $q->param('bulk_file',''); $self->session_config(...
Thanks again to all that helped
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::Application file upload Assertion error with Data::Dumper
by ikegami (Patriarch) on Dec 18, 2009 at 18:48 UTC | |
by gman (Friar) on Dec 18, 2009 at 19:36 UTC | |
by gman (Friar) on Dec 22, 2009 at 07:34 UTC | |
|
Re: CGI::Application file upload Assertion error with Data::Dumper
by faber (Acolyte) on Dec 18, 2009 at 18:32 UTC | |
by gman (Friar) on Dec 18, 2009 at 18:41 UTC |