Date: Wed, 20 Feb 2008 11:47:30 +0530 From: "navneet Upadhyay" <navneet.upadhyay@gmail.com> To: freebsd-questions@freebsd.org Subject: 32 bit FreeBSD compiled binary coredumps on 64 bit(amd) FreeBSD Message-ID: <1563a4fd0802192217v2776fd50hf299ee7d86d9fb5c@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1563a4fd0802192217v2776fd50hf299ee7d86d9fb5c>