From owner-freebsd-questions Wed Jul 11 23: 2:21 2001 Delivered-To: freebsd-questions@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id 8ED2937B403; Wed, 11 Jul 2001 23:02:15 -0700 (PDT) (envelope-from dillon@earth.backplane.com) Received: (from dillon@localhost) by earth.backplane.com (8.11.3/8.11.2) id f6C628T41618; Wed, 11 Jul 2001 23:02:08 -0700 (PDT) (envelope-from dillon) Date: Wed, 11 Jul 2001 23:02:08 -0700 (PDT) From: Matt Dillon Message-Id: <200107120602.f6C628T41618@earth.backplane.com> To: Mark Peek Cc: "Lanny Baron" , Giorgos Keramidas , Igor Kulemzin , "Andrey Simonenko" , freebsd-questions@FreeBSD.ORG, stable@FreeBSD.ORG Subject: Re: cron exited on signal 11 References: <1399129667.20010709164730@mail.ru> <006e01c10927$c3151d80$6d36120a@comsys.ntukpi.kiev.ua> <18810557330.20010711121320@mail.ru> <86itgz4eyf.fsf@hades.hell.gr> <20010711224709.11607.qmail@panda.freebsdsystems.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :Try this patch... : :Index: usr.sbin/cron/lib/env.c :=================================================================== :RCS file: /cvs/freebsd/src/usr.sbin/cron/lib/env.c,v :retrieving revision 1.9 :diff -u -r1.9 env.c :--- usr.sbin/cron/lib/env.c 2000/04/30 15:57:00 1.9 :+++ usr.sbin/cron/lib/env.c 2001/07/12 03:12:29 :@@ -41,6 +41,8 @@ : { : char **p; : :+ if (envp == NULL) :+ return; : for (p = envp; *p; p++) : free(*p); : free(envp); : : :Mark Well this certainly opens up a can of worms! Not your patch, but what it implies. For example, env_set() assumes envp is not NULL as well. In fact, most of the code assumes envp is not NULL, and 99% of the time that is true due to the env_init() calls. I found at least one case in the code where free_entry() is called with e->envp == NULL. Perhaps a more correct fix would simply be to have free_entry() check for e->envp != NULL before calling env_free() rather then having env_free() check for NULL. It would be great if the original poster could try this patch rather then the above patch to see if it also fixes the problem. -Matt Index: lib/entry.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/cron/lib/entry.c,v retrieving revision 1.12 diff -u -r1.12 entry.c --- lib/entry.c 2001/06/13 05:49:37 1.12 +++ lib/entry.c 2001/07/12 05:59:54 @@ -74,7 +74,8 @@ free(e->class); #endif free(e->cmd); - env_free(e->envp); + if (e->envp != NULL) + env_free(e->envp); free(e); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message