[rt-users] Couldn't compile CustomCommitCode codeblock ... panic: sv_setpvn called with negative strlen -2 at /usr/share/perl5/Devel/StackTrace.pm line 53.

Michael Mol mikemol at gmail.com
Wed Aug 6 12:46:17 EDT 2014


First attempt at writing an RT scrip, and I'm getting a compile error
I can't easily identify as a problem with my code. Googling around
finds "sv_setpvn called with negative strlen -2" in multiple results,
but none of them in StackTrace.pm, mostly a lot of stuff surrounding
Unicode.

Purpose of the snippet is to take some automated messages sent by HP
hardware monitoring tools and give the ticket something informational
in the subject.

Help?

Error message:

Couldn't compile CustomCommitCode codeblock '# Find the message from
transactionobj->content # Set the subject to the message by using
ticketobj->SetSubject my $body = $self->TransactionObj->Content; open
my $fh '<', \$body or return 0; my $trapID = <$fh>; chomp $trapID;
<$fh>; my $messageLine = <$fh>; chomp $messageLine;
$self->TicketObj->SetSubject("$trapID -- $messageLine); close $fh;':
panic: sv_setpvn called with negative strlen -2 at
/usr/share/perl5/Devel/StackTrace.pm line 53.

Platform: Ubuntu 14.04, all updates applied.

Code snippet in question:

## Begin code snippet
# Find the message from transactionobj->content
# Set the subject to the message by using ticketobj->SetSubject

my $body = $self->TransactionObj->Content;

open my $fh '<', \$body or return 0;

my $trapID = <$fh>; chomp $trapID;
<$fh>;
my $messageLine = <$fh>; chomp $messageLine;

$self->TicketObj->SetSubject("$trapID -- $messageLine);

close $fh;
## End code snippet

-- 
:wq



More information about the rt-users mailing list