Skip to content

Conversation

@gwr
Copy link
Contributor

@gwr gwr commented Sep 7, 2025

I get this compile error when building for SunOS (#117023)

 $runtime/src/coreclr/vm/methodtable.cpp: In static member function 'static MethodTable::MethodData* MethodTable::GetMethodDataHelper(MethodTable*, MethodTable*, MethodDataComputeOptions)':
  $runtime/src/coreclr/vm/methodtable.cpp:7130:52: error: 'static void MethodTable::MethodDataInterface::operator delete(void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
   7130 |             pData = new MethodDataInterface(pMTDecl);
        |                                                    ^
  $runtime/src/coreclr/vm/methodtable.cpp:7130:52: note: returned from 'void* operator new(std::size_t)'
   7130 |             pData = new MethodDataInterface(pMTDecl);
        |                                                    ^

It looks like maybe this was missed when #119112 was fixed?

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 7, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Sep 7, 2025
@jkotas jkotas requested a review from jkoritzinsky September 8, 2025 04:36
@jkotas jkotas added area-VM-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Sep 8, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

@gwr
Copy link
Contributor Author

gwr commented Sep 10, 2025

I get this compile error when building for SunOS (#117023)
(see above)

Hm... while the change in this PR let's it build on my platform, the automated builds are failing on linux/arm and I'm not sure why. Here's the error:

/__w/1/s/src/coreclr/vm/methodtable.cpp:7130:26: error: braces around scalar initializer [-Werror,-Wbraced-scalar-init]
   7130 |             pData = new ({pMTDecl}) MethodDataInterface(pMTDecl);

And I fixed that too, but now the tests fail.
https://github.com/dotnet/runtime/pull/119447/files#annotation_38841456854

I guess I need help with how to correctly fix the error I was getting. Thanks.

@gwr
Copy link
Contributor Author

gwr commented Sep 10, 2025

Could the compiler version be an issue here? The SunOS port has run into other issues with illumos cross setup. (Sorry, stale info last time.) Corrected: 13.3.0

$ /crossrootfs/x64/bin/x86_64-illumos-g++ --version
x86_64-illumos-g++ (GCC) 13.3.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  $runtime/src/coreclr/vm/methodtable.cpp: In static member function 'static MethodTable::MethodData* MethodTable::GetMethodDataHelper(MethodTable*, MethodTable*, MethodDataComputeOptions)':
  $runtime/src/coreclr/vm/methodtable.cpp:7130:52: error: 'static void MethodTable::MethodDataInterface::operator delete(void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
   7130 |             pData = new MethodDataInterface(pMTDecl);
        |                                                    ^
  $runtime/src/coreclr/vm/methodtable.cpp:7130:52: note: returned from 'void* operator new(std::size_t)'
   7130 |             pData = new MethodDataInterface(pMTDecl);
        |                                                    ^
@gwr
Copy link
Contributor Author

gwr commented Sep 11, 2025

Trying again, this time just adding a custom "new" to match the custom "delete" for class MethodData.

@jkoritzinsky jkoritzinsky enabled auto-merge (squash) September 11, 2025 01:20
@jkoritzinsky jkoritzinsky merged commit 451df81 into dotnet:main Sep 11, 2025
96 of 98 checks passed
@gwr gwr deleted the coreclr-vm-mt branch September 11, 2025 11:42
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-VM-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants