From owner-freebsd-hackers Thu Aug 3 3:25:38 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from viper.dmpriest.com (viper.dmpriest.com [195.188.177.3]) by hub.freebsd.org (Postfix) with ESMTP id C3F7637B72C for ; Thu, 3 Aug 2000 03:25:31 -0700 (PDT) (envelope-from kpielorz@tdx.co.uk) Received: from tdx.co.uk (lorca.tdx.co.uk [195.188.177.195]) by viper.dmpriest.com (8.9.3/8.9.3/Kp) with ESMTP id LAA45990 for ; Thu, 3 Aug 2000 11:25:27 +0100 (BST) Message-ID: <39894897.79E14398@tdx.co.uk> Date: Thu, 03 Aug 2000 11:25:27 +0100 From: Karl Pielorz Organization: TDX - The Digital eXchange X-Mailer: Mozilla 4.73 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: hackers@freebsd.org Subject: LD_PRELOAD odities / Documentation? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi All, I'm working on some code that runs fine on Linux, but not under FreeBSD... Trying to port the code is proving to be a pain... The code is a 'wrapper' / 'shim' that's meant to be LD_PRELOAD'ed before an executable... I've gotten everything to compile, and the LD_PRELOAD works, but a lot of syscall's from the wrapper library fail either with bizare messages such as "malloc(): recursive call", or just die horibly (segmentation faults, and all sorts). Are there any problems from making syscalls / library calls from within an LD_PRELOAD'ed library? - Is anything like this documented anywhere? Most things seem to work, but calling even simply library routines such as 'strcat', 'sprintf' etc. die in flames... The wrapper I'm porting wraps a number of functions from libc (e.g. 'open', 'opendir' etc.) Any pointers would be greatefuly received, unfortunately this all works under Linux (I'm not bashing anyone on the head with that, I'm far more interested in getting it working under FreeBSD)... Thanks, -Karl To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message