Skip to content

Add macOS to local_offset_at's OS_HAS_THREAD_SAFE_ENVIRONMENT #718

Open
@PaulDance

Description

@PaulDance

Dear maintainers,

I know this may seem like the 1298th duplicate issue about the underlying problem at first glance, but I have seen the previous issues regarding macOS vs. local offsets and still think something may have been missed. In any case, I'm open to discussion, hence my opening this.

Indeed, the local_offset_at has a few soundness checks, one of them being OS_HAS_THREAD_SAFE_ENVIRONMENT. When true, which is rarely the case, further soundness checks are disabled.

However, macOS is not part of the list, while what I'm seeing seems to indicate it should: although FreeBSD's implementation is most probably not thread-safe and the macOS man pages do not mention it either, the actual Apple libc implementations of getenv and setenv really do seem to be thread-safe, which was added in this commit, itself included as part of macOS 10.12.

Therefore, is there still a good reason not to include macOS in the thread-safe list? I've seen segmentation faults mentioned around here and specifically for this platform, but I would be surprised it would come from the environment manipulation itself.

Thanks in advance,
Paul.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-local-offsetArea: local offsetC-enhancementCategory: an enhancement with existing code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions