Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98832 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10142 invoked from network); 20 Apr 2017 22:27:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2017 22:27:54 -0000 Authentication-Results: pb1.pair.com header.from=danielgatis@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=danielgatis@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.52 as permitted sender) X-PHP-List-Original-Sender: danielgatis@gmail.com X-Host-Fingerprint: 209.85.215.52 mail-lf0-f52.google.com Received: from [209.85.215.52] ([209.85.215.52:34074] helo=mail-lf0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/48-61625-8E539F85 for ; Thu, 20 Apr 2017 18:27:53 -0400 Received: by mail-lf0-f52.google.com with SMTP id t144so36369569lff.1 for ; Thu, 20 Apr 2017 15:27:52 -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=78vEheZbrJBGNcOzuX46SjEpKezH6gJmgJOtA4kE6Jg=; b=eg3GpCu/Pj1ZE+Hn6xEG0exa18mKLcNsNOhVrDXsPOfZqyXhgySqp+YzePKnyBjU3t 92WhcW21o1VIHvILGdqpegGw5qGV2BD7nLAl0QjIXZeAFCSoHDIzebEQBy7BT/jX8Mkp TY2ZzT1JA+V96TdjhoxSk6RqTkaf6PEpe2h7H84eIs+XiCk5EtQ3KN5e0zjf08opS8Ce pNKIuH3FjXP8FdwHoZ2KRpmSPCynBYT1hmIPNDp4yVDwmnHjRYN5P/5EPKte0A5HJo8L ifSlH6UL2Uemhiop0KrFGOc6ZaCjKjKJuhujP2v8xUeLN18QMagJ7BZNdGOn03u0s5UV +ZrQ== 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=78vEheZbrJBGNcOzuX46SjEpKezH6gJmgJOtA4kE6Jg=; b=jtPI/km5QkQ5IvmMUGAkJD+h5WSmusKakvuzNoymVycHPENxJwwyKtgdzWwzMA2E4T D4Th9yAZERn8gA+V+G7/6+i2vXmUiNatq93wfTH5DBxrlPqkCzM8zn/c6sxwmvK92fKT gwtY8g8NXvmWvZUaEIYOt6uZDLLjk6EhWvkJKmYWhtVdK9ZCFPjy/Y2R83fHTuAwfu5V xL9pglpdcCF+P5wHH0opLI71PMJR3BWxOfEr6lFZi/H1PQMe9xNhkAjka8dcShbpkIg+ RtUygiqAXf3B8GmEGy9MdXJVRwkK+yiLMblJVHYEer7jP2rplMHZu2g1oqOg+f32tpIp veug== X-Gm-Message-State: AN3rC/7BjSDz/EoZG+rYJAVLmAk77lK2Ctoi1yvrUPv5lBByzEyKetdB 4mlxzgC9UjGfg8LuCqmTFRZ/5pcEDYrh X-Received: by 10.25.0.213 with SMTP id 204mr3624821lfa.156.1492727270011; Thu, 20 Apr 2017 15:27:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.67.6 with HTTP; Thu, 20 Apr 2017 15:27:49 -0700 (PDT) Received: by 10.25.67.6 with HTTP; Thu, 20 Apr 2017 15:27:49 -0700 (PDT) Date: Thu, 20 Apr 2017 19:27:49 -0300 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=001a113c9aecacfbfc054da0a67d Subject: Segmentation fault when try to get the 'current_execute_data' on a PHP extension From: danielgatis@gmail.com (daniel gatis) --001a113c9aecacfbfc054da0a67d Content-Type: text/plain; charset=UTF-8 I'm trying to develop a php extension for print all functions call like a backtrace. But when I'm trying to get the current function a segmentation fault is throw. What is the problem with my code? My php test code: function a() { b(); } function b() { c(); } function c() { var_dump(hello_world()); } a(); My extension code: #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" #include "php_hello_world.h" PHP_FUNCTION(hello_world) { zend_execute_data *ptr = NULL; ptr = EG(current_execute_data); // <----- Segmentation fault (core dumped) } const zend_function_entry hello_world_functions[] = { PHP_FE(hello_world, NULL) PHP_FE_END }; zend_module_entry hello_world_module_entry = { STANDARD_MODULE_HEADER, "hello_world", hello_world_functions, NULL, NULL, NULL, NULL, NULL, PHP_hello_world_VERSION, STANDARD_MODULE_PROPERTIES }; #ifdef COMPILE_DL_hello_world #ifdef ZTS ZEND_TSRMLS_CACHE_DEFINE() #endif ZEND_GET_MODULE(hello_world) #endif --001a113c9aecacfbfc054da0a67d--