|
From: Scott K. <val...@ke...> - 2004-09-15 15:34:28
|
Oops, it's even simpler than that. Doesn't even need to involve
pthreads:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
FILE *mailer;
mailer = popen("/usr/sbin/sendmail -t", "w");
if (mailer) {
fprintf(mailer, "To: %s\n", getenv("USER"));
fprintf(mailer, "Subject: Test email\n");
fprintf(mailer, "\n");
fprintf(mailer, "This is a test!\n");
pclose(mailer);
}
return 0;
}
.......................
[scott@localhost scott]$ valgrind --tool=memcheck --num-callers=40
./test
==8794== Memcheck, a memory error detector for x86-linux.
==8794== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward et al.
==8794== Using valgrind-2.2.0, a program supervision framework for
x86-linux.
==8794== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward et al.
==8794== For more details, rerun with: -v
==8794==
got signal 17 in LWP 8794 (8794)
valgrind: vg_signals.c:1997 (vg_async_signalhandler): Assertion
`vgPlain_ksigismember(&uc->uc_sigmask, sigNo)' failed.
.......................
/usr/sbin/sendmail is actually a just a wrapper for qmail here.
Signal 17 is SIGCHLD (child process has stopped or exited, changed). If
valgrind doesn't support this, is there anyway I can get it to ignore
it?
Thanks,
Scott.
|