From owner-freebsd-questions@FreeBSD.ORG Wed Feb 20 06:17:32 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A29816A400 for ; Wed, 20 Feb 2008 06:17:32 +0000 (UTC) (envelope-from navneet.upadhyay@gmail.com) Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.186]) by mx1.freebsd.org (Postfix) with ESMTP id A8A0813C455 for ; Wed, 20 Feb 2008 06:17:31 +0000 (UTC) (envelope-from navneet.upadhyay@gmail.com) Received: by ti-out-0910.google.com with SMTP id j2so1061087tid.3 for ; Tue, 19 Feb 2008 22:17:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=hTTXKg53+8o3p32juq5TLCje3IRjoTlUMBe5Ku+EJlU=; b=tnQBhZvw+dGf8ozdkTgpm/vfzmRj5DrorxLB6NfIMZi4DhMplmWBZTHbrX9HpwOpOTOLWpdildkmiq6SGansBEpg9CxhNFVS5fxZOr6iuC1c94cUK1V5dHziiNNXUKDOZUmCBz6nnXBZj7lLrUif9IIzaolstnKlbvFJA0avmts= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=J3PZFuyDkQ4UKSM0As/hN0NxGT90M7swLEhEqEPXDOe7hOH8kRxCZtNgrIHiekJgX5BeW05zbBY95oDFeFkPkY518V3932eMljs5074/Kkonba+MYoegG8J6kxp0trs13UkgLeWg/piNzydyHRp5g1DQ4SuBdqoBtndOjfnIMSU= Received: by 10.110.28.2 with SMTP id b2mr5134684tib.41.1203488250647; Tue, 19 Feb 2008 22:17:30 -0800 (PST) Received: by 10.150.185.7 with HTTP; Tue, 19 Feb 2008 22:17:30 -0800 (PST) Message-ID: <1563a4fd0802192217v2776fd50hf299ee7d86d9fb5c@mail.gmail.com> Date: Wed, 20 Feb 2008 11:47:30 +0530 From: "navneet Upadhyay" To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: 32 bit FreeBSD compiled binary coredumps on 64 bit(amd) FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2008 06:17:32 -0000 Hi, I am compiling the binary on 32 bit FreeBSD and running it on 64 (amd64)bit FreeBSD . FreeBSD says it is possible to do so. But my application core dumps . I investigated the reason which is as follows : The problem is in the call retval = sysctl(mib, 4, &kp, &sz, NULL, 0); where sz is size of kp and where kp is a structure of type kinfo_proc. The size of this structure on 32bit system is 768 and on 64 bit system is 1088. The call works on 32 bit system but when run on 64 bit system it coredumps , because of the size mismatch of kinfo_proc . If i hardcode the sz to 1088 then it works on amd64 systems , how do i deal with it. I am anticipating lot of coredumps like that, what is a generic solution for such kinds of problems. Do Anyone has any clues ? Thanks, navneet