Bug 22321 - NtlmClient error in build caused by passing Type2Message instance instead of GetBytes()
Summary: NtlmClient error in build caused by passing Type2Message instance instead of ...
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: General (show other bugs)
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-08-23 11:40 UTC by rwdim
Modified: 2014-11-29 08:53 UTC (History)
5 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description rwdim 2014-08-23 11:40:57 UTC
When building git trunk on CentOS 6.5 x64, I get an error in mcs/class/Mono.Http/Mono.Http/NtlmClient.cs:99.

The line:
    Type3Message type3 = new Type3Message (type2);

should be:
    Type3Message type3 = new Type3Message (type2.GetBytes());

If it's not, the error is thrown:
if test -w /home/randy/projects/mono/mcs; then :; else chmod -R +w /home/randy/projects/mono/mcs; fi
cd /home/randy/projects/mono/mcs && make --no-print-directory -s NO_DIR_CHECK=1 PROFILES='net_2_0 net_3_5 net_4_0 net_4_5 xbuild_12   ' CC='gcc' all-profiles
Bootstrap compiler: Mono C# compiler version
MCS     [basic] System.dll
System.Security.AccessControl/SemaphoreSecurity.cs(136,35): warning CS0109: The member `System.Security.AccessControl.SemaphoreSecurity.PersistModifications(System.Runtime.InteropServices.SafeHandle)' does not hide an inherited member. The new keyword is not required
Mono.Http/NtlmClient.cs(99,54): error CS1502: The best overloaded method match for `Mono.Security.Protocol.Ntlm.Type3Message.Type3Message(byte[])' has some invalid arguments
/usr/lib/mono/gac/Mono.Security/ (Location of the symbol related to previous error)
Mono.Http/NtlmClient.cs(99,54): error CS1503: Argument `#1' cannot convert `Mono.Security.Protocol.Ntlm.Type2Message' expression to type `byte[]'
Comment 1 Martin Baulig 2014-08-26 12:55:45 UTC
No, the "byte[]" constructor may only be used for debugging purposes.

You need to fix your build to use the newly built Mono.Security.dll, not the installed version from the GAC.
Comment 2 rwdim 2014-08-26 18:39:18 UTC
Ok... please explain how I can "fix my build" to use an assembly that has yet to be built instead of the one in there already?

The machine that this was tested on had no mono on it until just before I built, then I installed the previous stable build so that I could build this current version.

Also, I didn't see anywhere that said "byte[] constructors may only be used for debugging...", so perhaps an assert that stops a production build when this constructor is used is in order.

Comment 3 Martin Baulig 2014-08-26 18:47:56 UTC
Is this the normal Linux build after a clean git checkout?  You shouldn't be getting this error and I'm actually wondering how this can happen ...

I'll see whether I can find someone in the office who has a Linux box to have a look at this.
Comment 4 Martin Baulig 2014-08-26 18:55:49 UTC
Could you please attach the full build output?

What's happening here is that somehow, this is attempting to build System.dll using the installed Mono.Security.dll from the GAC instead of the newly built one.
Comment 5 foka 2014-09-26 10:33:49 UTC
I had the same error when tried to compile current 3.8 (mono-3.8.0-branch e451fb2) on my Ubuntu 12.04 with mono installed in /usr/bin.
I installed 3.4 (mono-3.4.0-branch) in /usr/bin and then compiled 3.8 on installed 3.4.
Comment 6 alex_y_xu 2014-11-29 08:53:40 UTC
duplicate of bug 20462

Note You need to log in before you can comment on or make changes to this bug.