Skip to content

[SYCL] Fix ICE when -g and -ffile-prefix-map flags are set #8459

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

Merged
merged 10 commits into from
Mar 8, 2023

Conversation

zahiraam
Copy link
Contributor

@zahiraam zahiraam commented Feb 24, 2023

Set the source file name when footer is present and option fmacro-prefix-map is used when generating debug information.

This patch is to fix a crash in the compiler when generating debug information with the option -ffile-prefix-map.
Example:
$ pwd
/tmp/tmp.jocQk9WVa0
$
$ cat builtin.cpp
void a(__builtin_va_list);
using ::a;
$
$ clang -c -g -fsycl /tmp/tmp.jocQk9WVa0/builtin.cpp
$
$ clang -g -fsycl -ffile-prefix-map=/tmp/= /tmp/tmp.jocQk9WVa0/builtin.cpp
Expected must be checked before access or destruction.
Unchecked Expected contained error:
No such file or directoryPLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments:
…………………/tmp/tmp.jocQk9WVa0/builtin.cpp

  1. parser at end of file
  2. /tmp/tmp.jocQk9WVa0/builtin.cpp:2:9: LLVM IR generation of declaration 'a

https://github.com/intel/llvm/blob/sycl/clang/lib/CodeGen/CGDebugInfo.cpp#L397 is returning a error because the FileName is wrong.

fmacro-prefix-map is used when generating debug information.
@zahiraam zahiraam requested a review from a team as a code owner February 24, 2023 18:44
@zahiraam zahiraam changed the title git logDbi [SYCL] Set the source file name when footer is present and option fmacro-prefix-map is used when generating debug information. Feb 24, 2023
@zahiraam zahiraam temporarily deployed to aws February 24, 2023 19:09 — with GitHub Actions Inactive
@zahiraam zahiraam temporarily deployed to aws February 24, 2023 19:47 — with GitHub Actions Inactive
Copy link
Contributor

@elizabethandrews elizabethandrews left a comment

Choose a reason for hiding this comment

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

Can you describe what this change is doing in more detail in PR description?

@zahiraam zahiraam temporarily deployed to aws February 27, 2023 23:26 — with GitHub Actions Inactive
@zahiraam zahiraam temporarily deployed to aws February 28, 2023 00:11 — with GitHub Actions Inactive
@zahiraam zahiraam temporarily deployed to aws February 28, 2023 19:35 — with GitHub Actions Inactive
zahiraam added 2 commits March 1, 2023 05:34
Added check lines for the directory path in the LIT tests to
make sure it's correct.
@zahiraam
Copy link
Contributor Author

zahiraam commented Mar 1, 2023

@bwyma Thanks for reviewing and checking the debug information. I have fixed the issue you raised about the directory path. Also added in the other LIT tests a check line for the directory to make sure it's correct (instead of using regular expression). Would you please check if this new patch fixes the issue? Thanks.

Copy link
Contributor

@bwyma bwyma left a comment

Choose a reason for hiding this comment

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

LGTM.

@zahiraam
Copy link
Contributor Author

zahiraam commented Mar 1, 2023

LGTM.

Thanks.

@zahiraam zahiraam temporarily deployed to aws March 1, 2023 20:00 — with GitHub Actions Inactive
Copy link
Contributor

@elizabethandrews elizabethandrews left a comment

Choose a reason for hiding this comment

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

I'm not very familiar with debug information that needs to be generated but I trust @bwyma's approval!

@zahiraam zahiraam requested a review from bader March 1, 2023 21:28
@zahiraam zahiraam temporarily deployed to aws March 1, 2023 22:17 — with GitHub Actions Inactive
@zahiraam zahiraam temporarily deployed to aws March 3, 2023 18:02 — with GitHub Actions Inactive
@zahiraam zahiraam temporarily deployed to aws March 5, 2023 12:24 — with GitHub Actions Inactive
@zahiraam zahiraam temporarily deployed to aws March 6, 2023 13:54 — with GitHub Actions Inactive
@zahiraam zahiraam temporarily deployed to aws March 7, 2023 16:33 — with GitHub Actions Inactive
@zahiraam
Copy link
Contributor Author

zahiraam commented Mar 7, 2023

@intel/dpcpp-devops-reviewers I have been re-basing and re-testing this PR for a week. Can someone help with the latest fail please? Thanks.
It says:
"This request was automatically failed because there were no enabled runners online to process the request for more than 1 days."

@aelovikov-intel
Copy link
Contributor

@apstasen , could you take a look please? We've seen similar issue with not getting AWS CUDA runner picked up in at least one another PR.

@zahiraam zahiraam temporarily deployed to aws March 7, 2023 22:59 — with GitHub Actions Inactive
@bader bader changed the title [SYCL] Set the source file name when footer is present and option fmacro-prefix-map is used when generating debug information. [SYCL] Fix ICE when -g and -ffile-prefix-map flags are set Mar 8, 2023
@bader
Copy link
Contributor

bader commented Mar 8, 2023

@intel/dpcpp-devops-reviewers I have been re-basing and re-testing this PR for a week. Can someone help with the latest fail please? Thanks. It says: "This request was automatically failed because there were no enabled runners online to process the request for more than 1 days."

I hope #8567 fixes this issue.

@zahiraam
Copy link
Contributor Author

zahiraam commented Mar 8, 2023

@intel/dpcpp-devops-reviewers I have been re-basing and re-testing this PR for a week. Can someone help with the latest fail please? Thanks. It says: "This request was automatically failed because there were no enabled runners online to process the request for more than 1 days."

I hope #8567 fixes this issue.

The testing started 14h 14m 8s ago. Unlless I am mistaken this is still hanging?
"Requested labels: aws-cuda_4318684912-4
Job defined at: intel/llvm/.github/workflows/sycl_linux_build_and_test.yml@refs/heads/sycl
Reusable workflow chain:
intel/llvm/.github/workflows/sycl_precommit.yml@refs/heads/sycl (fe12cab)
-> intel/llvm/.github/workflows/sycl_linux_build_and_test.yml@refs/heads/sycl (fe12cab)
Waiting for a runner to pick up this job..."
I seem to have no way of re-starting the test again.
@bader, @stasenko, Alexander P?

@bader
Copy link
Contributor

bader commented Mar 8, 2023

@zahiraam, you need to merge the fix to your DBI branch.

@zahiraam zahiraam temporarily deployed to aws March 8, 2023 18:45 — with GitHub Actions Inactive
@zahiraam zahiraam temporarily deployed to aws March 8, 2023 20:16 — with GitHub Actions Inactive
@zahiraam
Copy link
Contributor Author

zahiraam commented Mar 8, 2023

@bader Your fix seems to have worked. Thanks.
Can we now merge in this PR?

@bader bader merged commit 723b80d into intel:sycl Mar 8, 2023
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.

7 participants