bad_alloc exceptions on Linux (Was: Re: install)
Martin von Loewis
martin@mira.isdn.cs.tu-berlin.de
Wed Apr 22 16:00:00 GMT 1998
> But I get the following incorrect result:
> ôVirtual memory exceeded in `new'ô
>
> System is:
> LIBC:
> /lib/libc.so.4 -> libc.so.4.7.5*
> /lib/libc.so.5 -> libc.so.5.4.44*
I see. This must be a well-known problem, at least to the authors of
libc 5. If you do nm(1) on libc 5, you'll find it implements
__builtin_new. It looks like this copy of __builtin_new is being used,
instead of the copy in egcs (which produces an exception instead of a
message).
This raise some questions:
1. Is this a known problem? Why was __builtin_new included into libc
in the first place?
2. Why isn't the copy of __builtin_new of cp/new1.cc being used?
Ah, I see: __builtin_new is not weak. Is this the problem?
So, in short: you won't get bad_alloc exceptions with libc 5, unless
somebody renames __builtin_new (and friends).
I personally use glibc 2 (aka libc 6), and it works just fine.
Martin
More information about the Gcc
mailing list