Skip to content
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

Fix dlpi_name info empty when using GCC on ub18 #1181

Merged

Conversation

Projects
None yet
3 participants
@aaronenyeshi
Copy link
Collaborator

commented Jun 21, 2019

This fixes a bug where GCC++ on Ubuntu 18.04 creates failing executables compared to GCC++ on 16.04 and clang++. While creating function names on Ubuntu 18.04, dl_phdr_info seems to provide a non-zero value for dlpi_addr on initial iteration, and an empty string in dlpi_name. This is causing failure when linking with g++, since the empty string prevents the kernel function from being loaded. Clang++ and GCC on UB16 provide a zero value for dlpi_addr. To fix this, we need to verify both addr and name exists, so that /proc/self/exe can be properly loaded.

Fix dlpi_name info empty when using GCC on ub18
This fixes a bug where GCC++ on Ubuntu 18.04 creates failing executables compared to GCC++ on 16.04 and clang++. While creating function names on Ubuntu 18.04, dl_phdr_info seems to provide a non-zero value for dlpi_addr on initial iteration, and an empty string in dlpi_name. This is causing failure when linking with g++, since the empty string prevents the kernel function from being loaded. Clang++ and GCC on UB16 provide a zero value for dlpi_addr. To fix this, we need to verify both addr and name exists, so that /proc/self/exe can be properly loaded.

@aaronenyeshi aaronenyeshi requested review from scchan and mangupta Jun 21, 2019

@scchan

scchan approved these changes Jun 24, 2019

Copy link
Collaborator

left a comment

LGTM

@mangupta mangupta merged commit 77bef86 into ROCm-Developer-Tools:master Jun 25, 2019

1 check passed

continuous-integration/jenkins/pr-merge This commit looks good
Details

@aaronenyeshi aaronenyeshi deleted the aaronenyeshi:fix-empty-dlpi-name-ub18 branch Jun 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.