dlopen ignores RTLD_GLOBAL when reopening an RTLD_LOCAL library
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
The report provides a minimal reproducer in test.c and commands to build and run it with Emscripten and Node. First trace how dlopen handles reopening a local library with RTLD_GLOBAL, then compare dlsym(RTLD_DEFAULT, "answer") with the reproducer’s expected result. Done means the global lookup returns 42 on both wasm32 and wasm64.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Reopening an RTLD_LOCAL library with RTLD_GLOBAL succeeds, but its symbols remain unavailable through RTLD_DEFAULT.
Reproduced with Emscripten 6.0.8 on both wasm32 and wasm64.
cat > test.c <<'EOF'
#ifdef BUILD_PROVIDER
int answer_value = 42;
int answer(void) { return answer_value; }
#else
#include <assert.h>
#include <dlfcn.h>
#include <stdio.h>
int main(void) {
void *handle = dlopen("./provider.so", RTLD_NOW | RTLD_LOCAL);
assert(handle);
int (*answer_fn)(void) = dlsym(handle, "answer");
assert(answer_fn && answer_fn() == 42);
puts("Handle-specific lookup: 42");
assert(dlopen("./provider.so", RTLD_NOW | RTLD_GLOBAL) == handle);
dlerror();
answer_fn = dlsym(RTLD_DEFAULT, "answer");
if (!answer_fn) {
printf("FAIL: %s\n", dlerror());
return 1;
}
printf("Global lookup: %d\n", answer_fn());
return 0;
}
#endif
EOF
Build the shared library:
emcc test.c -DBUILD_PROVIDER -shared -fPIC -m64 -fwasm-exceptions -O1 \
-Wl,--export=answer -Wl,--export=answer_value -o provider.so
Build and run the main module:
emcc test.c -m64 -fwasm-exceptions -O1 \
-sMAIN_MODULE=2 -sENVIRONMENT=node -sEXIT_RUNTIME=1 \
--embed-file provider.so -o test.js
node test.js
Actual output (exit code 1):
Handle-specific lookup: 42
FAIL: Tried to lookup unknown symbol "answer" in dynamic lib: __main__
Expected: Global lookup: 42.
Replacing both -m64 flags with -m32 produces the same failure.
- Ngôn ngữ chính
- C++
- Star
- 27.8k
- Fork
- 3.6k
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 179
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của emscripten-core/emscripten
-
`other.test_cmake_cxx_import_std` fails on CMake 3.30–4.0.2 due to missing `CMAKE_EXPERIMENTAL_CXX_IMPORT_STD` UUIDsCó thể đã có người làm @subhaushsingh đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
emscripten-core/emscripten#28160 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
emscripten-core/emscripten#27994 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
LEGACY_GL_EMULATION: generated fixed-function fragment shaders use mediump — fp16 overflow where mediump is half precisionCó thể đã có người làm @TheTomBritton đã nhận 13 ngày trước. Đang mởDesktop OpenGL emulation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
emscripten-core/emscripten#27948 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
emscripten-core/emscripten#27906 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
run_python, run_python_compiler could readlink -fCó thể đã có người làm @kapouer đã nhận 128 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
emscripten-core/emscripten#27211 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của emscripten-core/emscripten
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
eic/TimeframeBuilder#102 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
-
error not reported I/O low priority rt_lib
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[XLA] hlo/pass/README.md says passes implement Run; since the NVI change they implement RunImplĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
objectionary/game-of-life#78 ·