Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@esdrubal
Copy link
Contributor

Renamed SignatureMethodPair to SignaturePointerPair.
This change was done for the fix below where a signature pointer pair is needed.
mono_marshal_get_native_func_wrapper now uses native_func_wrapper_cache indexed by SignaturePointerPair,

Using SignaturePointerPair index instead of MonoMethod index avoids problems when one native function needs multiple wrappers.
e.g: when the managed code creates delegates for function pointers with parameters that require different marshallings.

This fixes bug #26127.

Changed field MonoMethod* method to gpointer pointer.
This change was done because we need in some cases to use a signature pointer pair.
mono_marshal_get_native_func_wrapper now uses native_func_wrapper_cache indexed by SignaturePointerPair,

Using SignaturePointerPair index instead of MonoMethod index avoids problems when one native function needs multiple wrappers.
e.g: when the managed code creates delegates for function pointers with parameters that require different marshallings.

This fixes bug 26127.
vargaz added a commit that referenced this pull request Jan 31, 2015
[runtime] Added native_func_wrapper_cache.
@vargaz vargaz merged commit 3edd4ff into mono:master Jan 31, 2015
tritao added a commit that referenced this pull request Feb 6, 2015
…per`.

It was caused by a mismatch of the `sig` and `csig` variables when looking the wrapper in the marshalling cache.

This was manifesting as the following crash in all Monodroid programs:

```
#0  mono_type_hash () at /Users/joao/Dev/droid/mono/mono/metadata/metadata.c:1390
#1  0x7512edf4 in mono_signature_hash () at /Users/joao/Dev/droid/mono/mono/metadata/metadata.c:4957
#2  0x75115d18 in signature_pointer_pair_hash () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
#3  0x751dca10 in rehash () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
#4  0x751dcbe0 in monoeg_g_hash_table_insert_replace () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
#5  0x75119570 in mono_mb_create_and_cache_full () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
#6  0x75127390 in mono_marshal_get_native_func_wrapper () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
#7  0x75127780 in mono_ftnptr_to_delegate () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
```

Originally introduced in #1540.
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
[runtime] Added native_func_wrapper_cache.

Commit migrated from mono/mono@3edd4ff
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…per`.

It was caused by a mismatch of the `sig` and `csig` variables when looking the wrapper in the marshalling cache.

This was manifesting as the following crash in all Monodroid programs:

```
mono/mono#0  mono_type_hash () at /Users/joao/Dev/droid/mono/mono/metadata/metadata.c:1390
mono/mono#1  0x7512edf4 in mono_signature_hash () at /Users/joao/Dev/droid/mono/mono/metadata/metadata.c:4957
mono/mono#2  0x75115d18 in signature_pointer_pair_hash () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
mono/mono#3  0x751dca10 in rehash () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
mono/mono#4  0x751dcbe0 in monoeg_g_hash_table_insert_replace () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
mono/mono#5  0x75119570 in mono_mb_create_and_cache_full () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
mono/mono#6  0x75127390 in mono_marshal_get_native_func_wrapper () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
mono/mono#7  0x75127780 in mono_ftnptr_to_delegate () from /Users/joao/Dev/droid/monodroid/tests/runtime/gdb-symbols/libmonosgen-2.0.so
```

Originally introduced in mono/mono#1540.


Commit migrated from mono/mono@a8390dc
dj4156003 pushed a commit to dj4156003/mono that referenced this pull request Nov 13, 2023
…-1394746

Backporting Android culture fix 1394746
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.

2 participants