You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
i am using linux dotnet core 2.0.9 and i compile dotnet clrcore branch origin/release/2.0.0 the compile success. then i copy libcoreclr.so to replace the libcoreclr.so in 2.0.9 after that i run dotnet run to run a project then an error occur:
Failed to initialize CoreCLR, HRESULT: 0x80004005
Try replacing all files produced by the coreclr build, not just libcoreclr.so.. Binaries produced by coreclr build are tightly coupled and it is best to replace all of them to get a consistent set.
The most likely reason why you see the error is mismatch between debug and release flavor. ./build.sh builds debug flavor by default, but the shipping coreclr flavor is release.
Hi jkotas,
i rebuild the clr using release then copy everything to the installed clr directory, but running dotnet still have error. dotnet exit at once without any error message.
i copy the binary like:
root@w-VirtualBox:~/coreclr/bin/Product/Linux.x64.Release# cp
actually it is a segmentation fault. the error message is:
Program received signal SIGSEGV, Segmentation fault.
HndWriteBarrier (handle=, objref=)
at /root/coreclr/src/gc/handletable.cpp:832
832 /root/coreclr/src/gc/handletable.cpp: No such file or directory.
(gdb) bt
#0 HndWriteBarrier (handle=, objref=)
at /root/coreclr/src/gc/handletable.cpp:832 dotnet/coreclr#1 HndAssignHandle (handle=, objref=)
at /root/coreclr/src/gc/handletable.inl:32 dotnet/coreclr#2 HndCreateHandle (hTable=, uType=2, object=0x7ffa6ffff048,
lExtraInfo=) at /root/coreclr/src/gc/handletable.cpp:348 dotnet/coreclr#3 0x00007ffff61a1ea2 in CreateHandle (store=0x6b02a0,
object=0x7ffff6835f00 EventPipe::s_configCrst+64)
at /root/coreclr/src/vm/gchandleutilities.h:73 dotnet/coreclr#4 CreateHandle (object=0x7ffff6835f00 EventPipe::s_configCrst+64,
this=) at /root/coreclr/src/vm/appdomain.hpp:1261 dotnet/coreclr#5 SystemDomain::CreatePreallocatedExceptions (
this=0x7ffff6837620 <g_pSystemDomainMemory>)
at /root/coreclr/src/vm/appdomain.cpp:2335 dotnet/coreclr#6 0x00007ffff61a227e in SystemDomain::Init (
this=0x7ffff6837620 <g_pSystemDomainMemory>)
at /root/coreclr/src/vm/appdomain.cpp:2465 dotnet/coreclr#7 0x00007ffff60aec4d in EEStartupHelper (fFlags=)
at /root/coreclr/src/vm/ceemain.cpp:1050 dotnet/coreclr#8 0x00007ffff60adee1 in operator() (this=,
pfFlags=) at /root/coreclr/src/vm/ceemain.cpp:1236 dotnet/coreclr#9 EEStartup (fFlags=) at /root/coreclr/src/vm/ceemain.cpp:1238 dotnet/coreclr#10 0x00007ffff60adde9 in EnsureEEStarted (flags=COINITEE_DEFAULT)
---Type to continue, or q to quit---
at /root/coreclr/src/vm/ceemain.cpp:374 dotnet/coreclr#11 0x00007ffff5fef809 in Start (this=)
at /root/coreclr/src/vm/corhost.cpp:242 dotnet/coreclr#12 CorHost2::Start (this=0x6aa2f0) at /root/coreclr/src/vm/corhost.cpp:189 dotnet/coreclr#13 0x00007ffff5fca879 in coreclr_initialize (exePath=,
appDomainFriendlyName=, propertyCount=10,
propertyKeys=, propertyValues=,
hostHandle=0x7fffffffc9d0,
domainId=0x7ffff6835f00 EventPipe::s_configCrst+64)
at /root/coreclr/src/dlls/mscoree/unixinterface.cpp:216 dotnet/coreclr#14 0x00007ffff68eb326 in coreclr::initialize(char const*, char const*, char const**, char const**, int, void**, unsigned int*) ()
from /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.9/libhostpolicy.so dotnet/coreclr#15 0x00007ffff68dfb0b in run(arguments_t const&) ()
from /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.9/libhostpolicy.so dotnet/coreclr#16 0x00007ffff68e0772 in corehost_main ()
from /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.9/libhostpolicy.so dotnet/coreclr#17 0x00007ffff6b83cbf in ?? ()
from /usr/share/dotnet/host/fxr/2.1.0-rc1/libhostfxr.so dotnet/coreclr#18 0x00007ffff6b8f36c in ?? ()
from /usr/share/dotnet/host/fxr/2.1.0-rc1/libhostfxr.so dotnet/coreclr#19 0x00007ffff6b904c5 in ?? ()
from /usr/share/dotnet/host/fxr/2.1.0-rc1/libhostfxr.so
---Type to continue, or q to quit--- dotnet/coreclr#20 0x00007ffff6b8fa39 in ?? ()
from /usr/share/dotnet/host/fxr/2.1.0-rc1/libhostfxr.so dotnet/coreclr#21 0x00007ffff6b83f0c in hostfxr_main_startupinfo ()
from /usr/share/dotnet/host/fxr/2.1.0-rc1/libhostfxr.so dotnet/coreclr#22 0x000000000040ac74 in ?? () dotnet/coreclr#23 0x000000000040af05 in ?? () dotnet/coreclr#24 0x00007ffff6df4ec5 in __libc_start_main (main=0x40ae60, argc=2,
argv=0x7fffffffde38, init=, fini=,
rtld_fini=, stack_end=0x7fffffffde28) at libc-start.c:287 #3858 0x0000000000408a54 in _start ()
this is the whole stacktrace.
832 line of handletable.cpp is
if (*pClumpAge != 0) // Perf optimization: if clumpAge is 0, nothing more to do
i copy the compiled binary to installed folder like:
root@w-VirtualBox:~/coreclr/bin/Product/Linux.x64.Release# cp * /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.9/ -r
Ok, to make sure you are building from exactly the same source tree as the stuff in the package was built from, please do the following (with the original binaries in place):
@(#)Version 4.6.26614.01 @BuiltBy: root-/tmp/tmp6162051e84024d5a8c0f4c6b6aef460a.exec.cmd: line 2: hostname: command not found @Commit: a536e7eec55c538c94639cefe295aa672996bf9b
See the commit hash at the end of the result. Now in your coreclr repo clone, run
(replace the commit hash in the above command if your one is different)
Now your sources will exactly match the ones from which we have built the stuff.
Then delete the whole bin directory in your coreclr clone and run ./build.sh release there. After that, do the copy you did and things should work.
Actually, I have one more idea on what could be wrong. What clang version are you compiling it with? The build process reports that early after running the build.sh.
Hi Jan,
i checkout the version like you said. but its commit comment is "2.0.8 stable".
i recompile it and copy everything to the installed folder but still can not run, the same result.
the clang i used is 3.5 if i use other version the build.sh will shows "Please install clang-3.5 before running this script" then exit.
@johnww89 maybe the clang 3.5 doesn't work anymore. We have not been using it for quite some time. The build scripts can use any clang upto version 7, you just need to pass in an extra argument to the build.sh. So, for example, if you want to build with clang 3.9, which is the version we use for our official builds for x64, you would use ./build.sh release clang3.9
@janvorli Hi, I use clang3.9 but still have this problem. i make sure there is no object left by clang3.5 by removing everything in coreclr/bin/ before recompile
@janvorli is there any way to compile the coreclr to use. i need to compile it to check an issue of CLR. so any version is ok. so how do you compile and use coreclr? can you suggest me an environment to work?
I do it the way I've described several times a month to debug coreclr issues. So there must be something on your system or in your steps that is causing the troubles you have with it. It is true that I have not done it on Ubuntu 14.04 for about 6 months, since I've upgraded to Ubuntu 16.04. But Ubuntu 14.04 used to be my primary development system before.
May be can try it in a little bit different way:
Publish your app using the unmodified dotnet tool (dotnet publish -r linux-x64)
Note the path that ends with "/publish/" that gets printed at the end of the publish step
Use strings libcoreclr.so | grep "@(#)" (replace the libcoreclr.so with full path to the above mentioned publish folder.
In your coreclr repo, use "git checkout" with the commit number that you got from the previous step.
Run ./build.sh release in there
Copy all the files from bin/Product/Linux.x64.Release/ to the publish folder of your app
i have tried at beggining that copy everything to the published folder of my app. but dotnet don't use the so under the published folder. it still use the one in /usr/share/dotnet/shared/Microsoft.NETCore.App/2.1.6/
i tried just now again it still do not use the so under published folder.
but i copy every thing to /usr/share/dotnet/shared/Microsoft.NETCore.App/2.1.6/ then run again dotnet it seems work. i will test further
the difference i publish is that i didnot add "-r linux-x64" then the so file do not put in the publish folder.
after publish there is a runable bin app and a app.dll
when i run ./app it use the so under the published folder
when i run dotnet app.dll it use so from other folder such as /home/w/.nuget/packages/runtime.linux-x64.microsoft.netcore.app/2.0.0/runtimes/linux-x64/native/libcoreclr.so
the differnt run way will use different so. why will keep two run way. that is confused.
These are two different ways of publishing your app. The way with "-r linux-x64" means that you are publishing completely standalone app that doesn't need dotnet to be installed on the machine where you want to run that app. It contains all the dependencies (managed assemblies and runtime native shared libraries - not dependencies like openssl, libicu though) that the app needs. You can also publish an app for e.g. ARM Linux on Windows x64 machine this way.
If you publish without the "-r" option, then it will publish only the non-runtime assemblies. You can take the contents of the publish folder and run it on any machine that has dotnet installed.
So if you run your app using the dotnet app.dll, then you are asking it to be run using the dotnet runtime installed on the machine.
@janvorli i have maked some tests. that for dotnet runtime 2.1.6 i can replace the installed binary with the compiled one and dotnet runs well. but if for dotnet runtime 2.0.x version if i replace the binaries with the comipled one it actually have the segmentation fault in my previous comments.
if there is one worked version that mybe ok too but now i have another problem:
i want to compile coreclr that want to track the problem in my profiler project. the profiler will rewrite the IL during the jit compile.
but now the problem is dotnet 2.1.6 do not run the profiler well no matter the compiled binary or the installed binary when i run with my profiler it have problem:
Unhandled Exception: System.BadImageFormatException: Bad IL range.
and dotnet 2.0.x runs well with my profiler. but can not run with the compiled binary.
i remember that dotnet 2.1 have such problem that can not run well for profiler. many company have reported this bug.
can anyone run well for the compiled dotnet 2.0.x binary? and what is the environment?
Activity
jkotas commentedon Nov 14, 2018
Try replacing all files produced by the coreclr build, not just libcoreclr.so.. Binaries produced by coreclr build are tightly coupled and it is best to replace all of them to get a consistent set.
The most likely reason why you see the error is mismatch between debug and release flavor.
./build.shbuilds debug flavor by default, but the shipping coreclr flavor is release.johnww89 commentedon Nov 14, 2018
Hi jkotas,
i rebuild the clr using release then copy everything to the installed clr directory, but running dotnet still have error. dotnet exit at once without any error message.
i copy the binary like:
root@w-VirtualBox:~/coreclr/bin/Product/Linux.x64.Release# cp
johnww89 commentedon Nov 14, 2018
actually it is a segmentation fault. the error message is:
Program received signal SIGSEGV, Segmentation fault.
HndWriteBarrier (handle=, objref=)
at /root/coreclr/src/gc/handletable.cpp:832
832 /root/coreclr/src/gc/handletable.cpp: No such file or directory.
jkotas commentedon Nov 14, 2018
What does the rest of the stacktrace look like?
johnww89 commentedon Nov 15, 2018
(gdb) bt
#0 HndWriteBarrier (handle=, objref=)
at /root/coreclr/src/gc/handletable.cpp:832
dotnet/coreclr#1 HndAssignHandle (handle=, objref=)
at /root/coreclr/src/gc/handletable.inl:32
dotnet/coreclr#2 HndCreateHandle (hTable=, uType=2, object=0x7ffa6ffff048,
lExtraInfo=) at /root/coreclr/src/gc/handletable.cpp:348
dotnet/coreclr#3 0x00007ffff61a1ea2 in CreateHandle (store=0x6b02a0,
object=0x7ffff6835f00 EventPipe::s_configCrst+64)
at /root/coreclr/src/vm/gchandleutilities.h:73
dotnet/coreclr#4 CreateHandle (object=0x7ffff6835f00 EventPipe::s_configCrst+64,
this=) at /root/coreclr/src/vm/appdomain.hpp:1261
dotnet/coreclr#5 SystemDomain::CreatePreallocatedExceptions (
this=0x7ffff6837620 <g_pSystemDomainMemory>)
at /root/coreclr/src/vm/appdomain.cpp:2335
dotnet/coreclr#6 0x00007ffff61a227e in SystemDomain::Init (
this=0x7ffff6837620 <g_pSystemDomainMemory>)
at /root/coreclr/src/vm/appdomain.cpp:2465
dotnet/coreclr#7 0x00007ffff60aec4d in EEStartupHelper (fFlags=)
at /root/coreclr/src/vm/ceemain.cpp:1050
dotnet/coreclr#8 0x00007ffff60adee1 in operator() (this=,
pfFlags=) at /root/coreclr/src/vm/ceemain.cpp:1236
dotnet/coreclr#9 EEStartup (fFlags=) at /root/coreclr/src/vm/ceemain.cpp:1238
dotnet/coreclr#10 0x00007ffff60adde9 in EnsureEEStarted (flags=COINITEE_DEFAULT)
---Type to continue, or q to quit---
at /root/coreclr/src/vm/ceemain.cpp:374
dotnet/coreclr#11 0x00007ffff5fef809 in Start (this=)
at /root/coreclr/src/vm/corhost.cpp:242
dotnet/coreclr#12 CorHost2::Start (this=0x6aa2f0) at /root/coreclr/src/vm/corhost.cpp:189
dotnet/coreclr#13 0x00007ffff5fca879 in coreclr_initialize (exePath=,
appDomainFriendlyName=, propertyCount=10,
propertyKeys=, propertyValues=,
hostHandle=0x7fffffffc9d0,
domainId=0x7ffff6835f00 EventPipe::s_configCrst+64)
at /root/coreclr/src/dlls/mscoree/unixinterface.cpp:216
dotnet/coreclr#14 0x00007ffff68eb326 in coreclr::initialize(char const*, char const*, char const**, char const**, int, void**, unsigned int*) ()
from /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.9/libhostpolicy.so
dotnet/coreclr#15 0x00007ffff68dfb0b in run(arguments_t const&) ()
from /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.9/libhostpolicy.so
dotnet/coreclr#16 0x00007ffff68e0772 in corehost_main ()
from /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.9/libhostpolicy.so
dotnet/coreclr#17 0x00007ffff6b83cbf in ?? ()
from /usr/share/dotnet/host/fxr/2.1.0-rc1/libhostfxr.so
dotnet/coreclr#18 0x00007ffff6b8f36c in ?? ()
from /usr/share/dotnet/host/fxr/2.1.0-rc1/libhostfxr.so
dotnet/coreclr#19 0x00007ffff6b904c5 in ?? ()
from /usr/share/dotnet/host/fxr/2.1.0-rc1/libhostfxr.so
---Type to continue, or q to quit---
dotnet/coreclr#20 0x00007ffff6b8fa39 in ?? ()
from /usr/share/dotnet/host/fxr/2.1.0-rc1/libhostfxr.so
dotnet/coreclr#21 0x00007ffff6b83f0c in hostfxr_main_startupinfo ()
from /usr/share/dotnet/host/fxr/2.1.0-rc1/libhostfxr.so
dotnet/coreclr#22 0x000000000040ac74 in ?? ()
dotnet/coreclr#23 0x000000000040af05 in ?? ()
dotnet/coreclr#24 0x00007ffff6df4ec5 in __libc_start_main (main=0x40ae60, argc=2,
argv=0x7fffffffde38, init=, fini=,
rtld_fini=, stack_end=0x7fffffffde28) at libc-start.c:287
#3858 0x0000000000408a54 in _start ()
this is the whole stacktrace.
832 line of handletable.cpp is
if (*pClumpAge != 0) // Perf optimization: if clumpAge is 0, nothing more to do
johnww89 commentedon Nov 15, 2018
i copy the compiled binary to installed folder like:
root@w-VirtualBox:~/coreclr/bin/Product/Linux.x64.Release# cp * /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.9/ -r
janvorli commentedon Nov 15, 2018
@johnww89 what Linux distro are you running on? And does the original unchanged dotnet work fine for you there?
johnww89 commentedon Nov 15, 2018
Hi Janvorli,
i am using ubuntu 14.04 and dotnet core clr is branch origin/release/2.0.0
the original file installed by apt-get works fine.
janvorli commentedon Nov 15, 2018
Ok, to make sure you are building from exactly the same source tree as the stuff in the package was built from, please do the following (with the original binaries in place):
You'll get something like
See the commit hash at the end of the result. Now in your coreclr repo clone, run
(replace the commit hash in the above command if your one is different)
Now your sources will exactly match the ones from which we have built the stuff.
Then delete the whole
bindirectory in your coreclr clone and run./build.sh releasethere. After that, do the copy you did and things should work.Actually, I have one more idea on what could be wrong. What clang version are you compiling it with? The build process reports that early after running the build.sh.
johnww89 commentedon Nov 16, 2018
Hi Jan,
i checkout the version like you said. but its commit comment is "2.0.8 stable".
i recompile it and copy everything to the installed folder but still can not run, the same result.
the clang i used is 3.5 if i use other version the build.sh will shows "Please install clang-3.5 before running this script" then exit.
janvorli commentedon Nov 16, 2018
@johnww89 maybe the clang 3.5 doesn't work anymore. We have not been using it for quite some time. The build scripts can use any clang upto version 7, you just need to pass in an extra argument to the build.sh. So, for example, if you want to build with clang 3.9, which is the version we use for our official builds for x64, you would use
./build.sh release clang3.9Thanks,
Jan
johnww89 commentedon Nov 16, 2018
@janvorli Hi, I use clang3.9 but still have this problem. i make sure there is no object left by clang3.5 by removing everything in coreclr/bin/ before recompile
johnww89 commentedon Nov 19, 2018
@janvorli, Hi, is there any runnable version that can use the compiled clr binary? i don't need any specific version, just any version.
johnww89 commentedon Nov 19, 2018
@janvorli is there any way to compile the coreclr to use. i need to compile it to check an issue of CLR. so any version is ok. so how do you compile and use coreclr? can you suggest me an environment to work?
janvorli commentedon Nov 19, 2018
I do it the way I've described several times a month to debug coreclr issues. So there must be something on your system or in your steps that is causing the troubles you have with it. It is true that I have not done it on Ubuntu 14.04 for about 6 months, since I've upgraded to Ubuntu 16.04. But Ubuntu 14.04 used to be my primary development system before.
May be can try it in a little bit different way:
dotnet publish -r linux-x64)./build.sh releasein therecdinto the publish folderjohnww89 commentedon Nov 20, 2018
i have tried at beggining that copy everything to the published folder of my app. but dotnet don't use the so under the published folder. it still use the one in /usr/share/dotnet/shared/Microsoft.NETCore.App/2.1.6/
i tried just now again it still do not use the so under published folder.
but i copy every thing to /usr/share/dotnet/shared/Microsoft.NETCore.App/2.1.6/ then run again dotnet it seems work. i will test further
janvorli commentedon Nov 20, 2018
It does. Here is an example:
See the
/home/janvorli/test/testapp/bin/Debug/netcoreapp2.0/linux-x64/publish/libcoreclr.soabove.johnww89 commentedon Nov 20, 2018
the difference i publish is that i didnot add "-r linux-x64" then the so file do not put in the publish folder.
after publish there is a runable bin app and a app.dll
when i run ./app it use the so under the published folder
when i run dotnet app.dll it use so from other folder such as /home/w/.nuget/packages/runtime.linux-x64.microsoft.netcore.app/2.0.0/runtimes/linux-x64/native/libcoreclr.so
the differnt run way will use different so. why will keep two run way. that is confused.
janvorli commentedon Nov 20, 2018
These are two different ways of publishing your app. The way with "-r linux-x64" means that you are publishing completely standalone app that doesn't need dotnet to be installed on the machine where you want to run that app. It contains all the dependencies (managed assemblies and runtime native shared libraries - not dependencies like openssl, libicu though) that the app needs. You can also publish an app for e.g. ARM Linux on Windows x64 machine this way.
If you publish without the "-r" option, then it will publish only the non-runtime assemblies. You can take the contents of the publish folder and run it on any machine that has dotnet installed.
So if you run your app using the
dotnet app.dll, then you are asking it to be run using the dotnet runtime installed on the machine.johnww89 commentedon Nov 22, 2018
@janvorli i have maked some tests. that for dotnet runtime 2.1.6 i can replace the installed binary with the compiled one and dotnet runs well. but if for dotnet runtime 2.0.x version if i replace the binaries with the comipled one it actually have the segmentation fault in my previous comments.
if there is one worked version that mybe ok too but now i have another problem:
i want to compile coreclr that want to track the problem in my profiler project. the profiler will rewrite the IL during the jit compile.
but now the problem is dotnet 2.1.6 do not run the profiler well no matter the compiled binary or the installed binary when i run with my profiler it have problem:
Unhandled Exception: System.BadImageFormatException: Bad IL range.
and dotnet 2.0.x runs well with my profiler. but can not run with the compiled binary.
i remember that dotnet 2.1 have such problem that can not run well for profiler. many company have reported this bug.
can anyone run well for the compiled dotnet 2.0.x binary? and what is the environment?
RussKeldorph commentedon Mar 21, 2019
Closing stale bugs. If there is a still a problem, please open a new issue with a clear description and instructions to reproduce.