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.257 by root, Sat Apr 21 17:34:24 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->deactivate_recursive;
1868
1867 return if UNIVERSAL::isa $self->map, "ext::map_link"; 1869 return if UNIVERSAL::isa $self->map, "ext::map_link";
1868 1870
1869 $self->{_link_pos} ||= [$self->map->{path}, $self->x, $self->y] 1871 $self->{_link_pos} ||= [$self->map->{path}, $self->x, $self->y]
1870 if $self->map; 1872 if $self->map;
1871 1873
2433 2435
2434 die $$res unless "ARRAY" eq ref $res; 2436 die $$res unless "ARRAY" eq ref $res;
2435 2437
2436 return wantarray ? @$res : $res->[-1]; 2438 return wantarray ? @$res : $res->[-1];
2437 } else { 2439 } else {
2440 reset_signals;
2438 local $SIG{__WARN__}; 2441 local $SIG{__WARN__};
2442 local $SIG{__DIE__};
2439 eval { 2443 eval {
2440 local $SIG{__DIE__};
2441 close $fh1; 2444 close $fh1;
2442 2445
2443 my @res = eval { $cb->(@args) }; 2446 my @res = eval { $cb->(@args) };
2444 syswrite $fh2, Coro::Storable::freeze +($@ ? \"$@" : \@res); 2447 syswrite $fh2, Coro::Storable::freeze +($@ ? \"$@" : \@res);
2445 }; 2448 };
2921 prio => 6, 2924 prio => 6,
2922 cb => \&IO::AIO::poll_cb, 2925 cb => \&IO::AIO::poll_cb,
2923 ); 2926 );
2924} 2927}
2925 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
2926# load additional modules 2967# load additional modules
2927use cf::pod; 2968use cf::pod;
2928 2969
2929END { cf::emergency_save } 2970END { cf::emergency_save }
2930 2971

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines