public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gnu.org at hovland dot cx" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/111556] OMP_* environment variables not read if libgomp is loaded via dlopen([..], [..]|RTLD_DEEPBIND) and the process executable access the environ global variable
Date: Thu, 14 Dec 2023 16:49:51 +0000	[thread overview]
Message-ID: <bug-111556-4-MHpyfgKIuw@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111556-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111556

Jay <gnu.org at hovland dot cx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gnu.org at hovland dot cx

--- Comment #4 from Jay <gnu.org at hovland dot cx> ---
Hi,

I am using PHP with an extension imagick.
PHP loads this extension with dlopen() and flag RTLD_DEEPBIND.
At some point libgomp gets loaded in this process.
During libgomp and initialize_env(), the process crashes because environ is
probably not initialised yet causing line 2062 in env.c to crash at:

<<< for (env = environ; *env != 0; env++)


Loading the same extension without deepbind solves the problem since I guess
the environ-variable gets overloaded/set by calling code, but perhaps you could
add a non-NULL test ? It would probably solve the problem when using deepbind.

  parent reply	other threads:[~2023-12-14 16:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-23 17:45 [Bug libgomp/111556] New: " silvio at traversaro dot it
2023-09-23 17:53 ` [Bug target/111556] " pinskia at gcc dot gnu.org
2023-09-23 18:04 ` jakub at gcc dot gnu.org
2023-09-24 19:27 ` silvio at traversaro dot it
2023-12-14 16:49 ` gnu.org at hovland dot cx [this message]
2023-12-14 16:56 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-111556-4-MHpyfgKIuw@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).