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

BlobBuilder.Align(int) seems not working on mono #97172

Open
buyaa-n opened this issue Jan 18, 2024 · 2 comments
Open

BlobBuilder.Align(int) seems not working on mono #97172

buyaa-n opened this issue Jan 18, 2024 · 2 comments
Labels
area-System.Reflection needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration runtime-mono specific to the Mono runtime
Milestone

Comments

@buyaa-n
Copy link
Member

buyaa-n commented Jan 18, 2024

A Field RVA alignment test is failing on mono legs in this PR

That verifies the code section:

_metadataBuilder.AddFieldRelativeVirtualAddress(handle, fieldDataBuilder.Count);
fieldDataBuilder.WriteBytes(field._rvaData!);
fieldDataBuilder.Align(ManagedPEBuilder.MappedFieldDataAlignment);

Not sure if it is bug or expected, I don't see mono specific code in MetadataBuilder nor in BlobBuilder.Align(int)

public void Align(int alignment)
{
int position = Count;
WriteBytes(0, BitArithmetic.Align(position, alignment) - position);
}

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jan 18, 2024
@lambdageek
Copy link
Member

It's probably an issue on the reading side - maybe somewhere in https://github.com/dotnet/runtime/blob/main/src/mono/mono/metadata/class.c#L5580-L5649

@lambdageek lambdageek added this to the 9.0.0 milestone Jan 18, 2024
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jan 18, 2024
@jeffschwMSFT jeffschwMSFT added area-System.Reflection runtime-mono specific to the Mono runtime labels Jan 19, 2024
@ghost
Copy link

ghost commented Jan 19, 2024

Tagging subscribers to this area: @dotnet/area-system-reflection
See info in area-owners.md if you want to be subscribed.

Issue Details

A Field RVA alignment test is failing on mono legs in this PR

That verifies the code section:

_metadataBuilder.AddFieldRelativeVirtualAddress(handle, fieldDataBuilder.Count);
fieldDataBuilder.WriteBytes(field._rvaData!);
fieldDataBuilder.Align(ManagedPEBuilder.MappedFieldDataAlignment);

Not sure if it is bug or expected, I don't see mono specific code in MetadataBuilder nor in BlobBuilder.Align(int)

public void Align(int alignment)
{
int position = Count;
WriteBytes(0, BitArithmetic.Align(position, alignment) - position);
}

Author: buyaa-n
Assignees: -
Labels:

area-System.Reflection, runtime-mono, area-System.Reflection-mono

Milestone: 9.0.0

@buyaa-n buyaa-n modified the milestones: 9.0.0, Future Jul 29, 2024
@buyaa-n buyaa-n added the needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Reflection needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration runtime-mono specific to the Mono runtime
Projects
None yet
Development

No branches or pull requests

3 participants