You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2006/09/14 23:27:41 UTC

[Bug 5100] perl crashing at spamd's "$opt{'socketpath'}"

http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5100





------- Additional Comments From openmacnews@gmail.com  2006-09-14 21:27 -------
figured out the perl_debugger ...

stepping through 'spamd' with perl_debugger, (actually a working copy i've named
'spamd_test.pl'), i follow into:

		sub daemonize {
		  # Pretty command line in ps
		  $0 = join (' ', $ORIG_ARG0, @ORIG_ARGV) unless would_log("dbg");
		
		  # be a nice daemon and chdir to the root so we don't block any
		  # unmount attempts
		  chdir '/' or die "spamd: cannot chdir to /: $!\n";
		
		  # Redirect in and out to the bit bucket
		  open STDIN,  "</dev/null" or die "spamd: cannot read from /dev/null: $!\n";
		  open STDOUT, ">/dev/null" or die "spamd: cannot write to /dev/null: $!\n";
		
		  # Remove the stderr logger
		  Mail::SpamAssassin::Logger::remove('stderr');
		
		  # Here we go...
2140:	  defined( my $pid = fork ) or die "spamd: cannot fork: $!\n";
2141:	  exit if $pid;
2142:	  setsid or die "spamd: cannot start new session: $!\n";
2143:	
2144:	  # Now we can redirect the errors, too.
2145:	  open STDERR, '>&STDOUT' or die "spamd: cannot duplicate stdout: $!\n";
2146:	
2147:	  dbg("spamd: successfully daemonized");
	}


i can bkpt *cleanly* TO the line 2140:

	  DB<1> c 2140
	main::daemonize(./spamd_test.pl:2140):
	2140:     defined( my $pid = fork ) or die "spamd: cannot fork: $!\n";
	  DB<2> 

and, if i then bkpt to line 2147:

	  DB<2> c 2147
	Debugged program terminated.  Use q to quit or R to restart,
	  use o inhibit_exit to avoid stopping after program termination,
	  h q, h R or h o to get additional info.  
	  DB<3> 


i get the crash:

	Sep 14 14:23:26 server crashdump[21963]: perl crashed
	Sep 14 14:23:27 server crashdump[21963]: crash report written to:
/Library/Logs/CrashReporter/perl.crash.log

as before ...

	Exception:  EXC_BAD_ACCESS (0x0001)
	Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000000
	
	Thread 0 Crashed:
	0   libSystem.B.dylib        	0x90131a80 bcmp + 224
	1   com.apple.CoreFoundation 	0x902c580c __CFInitialize + 420
	2   dyld                     	0x8fe15660
ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 672
	3   dyld                     	0x8fe0bbe8 
	...


if however, i bkpt to 2140, then try to single-step:

	  DB<1> c 2140
	main::daemonize(./spamd_test.pl:2140):
	2140:     defined( my $pid = fork ) or die "spamd: cannot fork: $!\n";
	  DB<2> s
	######### Forked, but do not know how to create a new TTY. #########
	  Since two debuggers fight for the same TTY, input is severely entangled.
	
	main::daemonize(./spamd_test.pl:2141):
	2141:     exit if $pid;
	  DB<2>   I know how to switch the output to a different window in xterms
	  and OS/2 consoles only.  For a manual switch, put the name of the created TTY
	  in $DB::fork_TTY, or define a function DB::get_fork_TTY() returning this.
	
	  On UNIX-like systems one can get the name of a TTY for the given window
	  by typing tty, and disconnect the shell from TTY by sleep 1000000.
	
	main::daemonize(./spamd_test.pl:2141):
	2141:     exit if $pid;
		{pid=21967}  DB<2> s
	Mail::SpamAssassin::Logger::CODE(0x18bf8f0)(/usr/local/perl_libs/sitelib/Mail/SpamAssassin/Logger.pm:319):
	319:      close_log();
	  DB<2> s
	Mail::SpamAssassin::Logger::close_log(/usr/local/perl_libs/sitelib/Mail/SpamAssassin/Logger.pm:313):
	313:      while (my ($name, $object) = each %{ $LOG_SA{method} }) {
	  DB<2> s
	Mail::SpamAssassin::Logger::close_log(/usr/local/perl_libs/sitelib/Mail/SpamAssassin/Logger.pm:313):
	313:      while (my ($name, $object) = each %{ $LOG_SA{method} }) {
	  DB<2> s
	Mail::SpamAssassin::Logger::close_log(/usr/local/perl_libs/sitelib/Mail/SpamAssassin/Logger.pm:314):
	314:        $object->close_log();
	  DB<2> s
	Mail::SpamAssassin::Logger::Syslog::close_log(/usr/local/perl_libs/sitelib/Mail/SpamAssassin/Logger/Syslog.pm:207):
	207:      my ($self) = @_;
	  DB<2> s
	Mail::SpamAssassin::Logger::Syslog::close_log(/usr/local/perl_libs/sitelib/Mail/SpamAssassin/Logger/Syslog.pm:209):
	209:      closelog();
	  DB<2> s
	Sys::Syslog::closelog(/usr/local/perl_libs/privlib/darwin-thread-multi-2level/Sys/Syslog.pm:133):
	133:        $facility = $ident = '';
	  DB<2> s
	Sys::Syslog::closelog(/usr/local/perl_libs/privlib/darwin-thread-multi-2level/Sys/Syslog.pm:134):
	134:        disconnect_log();
	  DB<2> s
	Sys::Syslog::disconnect_log(/usr/local/perl_libs/privlib/darwin-thread-multi-2level/Sys/Syslog.pm:628):
	628:        $connected = 0;
	  DB<2> s
	Sys::Syslog::disconnect_log(/usr/local/perl_libs/privlib/darwin-thread-multi-2level/Sys/Syslog.pm:629):
	629:        $syslog_send = undef;
	  DB<2> s
	Sys::Syslog::disconnect_log(/usr/local/perl_libs/privlib/darwin-thread-multi-2level/Sys/Syslog.pm:631):
	631:        if($current_proto eq 'native') {
	  DB<2> s
	Sys::Syslog::disconnect_log(/usr/local/perl_libs/privlib/darwin-thread-multi-2level/Sys/Syslog.pm:636):
	636:        return close SYSLOG;
	  DB<2> s
	Mail::SpamAssassin::Logger::close_log(/usr/local/perl_libs/sitelib/Mail/SpamAssassin/Logger.pm:313):
	313:      while (my ($name, $object) = each %{ $LOG_SA{method} }) {
	  DB<2> s
	Debugged program terminated.  Use q to quit or R to restart,
	  use o inhibit_exit to avoid stopping after program termination,
	  h q, h R or h o to get additional info.  
	  DB<2> q
	/usr/ports/temp  > main::daemonize(./spamd_test.pl:2142):
	2142:     setsid or die "spamd: cannot start new session: $!\n";
	{pid=21967}  DB<2> 


and, atm, not sure what to make of that ...  :-/



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.