From owner-freebsd-ports Sat Jul 7 21:20:29 2001 Delivered-To: freebsd-ports@freebsd.org Received: from polarbear.nameprotect.com (mail.nameprotect.com [12.40.85.19]) by hub.freebsd.org (Postfix) with ESMTP id 8224037B401; Sat, 7 Jul 2001 21:20:27 -0700 (PDT) (envelope-from gabor@nameprotect.com) Received: from nameprotect.com (gabor-bsd.nameprotect.com [192.168.1.161]) by polarbear.nameprotect.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 338Z4DKT; Sat, 7 Jul 2001 23:16:46 -0500 Message-ID: <3B47DF8A.759C6338@nameprotect.com> Date: Sat, 07 Jul 2001 23:20:26 -0500 From: Gabor Kincses X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: hu, de-DE, en MIME-Version: 1.0 To: obrien@FreeBSD.org Cc: ports@FreeBSD.org Subject: Multi-threaded ElectricFence Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hello, It seems -DUSE_SEMAPHORE forces Efence into a stack overrun, because the FreeBSD (pthread) sem_init() implementation uses malloc(). Efence's malloc() replaces the standard malloc(), which calls initialize(). Since initialize() calls sem_init() when -DUSE_SEMAPHORE is on, we have a nice tight stack overrun. I have been trying to remove the malloc() dependency (at any cost) from initialize(), by not calling sem_init() until main() creates some other threads. Oh, yeah, all of the above happens before main() comes into the picture. Any ideas? -- Gabor Kincses Running FreeBSD 4.3-RC3 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message