Skip to content

add proxy lib tests without LD_PRELOAD #1480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bratpiorka
Copy link
Contributor

@bratpiorka bratpiorka commented Aug 6, 2025

add proxy lib tests without LD_PRELOAD + needed fixes

  • add tests w/o proxy lib to reusable_proxy wflow
  • cleanup ctors/dtors and remove priorities
  • initialize logger once (except tests)
  • do not destroy proxy lib pool before umf lib

@bratpiorka bratpiorka force-pushed the rrudnick_proxy_tests branch 12 times, most recently from 604b7aa to dbd9999 Compare August 20, 2025 09:11
@bratpiorka bratpiorka force-pushed the rrudnick_proxy_tests branch from dbd9999 to 96333d2 Compare August 20, 2025 09:44
@bratpiorka bratpiorka requested a review from Copilot August 20, 2025 09:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds tests that verify the proxy library functionality works correctly without requiring LD_PRELOAD, implementing additional runtime detection mechanisms for the proxy library and cleaning up initialization patterns.

  • Adds proxy library detection via dlopen() in addition to LD_PRELOAD environment variable checking
  • Simplifies constructor/destructor priorities and consolidates logger initialization to use a single initialization pattern
  • Enhances CI testing to validate both proxy library usage scenarios

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/utils/utils_log.cpp Updates test expectations to reflect renamed logging function
src/utils/utils_log.c Implements single logger initialization pattern with thread-safety
src/utils/utils_load_library.c Adds debug logging for library open/close operations
src/utils/utils_common.h Adds dlopen-based proxy library detection alongside LD_PRELOAD check
src/proxy_lib/proxy_lib_linux.c Removes constructor/destructor priority specifications
src/coarse/coarse.c Simplifies logger initialization by removing platform-specific patterns
.github/workflows/reusable_proxy_lib.yml Adds test run without proxy library to CI workflow

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -79,6 +81,15 @@ static inline int utils_env_var_has_str(const char *envvar, const char *str) {

// check if we are running in the proxy library
static inline int utils_is_running_in_proxy_lib(void) {
// check if the proxy library is loaded using dlopen()
void *proxy_lib_handle =
utils_open_library("libumf_proxy.so", UMF_UTIL_OPEN_LIBRARY_NO_LOAD);
Copy link
Preview

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded library name "libumf_proxy.so" makes this code platform-specific to Linux. Consider using a platform-specific macro or variable to support different operating systems (e.g., "libumf_proxy.dll" on Windows).

Copilot uses AI. Check for mistakes.

@bratpiorka bratpiorka force-pushed the rrudnick_proxy_tests branch from 96333d2 to 46e66a2 Compare August 20, 2025 10:08
@bratpiorka bratpiorka force-pushed the rrudnick_proxy_tests branch from 46e66a2 to 220aa29 Compare August 20, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant