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

[mono] Audit embedding API for .NET 5 correctness #33557

Open
83 tasks
lambdageek opened this issue Mar 13, 2020 · 9 comments
Open
83 tasks

[mono] Audit embedding API for .NET 5 correctness #33557

lambdageek opened this issue Mar 13, 2020 · 9 comments
Assignees
Labels
area-VM-meta-mono runtime-mono specific to the Mono runtime tracking This issue is tracking the completion of other related issues.
Milestone

Comments

@lambdageek
Copy link
Member

lambdageek commented Mar 13, 2020

This is a tracking issue to audit the public embedding API for correctness with respect to assembly load context support.

The goal is to consider how each function in the headers below will behave when there are multiple ALCs in the managed code, and to decide whether the function behavior needs to be corrected, or if it is not feasible to correct, whether the function's documentation should be updated with a deprecation note and a new ALC-aware replacement added.

The top priority are functions that are mentioned in xamarin-macios exports.t4 or headers that are used in the source code in the xamarin android monodroid/jni directory, and Java.Interop

  • mono/utils
    • mono-logger.h
    • mono-error.h
    • mono-forward.h
    • mono-publib.h
    • mono-jemalloc.h
    • mono-dl-fallback.h
    • mono-counters.h
  • mono/metadata
    • appdomain.h
    • assembly.h
    • attrdefs.h
    • blob.h
    • class.h
    • debug-helpers.h
    • debug-mono-symfile.h
    • environment.h
    • exception.h
    • image.h
    • loader.h
    • metadata.h
    • mono-config.h
    • mono-debug.h
    • mono-gc.h
    • object.h
    • object-forward.h
    • opcodes.h
    • profiler.h
    • profiler-events.h
    • reflection.h
    • row-indexes.h
    • sgen-bridge.h
    • threads.h
    • tokentype.h
    • verify.h
  • mono/mini
    • jit.h

The following headers aren't installed, but they have MONO_API functions, and should be audited too:

Mini

  • mono/utils/mini-runtime.h
  • mono/utils/monovm.h
  • mono/utils/mini.h
  • mono/utils/mini-llvm.h
  • mono/utils/aot-runtime.h
  • mono/utils/debugger-agent.h

Metadata:

  • mono/metadata/cil-coff.h
  • mono/metadata/marshal-ilgen.h
  • mono/metadata/marshal.h
  • mono/metadata/coree.h
  • mono/metadata/assembly-internals.h
  • mono/metadata/sgen-toggleref.h
  • mono/metadata/class-internals.h
  • mono/metadata/w32file.h
  • mono/metadata/security-core-clr.h
  • mono/metadata/metadata-internals.h
  • mono/metadata/monitor.h
  • mono/metadata/object-internals.h
  • mono/metadata/mono-mlist.h
  • mono/metadata/method-builder-ilgen.h
  • mono/metadata/filewatcher.h
  • mono/metadata/threads-types.h
  • mono/metadata/cominterop.h
  • mono/metadata/mempool.h
  • mono/metadata/mono-perfcounters.h
  • mono/metadata/icall-table.h
  • mono/metadata/mono-hash.h
  • mono/metadata/gc-internals.h

Utils

  • mono/utils/mono-path.h
  • mono/utils/mono-linked-list-set.h
  • mono/utils/mono-proclib.h
  • mono/utils/mono-logger-internals.h
  • mono/utils/strenc.h
  • mono/utils/hazard-pointer.h
  • mono/utils/mono-threads-api.h
  • mono/utils/mono-dl-fallback.h
  • mono/utils/mono-embed.h
  • mono/utils/mono-error-internals.h
  • mono/utils/mono-digest.h
  • mono/utils/os-event.h
  • mono/utils/mono-threads.h
  • mono/utils/monobitset.h
  • mono/utils/mono-uri.h
  • mono/utils/mono-mmap.h
  • mono/utils/lock-free-alloc.h
  • mono/utils/mono-conc-hashtable.h
  • mono/utils/lock-free-queue.h
  • mono/utils/mono-logger.h
  • mono/utils/mono-poll.h
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't add an area label to this Issue.

Checkout this page to find out which area owner to ping, or please add exactly one area label to help train me in the future.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Mar 13, 2020
@lambdageek lambdageek added runtime-mono specific to the Mono runtime area-VM-meta-mono Epic Groups multiple user stories. Can be grouped under a theme. tracking This issue is tracking the completion of other related issues. and removed untriaged New issue has not been triaged by the area owner labels Mar 13, 2020
@lambdageek lambdageek added this to the 5.0 milestone Mar 13, 2020
@lambdageek
Copy link
Member Author

/cc @CoffeeFlux @steveisok @mdh1418

@CoffeeFlux
Copy link
Contributor

It's worth noting this isn't just for ALCs, it's for netcore changes in general. ALC support is just going to be the most frequent incompatibility.

@CoffeeFlux
Copy link
Contributor

