-
Notifications
You must be signed in to change notification settings - Fork 565
[linker] fix #51340 #404
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
[linker] fix #51340 #404
Conversation
|
Instead of special-casing |
9bfa28b to
b58dc6b
Compare
|
Updated the patch. |
|
build |
1 similar comment
|
build |
|
|
||
| if (type.HasMethods && type.HasInterfaces && type.Implements (ICustomMarshalerName)) { | ||
| foreach (MethodDefinition method in type.Methods) | ||
| if (method.Name == "GetInstance" && method.IsStatic && method.HasParameters && method.Parameters.Count == 1 && method.ReturnType.FullName == ICustomMarshalerName && method.Parameters.First ().ParameterType.FullName == "System.String") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check the remaining methods once this if has executed? Perhaps we can break after the MarkMethod(method)?
| ProcessSystemCore (type); | ||
|
|
||
| if (type.HasMethods && type.HasInterfaces && type.Implements (ICustomMarshalerName)) { | ||
| foreach (MethodDefinition method in type.Methods) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use braces around the foreach.
- preserve the static ICustomMarshaler GetInstance (string) method
of types implementing ICustomMarshaler interface
- it avoids errors like:
ReadlinkTest
ReadLink [FAIL] : System.ApplicationException : Custom marshaler 'FileNameMarshaler' does not implement a static GetInstance method that takes a single string parameter and returns an ICustomMarshaler.
at (wrapper managed-to-native) Mono.Unix.Native.Syscall:readlinkat (int,string,byte[],ulong)
at Mono.Unix.Native.Syscall.readlinkat (System.Int32 dirfd, System.String pathname, System.Byte[] buf) [0x0000a] in <75558c6e0e1f444f8a03d1c694a92a08>:0
at MonoTests.Mono.Unix.ReadlinkTest.SetUp () [0x00007] in <9df8009b87984e1cb863e771d21f9f39>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <9f55149ed93f4bad9226ce1d7634fe5b>:0
readlink_byte [FAIL] : System.ApplicationException : Custom marshaler 'FileNameMarshaler' does not implement a static GetInstance method that takes a single string parameter and returns an ICustomMarshaler.
TearDown : System.ArgumentException : ** Unknown error code: 9**
----> Mono.Unix.UnixIOException : ** Unknown error code: 9** [EBADF].
at (wrapper managed-to-native) Mono.Unix.Native.Syscall:readlinkat (int,string,byte[],ulong)
at Mono.Unix.Native.Syscall.readlinkat (System.Int32 dirfd, System.String pathname, System.Byte[] buf) [0x0000a] in <75558c6e0e1f444f8a03d1c694a92a08>:0
at MonoTests.Mono.Unix.ReadlinkTest.SetUp () [0x00007] in <9df8009b87984e1cb863e771d21f9f39>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <9f55149ed93f4bad9226ce1d7634fe5b>:0
--TearDown
at Mono.Unix.UnixMarshal.ThrowExceptionForLastError () [0x00006] in <75558c6e0e1f444f8a03d1c694a92a08>:0
at MonoTests.Mono.Unix.ReadlinkTest.TearDown () [0x00011] in <9df8009b87984e1cb863e771d21f9f39>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in <9f55149ed93f4bad9226ce1d7634fe5b>:0
--UnixIOException
b58dc6b to
084661f
Compare
|
Updated. It would probably still not build as it is on cycle9 branch. |
|
I don't understand why, I don't know what's going on, but the PR builder doesn't like this commit. Pr Builds 451, 455, and 456 have all taken "unreasonable" amounts of time -- taking over 5 hours, where a normal PR build is less than 20 minutes -- because they can't connect to the emulator: I don't understand why this only appears to impact this PR, and none of the others. |
Oh! That's because PR builds don't work on the cycle 9 branch. Doh! Why is this going to the cycle9 branch and not master? Surely master needs this fix, too, no? Or is the fix in |
|
It is cycle9 bug, so it needs to be fixed in cycle9 I guess. For master I would like to create patch for mono/linker repo. |
preserve the GetInstance method whenever the
Mono.Unix.Native.FileNameMarshaler type is used
it avoids errors like: