Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111682 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 92900 invoked from network); 25 Aug 2020 12:28:22 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Aug 2020 12:28:22 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 050D91804DB for ; Tue, 25 Aug 2020 04:31:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 25 Aug 2020 04:31:16 -0700 (PDT) Received: by mail-qt1-f169.google.com with SMTP id o22so8618749qtt.13 for ; Tue, 25 Aug 2020 04:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=8pOPB+xzy1pJXsukXq79LHpPgaZL2/mEbqYbsJVPfe0=; b=eWwZbH6hEbxLqOZhs7f3MD3+Xpf8ZDYdjIvCK8vKPToETSjFr6UbavMT+N/QvSGWki 7AiG+5rH2QwDtwI3tW+vjtpXBPNppePjSpaU5UqGjEDB/Cp2PRKKsp6TF0tB20Q0iBLC 18xodwsT+z4el2LFn+nRm4c37Jl7X8q4udtssC3VFcJXAdukanIOdc06XPOqpijogzkh 4CthCUqR8oJxjLTO4Qu1Uutcp3+COUQ5FSD9HNAm/76p5+w2O9iw2uTgMBgigpZdGC/k +bPnbfbvyDtjtBRaBRc2U0QGntXQ2Hro5iyt+QZ6MUO9tyxzV0fMER6NmiP9xUU/BEp6 gCnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=8pOPB+xzy1pJXsukXq79LHpPgaZL2/mEbqYbsJVPfe0=; b=nzwoz0AGuX/4DNLtJRn3EZQ1hupe6k8bHtirKQUFBvz2X4opKkdgbFoENijOKqE4Q/ BJjw3pZHNIWELqPWFgaSwta9n4AfbtCOsbn1BDr8LkJvvKsKR+Xd15KxBJwCG8Hfi/yz OGr1aFYi26Jj2fXOtAdLCd0kxheiPEXpya4H8Jg9wv2h+LCbvI66M2pheWzKQ9XCRXt7 EI5RSqPWeF49pXgInRebnkTWrw7qS8/RG7GfvVXLpIfN5EHJc8FNXGiPpdLkkxomQs8D qD2q64l6yrpiK7V3YUl/KxnWFDuDuLLVkRKHbdf2a08kgThsE12cex8zsZ1P0V5Nxa6I 1KNg== X-Gm-Message-State: AOAM533HoHW+jVIunBkrxzb+gtbuAb9dh69DVpQh3zQzp0DxS/emDcYf 2NO6BauL4fVJQkqB/Z62YeDFjF45uadYju/eLGaO6/EgMg== X-Google-Smtp-Source: ABdhPJwtlt/dbNnIhnap7u7c9ZJrt+tle/rzqG1Bxg9sOYUJGMFRxk3VJJyTtzk6PDhkT6iocZuvkp2d4cyKCX0bidY= X-Received: by 2002:aed:3c66:: with SMTP id u35mr9204259qte.272.1598355074800; Tue, 25 Aug 2020 04:31:14 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 25 Aug 2020 14:31:04 +0300 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000007561a205adb20a5e" Subject: Segmentation Fault when trying to call zend_new_array. From: ivanzanev477@gmail.com (Ivan Zanev) --0000000000007561a205adb20a5e Content-Type: text/plain; charset="UTF-8" Hello, I'm trying to learn a bit more about HashTable in PHP internally and how memory is allocated when generating arrays with various sizes. I created a simple C script that would call HashTable *ht = zend_new_array(15); However, when I compile the script with gcc, I get segmentation fault; gdb tells that the problem is located within _emalloc_56, specifically: 2535 if (UNEXPECTED(AG(mm_heap)->use_custom_heap)) { That's how I compiled the script: gcc -I./Zend -I. -I./TSRM -I./main Zend/*.c TSRM/TSRM.c test.c -ldl -lm -g For the configuration I used: ./configure Could you please guide me in the right direction? Is there something I should do before calling zend_new_array? Sincerely, Ivan --0000000000007561a205adb20a5e--