From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12365 invoked by alias); 15 Oct 2002 12:56:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 12344 invoked by uid 71); 15 Oct 2002 12:56:01 -0000 Resent-Date: 15 Oct 2002 12:56:01 -0000 Resent-Message-ID: <20021015125601.12343.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, jkanze@caicheuvreux.com, gdr@nerim.net Resent-Reply-To: gcc-gnats@gcc.gnu.org, gdr@nerim.net Received: (qmail 5457 invoked by uid 61); 15 Oct 2002 12:48:09 -0000 Message-Id: <20021015124809.5456.qmail@sources.redhat.com> Date: Tue, 15 Oct 2002 05:56:00 -0000 From: gdr@nerim.net Reply-To: gdr@nerim.net To: gcc-gnats@gcc.gnu.org Cc: jkanze@caicheuvreux.com, gdr@nerim.net X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) X-GNATS-Notify: jkanze@caicheuvreux.com, gdr@nerim.net Subject: libstdc++/8230: Buggy allocator behaviour X-SW-Source: 2002-10/txt/msg00572.txt.bz2 List-Id: >Number: 8230 >Category: libstdc++ >Synopsis: Buggy allocator behaviour >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Oct 15 05:56:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: James Kanze >Release: all GCC releases. >Organization: >Environment: Plateform independent, though the program below displays the buggy behaviour on IA32. >Description: std:allocator::allocate(n) does not check for possible overflow before "folding" sizeof(T) * n. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="jk.C" Content-Disposition: inline; filename="jk.C" #include #include int main() { static size_t const size = 1024 * 1024 * 1024 ; std::vector< int > array ; try { array.reserve( size ) ; } catch ( std::exception const& error ) { std::cerr << "Error: " << error.what() << " (type = " << typeid( error ).name() << ")\n" ; return 2 ; } return 0 ; }