From owner-freebsd-hackers@FreeBSD.ORG Sat Dec 30 21:23:40 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C77F716A403; Sat, 30 Dec 2006 21:23:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay01.kiev.sovam.com (relay01.kiev.sovam.com [62.64.120.200]) by mx1.freebsd.org (Postfix) with ESMTP id 3BBE313C44B; Sat, 30 Dec 2006 21:23:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.227] (helo=fw.zoral.com.ua) by relay01.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.60) (envelope-from ) id 1H0lfh-000GIv-Fr; Sat, 30 Dec 2006 23:23:26 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by fw.zoral.com.ua (8.13.4/8.13.4) with ESMTP id kBULNEYo055862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 30 Dec 2006 23:23:14 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.13.8/8.13.8) with ESMTP id kBULNDgq062668; Sat, 30 Dec 2006 23:23:13 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.13.8/8.13.8/Submit) id kBULNDSA062667; Sat, 30 Dec 2006 23:23:13 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 30 Dec 2006 23:23:13 +0200 From: Kostik Belousov To: Alejandro Pulver Message-ID: <20061230212313.GS21325@deviant.kiev.zoral.com.ua> References: <20061230024718.22131bff@phobos.mars.bsd> <20061230122149.GM21325@deviant.kiev.zoral.com.ua> <20061230111559.760a497b@phobos.mars.bsd> <20061230143103.GP21325@deviant.kiev.zoral.com.ua> <20061230181201.20ade388@phobos.mars.bsd> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rVDsP1EMu6KJGDpG" Content-Disposition: inline In-Reply-To: <20061230181201.20ade388@phobos.mars.bsd> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.88.7, clamav-milter version 0.88.7 on fw.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-0.1 required=5.0 tests=ALL_TRUSTED,SPF_NEUTRAL autolearn=failed version=3.1.7 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on fw.zoral.com.ua X-Scanner-Signature: 69ad68b945e79e087f1af101bf3fefec X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 661 [Dec 30 2006] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {received from trusted relay: not dialup} X-SpamTest-Method: none X-SpamTest-Method: Local Lists X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release Cc: freebsd-hackers@freebsd.org Subject: Re: Program not being executed at all X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Dec 2006 21:23:41 -0000 --rVDsP1EMu6KJGDpG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 30, 2006 at 06:12:01PM -0300, Alejandro Pulver wrote: > On Sat, 30 Dec 2006 16:31:03 +0200 > Kostik Belousov wrote: >=20 > [...] > > > > > Interestingly 'ldd' also crashes when examining it, outputting the > > > > > following (however 'ktrace' has more information): > > > > >=20 > > > > > /usr/local/bin/quake2max: > > > > > /usr/local/bin/quake2max: signal 6 > > > > >=20 > [...] > > > > Please, show the output of the commands > > > > file /usr/local/bin/quake2max > > > > readelf -ld /usr/local/bin/quake2max > > > >=20 > [...] > > Signal 6 is sent by elf image activator upon exec() when old address sp= ace > > is destroyed, but new image cannot be loaded. In your case, I guess that > > extra large bss section size (where uninitialized global/static variabl= es > > are placed) causes loader to fail: > >=20 > > > Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg A= lign > > > LOAD 0x073000 0x080bb000 0x080bb000 0x02cc4 0x28a20e34 RW= 0x1000 > >=20 > > Look at MemSiz column. VirtAddr + MemSiz >=3D 0x30000000, and elf inter= preter > > (/libexec/ld-elf.so.1) is usually mmapped at 0x28000000. > >=20 > > Look at the source for huge global arrays/objects. >=20 > Hello. >=20 > Thank you very much for your help, I have found the array; see below. >=20 > I searched the diff for increments in the macros (it has many global > arrays of a size defined with '#define') and the only thing I could > find is the following: >=20 > -#define MAX_DECAL_FRAGMENTS 32 > +#define MAX_DECAL_FRAGMENTS 64 >=20 > But the problem is here: >=20 > #define MAX_PARTICLES 4096 >=20 > typedef struct particle_s > { > /* skip */ > decalpolys_t decal[MAX_DECAL_FRAGMENTS]; > /* skip */ > } cparticle_t; >=20 > cparticle_t particles[MAX_PARTICLES]; >=20 > The size of the cparticle_t type is 68 in my machine. So 68*32*4096 =3D > 8912896, and in the new version it was doubled to 17825792. In fact, it shall be bigger due to alignment. >=20 > I have changed the definition back to 32, and now 'readelf' reports the > size has been reduced considerably: >=20 > LOAD 0x070000 0x080b8000 0x080b8000 0x03010 0x149a1954 RW 0x= 1000 >=20 > BTW this works in Linux (I haven't tried myself but someone else told > me), so just for curiosity, does it allocate more memory for loading > programs? >=20 > Best Regards, > Ale This is not how much memory is allocated for loading, this is the address map that determines max size of the data/bss section. I don't remember the typical address where linux places mmaped regions and elf interpreter, and do not have accessible machine to check. Most likely, this address is higher for linux. The array of such size (I think up to 1-1.5 Gb) could be easily allocated dynamically by mmap(2). --rVDsP1EMu6KJGDpG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFFltjBC3+MBN1Mb4gRAjW/AKDxZ2anuAyYdj2oQGJ3fsvx8F2guQCgrAT+ b7v5/G6x0tpABI/3531qKwQ= =hedP -----END PGP SIGNATURE----- --rVDsP1EMu6KJGDpG--