ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.258 by root, Sat Apr 21 17:43:42 2007 UTC vs.
Revision 1.262 by root, Sat Apr 28 05:55:55 2007 UTC

1862} 1862}
1863 1863
1864sub cf::object::player::enter_link { 1864sub cf::object::player::enter_link {
1865 my ($self) = @_; 1865 my ($self) = @_;
1866 1866
1867 $self->activate_recursive; 1867 $self->deactivate_recursive;
1868 1868
1869 return if UNIVERSAL::isa $self->map, "ext::map_link"; 1869 return if UNIVERSAL::isa $self->map, "ext::map_link";
1870 1870
1871 $self->{_link_pos} ||= [$self->map->{path}, $self->x, $self->y] 1871 $self->{_link_pos} ||= [$self->map->{path}, $self->x, $self->y]
1872 if $self->map; 1872 if $self->map;
2435 2435
2436 die $$res unless "ARRAY" eq ref $res; 2436 die $$res unless "ARRAY" eq ref $res;
2437 2437
2438 return wantarray ? @$res : $res->[-1]; 2438 return wantarray ? @$res : $res->[-1];
2439 } else { 2439 } else {
2440 reset_signals;
2440 local $SIG{__WARN__}; 2441 local $SIG{__WARN__};
2442 local $SIG{__DIE__};
2441 eval { 2443 eval {
2442 local $SIG{__DIE__};
2443 close $fh1; 2444 close $fh1;
2444 2445
2445 my @res = eval { $cb->(@args) }; 2446 my @res = eval { $cb->(@args) };
2446 syswrite $fh2, Coro::Storable::freeze +($@ ? \"$@" : \@res); 2447 syswrite $fh2, Coro::Storable::freeze +($@ ? \"$@" : \@res);
2447 }; 2448 };
2923 prio => 6, 2924 prio => 6,
2924 cb => \&IO::AIO::poll_cb, 2925 cb => \&IO::AIO::poll_cb,
2925 ); 2926 );
2926} 2927}
2927 2928
2929my $_log_backtrace;
2930
2931sub _log_backtrace {
2932 my ($msg, @addr) = @_;
2933
2934 $msg =~ s/\n//;
2935
2936 # limit the # of concurrent backtraces
2937 if ($_log_backtrace < 2) {
2938 ++$_log_backtrace;
2939 async {
2940 my @bt = fork_call {
2941 @addr = map { sprintf "%x", $_ } @addr;
2942 my $self = (-f "/proc/$$/exe") ? "/proc/$$/exe" : $^X;
2943 open my $fh, "exec addr2line -C -f -i -e \Q$self\E @addr 2>&1 |"
2944 or die "addr2line: $!";
2945
2946 my @funcs;
2947 my @res = <$fh>;
2948 chomp for @res;
2949 while (@res) {
2950 my ($func, $line) = splice @res, 0, 2, ();
2951 push @funcs, "[$func] $line";
2952 }
2953
2954 @funcs
2955 };
2956
2957 LOG llevInfo, "[ABT] $msg\n";
2958 LOG llevInfo, "[ABT] $_\n" for @bt;
2959 --$_log_backtrace;
2960 };
2961 } else {
2962 LOG llevInfo, "[ABT] $msg\n";
2963 LOG llevInfo, "[ABT] [suppressed]\n";
2964 }
2965}
2966
2928# load additional modules 2967# load additional modules
2929use cf::pod; 2968use cf::pod;
2930 2969
2931END { cf::emergency_save } 2970END { cf::emergency_save }
2932 2971

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines