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

[cs] unable to link System.Data.dll #4151

Closed
kevinresol opened this issue Apr 14, 2015 · 12 comments · Fixed by #8413
Closed

[cs] unable to link System.Data.dll #4151

kevinresol opened this issue Apr 14, 2015 · 12 comments · Fixed by #8413
Assignees
Labels
bug platform-cs Everything related to c#

Comments

@kevinresol
Copy link
Contributor

build.hxml:

-cp src 
-cs bin 
-net-lib "C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Data.dll"
-main Main

results:

File "ilMetaReader.ml", line 577, characters 34-40: Assertion failed
error 0x2
Press enter to exit...
@nadako nadako added bug platform-cs Everything related to c# labels Apr 14, 2015
@nadako
Copy link
Member

nadako commented Apr 14, 2015

Can confirm it doesn't work for me as well:

error 0x2
Fatal error: exception Assert_failure("ilMetaReader.ml", 577, 34)
Raised at file "ilMetaReader.ml", line 577, characters 34-46
Called from file "ilMetaReader.ml", line 1477, characters 21-44
Called from file "ilMetaReader.ml", line 1961, characters 19-66
Called from file "array.ml", line 85, characters 31-51
Called from file "ilMetaReader.ml", line 2284, characters 1-347
Called from file "ilMetaReader.ml", line 2410, characters 1-14
Called from file "gencs.ml", line 4422, characters 14-64
Called from file "gencs.ml", line 4446, characters 13-22
Called from file "gencs.ml", line 4566, characters 46-62
Called from file "list.ml", line 73, characters 12-15
Called from file "main.ml", line 1450, characters 3-28
Called from file "main.ml", line 637, characters 3-11
Called from file "main.ml", line 1743, characters 1-35

@nadako
Copy link
Member

nadako commented Apr 14, 2015

Looking at the code, IL reader encounters unknown method calling convention (0x2), which seems to be an "unmanaged" call (https://msdn.microsoft.com/en-us/library/ms231596(v=vs.110).aspx)

@kevinresol
Copy link
Contributor Author

another error found

-net-lib C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll

result:

PeReader.Error_message("Error reading compressed data. Invalid first byte: e5")
Build halted with errors (haxe.exe).

@kevinresol
Copy link
Contributor Author

Having no knowledge to OCaml, but I just looked into the code and seems that https://github.com/HaxeFoundation/ocamllibs/blob/master/ilib/ilMetaReader.ml#L277 does handle the 0x2 to 0x4 cases. So will it work by simply adding back the cases around line 570?

@Simn
Copy link
Member

Simn commented Jun 23, 2015

Having no knowledge of this IL I would concur. In fact this part looks like it wants to be factored out to a function which both places can call.

@ousado
Copy link
Contributor

ousado commented Oct 10, 2016

Does this have to be a fatal error or could this be handled on a per-function/class basis?

@waneck waneck modified the milestones: 3.3.0, 3.4 Oct 10, 2016
@waneck
Copy link
Member

waneck commented Oct 10, 2016

Right now, all errors in net-lib are fatal errors. I could add some resilience to dll reading, but this may mean that a wrong read could add a lot of garbage to the dll without us being able to know what exactly happened. Right now I prefer to read a lot of dlls from net-lib and make sure it reads them well, and still keep this behaviour.

@waneck
Copy link
Member

waneck commented Oct 10, 2016

I'll make a pass on -net-lib reading for 3.3

@frabbit
Copy link
Member

frabbit commented Nov 24, 2016

@waneck is this relevant for 3.3 or should we postpone this issue?

@Simn Simn modified the milestones: 3.3.0, 3.4 Dec 10, 2016
@Simn Simn modified the milestones: 3.4, 4.0 Jan 9, 2017
@Simn Simn modified the milestones: Release 4.0, Bugs Apr 17, 2018
@lublak
Copy link
Contributor

lublak commented May 22, 2019

I run also in this issue:

error 0x3
Fatal error: exception File "ilMetaReader.ml", line 577, characters 34-40: Assertion failed
Raised at file "ilMetaReader.ml", line 577, characters 34-46
Called from file "ilMetaReader.ml", line 1477, characters 21-44
Called from file "ilMetaReader.ml", line 1961, characters 19-66
Called from file "ilMetaReader.ml" (inlined), line 2288, characters 12-46
Called from file "ilMetaReader.ml", line 2293, characters 16-41
Called from file "array.ml", line 124, characters 31-51
Called from file "ilMetaReader.ml", line 2284, characters 1-347
Called from file "ilMetaReader.ml", line 2410, characters 1-14
Called from file "_build/src/codegen/dotnet.ml", line 1133, characters 14-64
Called from file "_build/src/codegen/dotnet.ml", line 1157, characters 13-22
Called from file "_build/src/codegen/dotnet.ml", line 1280, characters 46-62
Called from file "list.ml", line 106, characters 12-15
Called from file "_build/src/compiler/main.ml", line 252, characters 4-30
Called from file "_build/src/compiler/main.ml", line 834, characters 11-55
Called from file "_build/src/compiler/main.ml", line 383, characters 3-11
Called from file "_build/src/compiler/main.ml", line 1130, characters 1-35

used the dll: https://github.com/lordmulder/DynamicAudioNormalizer

@RealyUniqueName
Copy link
Member

@lublak please, provide a direct link to dll, so that when we get to solving this issue, we know exact commit in that repo. Otherwise dll might change in future and we won't be able to reproduce.

@lublak
Copy link
Contributor

lublak commented May 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug platform-cs Everything related to c#
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants