From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,2e834e7a0616e6f6 X-Google-Attributes: gid111c93,public From: Wolfram Gloger Subject: Re: xquake binary update Date: 1997/09/24 Message-ID: #1/1 X-Deja-AN: 275208390 Sender: wmglo@md.dent.med.uni-muenchen.de References: <6066sh$s6g$1@palladium.transmeta.com> Distribution: world Organization: [posted via] Leibniz-Rechenzentrum, Muenchen (Germany) Newsgroups: comp.os.linux.alpha torvalds@transmeta.com (Linus Torvalds) writes: > The problem was due to the newer 'malloc()' implementation that no > longer allocated contiguous memory (it uses anonymous mmap() for large > memory allocations). Quake uses some 32-bit offsets internally, and the > offsets between different allocations no longer fit into 32 bits with > the new malloc. This is true, probably because the kernel picks addresses far away from the `conventional' heap for anonymous mmap(0, ...). I guess no application should depend on small offsets for 64bit systems. Please take note that a quick solution for this kind of problem (without compiling a new binary) is to disable the use of mmap() in the allocator by setting the environment variable `MALLOC_MMAP_MAX_=0'. This works on any recent GNU libc-2 (and also with Linux libc-5.4.x), and is IMHO _much_ preferable to preloading another libc or malloc. The same holds for buggy applications that e.g. free() a pointer twice in a row -- in many cases this can be caught by setting `MALLOC_CHECK_=1' (at some performance cost; please do fix the applications in the long run). I hope this helps preventing some panic and embarassment in the future... Regards, Wolfram.