We should also consider as part of this what ALC functions to put in public headers. Things like getting the default ALC for a domain will be useful to embedders.

@lambdageek lambdageek changed the title [mono] Audit embedding API for ALC correctness [mono] Audit embedding API for .NET 5 correctness Mar 13, 2020
@mdh1418
Copy link
Member

mdh1418 commented Mar 13, 2020

In xamarin android monodroid/jni direcotry, I found the following header files referenced by the corresponding files in the directory. Everything else lacked a reference.

utils/mono-publib.h         | monodroid.h monodroid-glue.hh
utils/mono-dl-fallback.h    | monodroid-glue.cc
utils/mono-counters.h       | monodroid-glue-internal.hh
metadata/appdomain.h        | designer-assemblies.cc designer-assemblies.hh monodroid-glue.cc monodroid-glue.hh timezones.cc util.cc util.hh
metadata/assembly.h         | designer-assemblies.cc designer-assemblies.hh embedded-assemblies.cc embedded-assemblies.hh embedded-assemblies-zip.cc monodroid-glue.cc timezones.cc util.cc util.hh
metadata/class.h            | osbridge.cc timezones.cc
metadata/debug-helpers.h    | monodroid-glue.cc
metadata/image.h            | embedded-assemblies.cc xamarin-app.hh
metadata/mono-config.h      | embedded-assemblies.cc monodroid-glue.cc
metadata/mono-debug.h       | debug.cc monodroid-glue.cc
metadata/object.h           | embedded-assemblies.hh osbridge.cc timezones.cc
metadata/profiler.h         | monodroid-glue-internal.hh
metadata/reflection.h       | designer-assemblies.cc
metadata/sgen-bridge.h      | osbridge.hh
metadata/threads.h          | osbridge.cc timezones.cc

utils/mono-dl-fallback.h    | monodroid-glue.cc

In the jni directory, I ran the following command in powershell after creating an array filled with the header files
foreach ($element in $headers_array) {if (Get-ChildItem -Recurse | Select-String $element -List ) {"$element | $(Get-ChildItem -Recurse | Select-String $element -List -SimpleMatch | Select Path | Split-Path -leaf)"}}

@mdh1418
Copy link
Member

mdh1418 commented Mar 13, 2020

Similarly in Java.Interop the following headers are referenced by the corresponding files in the Java.Interop directory.

utils/mono-dl-fallback.h    | java-interop-mono.h
utils/mono-counters.h       | java-interop-mono.h
metadata/assembly.h         | java-interop-mono.h
metadata/class.h            | java-interop-mono.h
metadata/object.h           | java-interop-mono.h
metadata/sgen-bridge.h      | java-interop-mono.h
metadata/threads.h          | java-interop-mono.h

utils/mono-dl-fallback.h    | java-interop-mono.h

@mdh1418
Copy link
Member

mdh1418 commented Mar 16, 2020

In xamarin-macios exports.t4 the following headers are referenced.

utils/mono-publib.h         | exports.t4
metadata/appdomain.h        | exports.t4
metadata/assembly.h         | exports.t4
metadata/class.h            | exports.t4
metadata/debug-helpers.h    | exports.t4
metadata/exception.h        | exports.t4
metadata/loader.h           | exports.t4
metadata/metadata.h         | exports.t4
metadata/mono-config.h      | exports.t4
metadata/mono-debug.h       | exports.t4
metadata/mono-gc.h          | exports.t4
metadata/object.h           | exports.t4
metadata/profiler.h         | exports.t4
metadata/reflection.h       | exports.t4
metadata/threads.h          | exports.t4
mini/jit.h                  | exports.t4

metadata/marshal.h          | exports.t4
metadata/sgen-toggleref.h   | exports.t4
metadata/class-internals.h  | exports.t4
metadata/object-internals.h | exports.t4
metadata/threads-types.h    | exports.t4
metadata/mono-hash.h        | exports.t4
utils/mono-path.h           | exports.t4
utils/mono-threads-api.h    | exports.t4
utils/mono-threads.h        | exports.t4

@marek-safar marek-safar modified the milestones: 5.0.0, 6.0.0 Jun 30, 2020
@marek-safar marek-safar removed the Epic Groups multiple user stories. Can be grouped under a theme. label Oct 21, 2020
@SamMonoRT SamMonoRT modified the milestones: 6.0.0, 7.0.0 Jul 22, 2021
@SamMonoRT
Copy link
Member

Moving to 7.0.0

@SamMonoRT
Copy link
Member

moving tracking issues to 8.0.0

@SamMonoRT SamMonoRT modified the milestones: 7.0.0, 8.0.0 Aug 3, 2022
@SamMonoRT SamMonoRT modified the milestones: 8.0.0, 9.0.0 Jul 31, 2023
@steveisok steveisok modified the milestones: 9.0.0, Future Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-VM-meta-mono runtime-mono specific to the Mono runtime tracking This issue is tracking the completion of other related issues.
Projects
None yet
Development

No branches or pull requests

8 participants