Problem with rt-crontool and rt-escalate seg fault

Hello,

I’m having problems with the rt-crontool and rt-escalate perl scripts.
They always seg fault on RT::Init();

Below is a copy of the script I’m using if anyone has an suggestions I’d
love to hear them :slight_smile:

-John

#!/usr/bin/perl

Author: Petter Reinholdtsen

Date: 2004-08-31

Based on shell version previously on

URL:http://wiki.bestpractical.com/index.cgi?ConfigureEscalationExample

and

URL:http://wiki.bestpractical.com/index.cgi?ConfigureEscalation

Run from cron as user rt-user, and make sure rt-user have

permissions ShowTicket and ModifyTicket

also make sure that rt-user is in the rt group so it can read the

RT_SiteConfig.pm

and friends (LER: 2005-02-06)

use strict;
use warnings;

Location of RT3’s libs and scripts

use lib ("/opt/rt3/lib", “/opt/rt3/local/lib”);
my $crontool = “/opt/rt3/bin/rt-crontool”;

package RT;
use RT::Interface::CLI qw(CleanEnv);

Clean our the environment

CleanEnv();

Load the RT configuration

RT::LoadConfig();
print “loaded config\n”;

Initialise RT

RT::Init();
print “Initialized\n”;
my $queues = new RT::Queues($RT::SystemUser);
$queues->LimitToEnabled();
print “Escalating tickets\n”;

escalate tickets for all queues

while (my $queue = $queues->Next) {
my $queuename = $queue->Name;
system("$crontool --search RT::Search::ActiveTicketsInQueue " .
"–search-arg “$queuename” “.
”–action RT::Action::EscalatePriority");
}

Hello,

I’m having problems with the rt-crontool and rt-escalate perl scripts.
They always seg fault on RT::Init();

Below is a copy of the script I’m using if anyone has an suggestions I’d
love to hear them :slight_smile:

-John

Are you sure you are pointing at the correct Perl on your system?

I am sure. I actually was able to isolate the problem. Perl itself was
seg faulting. The problem resided in the libmysqlclient library. I
update to 4.1.10 from 4.1.7 and this seemed to fix the issues. Here is a
back trace for gdb if anyone is interested

(gdb) run -I/opt/rt3/lib -MRT -e’RT::LoadConfig; RT::Init’
Starting program: /usr/bin/perl -I/opt/rt3/lib -MRT -e’RT::LoadConfig;
RT::Init’
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 1075523712 (LWP 4400)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1075523712 (LWP 4400)]
0x400c45d5 in mallopt () from /lib/tls/libc.so.6
(gdb) bt
#0 0x400c45d5 in mallopt () from /lib/tls/libc.so.6
#1 0x400c38c3 in malloc () from /lib/tls/libc.so.6
#2 0x402b797e in my_malloc () from /usr/lib/libmysqlclient.so.14
#3 0x402bab7c in alloc_root () from /usr/lib/libmysqlclient.so.14
#4 0x402d81c6 in unpack_fields () from /usr/lib/libmysqlclient.so.14
#5 0x402da2b2 in mysql_close () from /usr/lib/libmysqlclient.so.14
#6 0x402da4a0 in mysql_real_query () from /usr/lib/libmysqlclient.so.14
#7 0x4028edea in mysql_st_internal_execute () from
/usr/local/lib/perl/5.8.4/auto/DBD/mysql/mysql.so
#8 0x4028f283 in mysql_st_execute () from
/usr/local/lib/perl/5.8.4/auto/DBD/mysql/mysql.so
#9 0x4029549a in XS_DBD__mysql__st_execute () from
/usr/local/lib/perl/5.8.4/auto/DBD/mysql/mysql.so
#10 0x4026fb30 in XS_DBI_dispatch () from /usr/lib/perl5/auto/DBI/DBI.so
#11 0x080c32d6 in Perl_pp_entersub ()
#12 0x080bbdc9 in Perl_runops_standard ()
#13 0x080635e8 in perl_run ()
#14 0x080633f5 in perl_run ()
#15 0x0805fb9f in main ()

Todd Chapman wrote:>On Tue, Mar 08, 2005 at 05:03:40PM -0500, John C. Hennessy wrote:

Hello,

I’m having problems with the rt-crontool and rt-escalate perl scripts.
They always seg fault on RT::Init();

Below is a copy of the script I’m using if anyone has an suggestions I’d
love to hear them :slight_smile:

-John

Are you sure you are pointing at the correct Perl on your system?