Skip to content

regexec symbol conflict with oniguruma #4738

@kornelski

Description

@kornelski

Reproduction steps

  1. Link libgit2 and oniguruma together in one project
  2. Use any libgit2 function that calls git_config_next, which calls all_iter_glob_next and regexec

Expected behavior

The library should co-exist with other libraries

Actual behavior

It crashes if the linker decides to use regexec from oniguruma rather than from libgit2's internal regex dependency.

regexec + 256 (regposix.c:203) // note regposix.c is oniguruma's.
all_iter_glob_next + 85 (config.c:426) // this was meant to call regexec.c
git_config_next + 45 (config.c:1081)
apply_insteadof + 411 (remote.c:2506)
create_internal + 407 (remote.c:216)
git_remote_create_with_fetchspec + 129 (remote.c:321)
git_remote_create + 171 (remote.c:304)
default_remote_create + 49 (clone.c:248)
create_and_configure_origin + 324 (clone.c:280)
git_clone + 532 (clone.c:424)
git2::build::RepoBuilder::clone::h38f379ee2822ae4f + 960 (build.rs:231)

Version of libgit2 (release number or SHA1)

771dfd1

Operating system(s) tested

macOS 10.14

See also https://github.com/alexcrichton/git2-rs/issues/232

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions