Skip to content

Conversation

@KevinRansom
Copy link
Contributor

@KevinRansom KevinRansom commented Jan 30, 2023

This fixes: #3866 -- Internal compiler error when creating Portable PDB files for source files with very long lines

I'm still not sure this is really a bug, the very long lines in question are over 700000 characters long ... which is indeed very long.

However, the issue ultimately was caused by the range constructor during typechecking at the start of the compilation, it ends up creating invalid pdbdata at the end of the compilation.

Anyway, this PR proposes a change in the range encoding:
Currently, it allows:
File identifiers: 0 - 2^24 --- 16,777,216
Columns: 0 - 2^20 --- 1,048,576
Lines: 0 - 2^31 --- 2,147,483,648

This PR steals 4 bits from file ids reducing a compilation to only: 1,048,576 and gives 2 to each of start column and end column giving: 4,194,304

Anyway, I will spend a bit of time determining whether:

    1. We should fail on very long lines,
    1. or very long files
    1. or really really really many files

Whether there is any unintentional or at least unforseen consequences to columns being bit stealers.

@KevinRansom KevinRansom requested a review from a team as a code owner January 30, 2023 08:43
Copy link
Contributor

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

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

Any way to test this?

@KevinRansom
Copy link
Contributor Author

Any way to test this?

I have a repro of the issue, which I will include. I am, however wondering if the fix is worthwhile. It is probably. just as good to add a warning once the line gets over 500000 columns or there abouts. Anyway, I added this PR to see if the change works, then we can discuss the real next step. Which may well be increasing these limits, but may just as likely be not changing them, but adding build warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Internal compiler error when creating Portable PDB files for source files with very long lines

4 participants