From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 5ED3D6EC5D; Fri, 2 Apr 2021 15:34:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5ED3D6EC5D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617366896; bh=HM0/qIZimpcqiMUHkAsM4PmDmSkGJWpV8mKDy/YqDRE=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=WrF3jb7XB9YORfAALJX2WFeCqOnIW8w6ffaPGczu7Da3ZiBMibub8NRSGkueWMhik b+xm+ar4f5r+V2siYismlVellWQIrGSIgNjG7s4aWNR4ilZlBoQVw2zZZh4Tw4J5T2 2LHohOjEB7RWmRZ76rUVfX3vlgBc8XrgCRtRL7Z0= Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C47F16EC5D for ; Fri, 2 Apr 2021 15:34:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C47F16EC5D Received: by mail-lf1-f42.google.com with SMTP id v15so7405175lfq.5 for ; Fri, 02 Apr 2021 05:34:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SsdwBjKOFSZJz1E4k6auj7HQPwMunKU/+4/jDb4/5Qw=; b=PgM22Qw2o5INXDSMMd/dlISqeT3kX9NraqRgQEP5cWm+i3cFPxORCB422TJQK9vAgG Fy60YRuzPY0RpYutzgtH3LdOcHwJWyd4JGgiW+xas+3PmlDkIi3rsXU/LDOtHrfc0OP2 L05RvUFAq/k63kwSeZnPKkCBPmSVUlQ1tNqNJ8nKQptCVVnTHOkOMsKMZkMSRFOzKCTc Ol4gvKJULSxaedAaCy2qrLdwu+cA6MPU8zvkALouK3rJa9C5Idk/93tQOXp4tXZoGOFR B3ZCJDQTvlz8bVNRxSP8O2STl2JlV+Tl8phPfvaJorASsQQqFOVN11bZPnEXYDiddLDy W4cw== X-Gm-Message-State: AOAM532S7QBOMX7A5S7Hod6UtKTJ/OqYnzEgrqP2OE3/5EgmMQ5oPB6t Tp9a4DGydTfTsKfYG0olyVm/82/XyisRMQ== X-Google-Smtp-Source: ABdhPJwys0/S1T0D4qjTn43UC51r3FSPxzMpr306z7F/ABMZaQygy4vVqkO/56LTgvktnR5AdL779A== X-Received: by 2002:ac2:4dbb:: with SMTP id h27mr9013697lfe.634.1617366876689; Fri, 02 Apr 2021 05:34:36 -0700 (PDT) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id 188sm871009lfo.0.2021.04.02.05.34.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 05:34:35 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 1E6F956010E; Fri, 2 Apr 2021 15:34:22 +0300 (MSK) To: tml Date: Fri, 2 Apr 2021 15:34:14 +0300 Message-Id: <20210402123420.885834-2-gorcunov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210402123420.885834-1-gorcunov@gmail.com> References: <20210402123420.885834-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v20 1/7] box/schema: make sure hashes are created X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" These are critical structures, strictly speaking if malloc has failed we're likely under heavy memory pressure and won't continue anyway but better to exit explicitly. In-scope-of #4642 Signed-off-by: Cyrill Gorcunov --- src/box/schema.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/box/schema.cc b/src/box/schema.cc index 963278b19..89904e4d2 100644 --- a/src/box/schema.cc +++ b/src/box/schema.cc @@ -372,6 +372,13 @@ schema_init(void) funcs = mh_i32ptr_new(); funcs_by_name = mh_strnptr_new(); sequences = mh_i32ptr_new(); + + if (spaces == NULL || spaces_by_name == NULL || + funcs == NULL || funcs_by_name == NULL || + sequences == NULL) { + panic("Can't allocate schema hashes"); + } + /* * Create surrogate space objects for the mandatory system * spaces (the primal eggs from which we get all the -- 2.30.2