Skip to content

Simple Hello World app exits with 'Invalid runtimeconfig.json' on OSv #63048

Closed

Description

@wkozaczuk

It has been over 2 years since I tried to run the Dotnet app on OSv (https://github.com/cloudius-systems/osv, also see #13790). We have addressed a number of issues identified back then and I also think dotnet itself has changed a bit (3.1 nack then, 6.0 now).

Anyway, when I try to run a simple hello world example on OSv I get the following error:

./scripts/run.py -e '--env=COREHOST_TRACE=1 --env=COMPlus_EnableDiagnostics=0 /sample2 !'
OSv v0.56.0-42-g0db37f7c
eth0: 192.168.122.15
Booted up in 136.36 ms
Cmdline: /sample2 !
Tracing enabled @ Tue Dec 21 16:51:15 2021 UTC
--- Invoked apphost [version: 6.0.1, commit hash: 3a25a7f1cc446b60678ed25c9d829420d6321eba] main = {
/sample2
}
The managed DLL bound to this executable is: 'sample2.dll'
Resolved fxr [/libhostfxr.so]...
Invoking fx resolver [/libhostfxr.so] hostfxr_main_startupinfo
Host path: [/sample2]
Dotnet path: [/]
App path: [/sample2.dll]
Tracing enabled @ Tue Dec 21 16:51:15 2021 UTC
--- Invoked hostfxr_main_startupinfo [commit hash: 3a25a7f1cc446b60678ed25c9d829420d6321eba]
Checking if CoreCLR path exists=[/libcoreclr.so]
Detecting mode... CoreCLR present in dotnet root [/] and checking if [sample2.deps.json] file present=[1]
--- Executing in a native executable mode...
Using dotnet root path [/]
App runtimeconfig.json from [/sample2.dll]
Runtime config is cfg=/sample2.runtimeconfig.json dev=/sample2.runtimeconfig.dev.json
Attempting to read runtime config: /sample2.runtimeconfig.json
Attempting to read dev runtime config: /sample2.runtimeconfig.dev.json
Expected a JSON object in [/sample2.runtimeconfig.json]
Runtime config [/sample2.runtimeconfig.json] is valid=[0]
Invalid runtimeconfig.json [/sample2.runtimeconfig.json] [/sample2.runtimeconfig.dev.json]

Here is some extra info about the version of dotnet and specifics of how I build the example and deploy to OSv:

dotnet --version
6.0.101

# Here I generate an on Fedora 33 host with dotnet 6.0.1 SDK
dotnet new console --output sample2
cd sample2
dotnet publish -c release --self-contained --runtime linux-x64 -o published

# Output from OSv build which should give you an idea on how the files are placed on the filesystem 
Writing image
Adding /libenviron.so
Adding /libvdso.so
Adding /tools/mount-fs.so
Adding /tools/umount.so
Adding /usr/lib/libgcc_s.so.1
Adding /usr/lib/libstdc++.so.6
Adding /etc/hosts
Link /etc/mnttab to /proc/mounts
Adding /etc/fstab
Adding /System.Formats.Asn1.dll
Adding /System.Security.Claims.dll
Adding /System.Diagnostics.Tools.dll
Adding /System.Xml.XPath.dll
Adding /System.Net.Requests.dll
Adding /createdump
Adding /System.Text.Encoding.dll
Adding /System.Net.Sockets.dll
Adding /System.Diagnostics.FileVersionInfo.dll
Adding /System.Xml.Serialization.dll
Adding /libdbgshim.so
Adding /System.Runtime.Serialization.dll
Adding /System.ComponentModel.EventBasedAsync.dll
Adding /System.Threading.Tasks.Dataflow.dll
Adding /System.Threading.ThreadPool.dll
Adding /System.Console.dll
Adding /System.Numerics.Vectors.dll
Adding /System.Resources.Writer.dll
Adding /System.Net.WebProxy.dll
Adding /System.Net.Ping.dll
Adding /System.Runtime.CompilerServices.Unsafe.dll
Adding /System.Threading.Tasks.Extensions.dll
Adding /System.Collections.dll
Adding /libSystem.Security.Cryptography.Native.OpenSsl.so
Adding /System.Transactions.dll
Adding /System.ComponentModel.Primitives.dll
Adding /System.Reflection.TypeExtensions.dll
Adding /Microsoft.Win32.Registry.dll
Adding /System.Net.dll
Adding /System.Runtime.CompilerServices.VisualC.dll
Adding /System.Reflection.Primitives.dll
Adding /System.Xml.Linq.dll
Adding /sample2.dll
Adding /System.ServiceProcess.dll
Adding /System.Diagnostics.Debug.dll
Adding /System.Data.DataSetExtensions.dll
Adding /System.ComponentModel.TypeConverter.dll
Adding /System.Text.RegularExpressions.dll
Adding /System.Security.Cryptography.X509Certificates.dll
Adding /System.Runtime.Serialization.Formatters.dll
Adding /System.Diagnostics.TraceSource.dll
Adding /System.Private.Uri.dll
Adding /libSystem.IO.Compression.Native.so
Adding /System.Net.Mail.dll
Adding /WindowsBase.dll
Adding /Microsoft.VisualBasic.Core.dll
Adding /System.Collections.Specialized.dll
Adding /System.Buffers.dll
Adding /System.Collections.NonGeneric.dll
Adding /System.Configuration.dll
Adding /System.Globalization.Extensions.dll
Adding /libhostpolicy.so
Adding /System.Transactions.Local.dll
Adding /System.IO.FileSystem.AccessControl.dll
Adding /System.Threading.dll
Adding /System.Runtime.Serialization.Xml.dll
Adding /System.Security.SecureString.dll
Adding /System.Resources.Reader.dll
Adding /sample2.runtimeconfig.json
Adding /System.Runtime.Loader.dll
Adding /System.ServiceModel.Web.dll
Adding /System.Threading.Tasks.dll
Adding /System.Xml.dll
Adding /System.IO.Pipes.AccessControl.dll
Adding /System.Memory.dll
Adding /libmscordbi.so
Adding /System.Net.ServicePoint.dll
Adding /System.Security.Cryptography.Encoding.dll
Adding /System.IO.Compression.dll
Adding /System.ComponentModel.DataAnnotations.dll
Adding /System.Xml.XmlSerializer.dll
Adding /System.IO.FileSystem.dll
Adding /System.Net.WebSockets.Client.dll
Adding /System.Web.dll
Adding /System.Diagnostics.DiagnosticSource.dll
Adding /System.Numerics.dll
Adding /System.Runtime.dll
Adding /System.Core.dll
Adding /System.Security.Cryptography.OpenSsl.dll
Adding /System.Private.Xml.Linq.dll
Adding /System.Drawing.Primitives.dll
Adding /System.IO.Compression.FileSystem.dll
Adding /System.Private.CoreLib.dll
Adding /System.Web.HttpUtility.dll
Adding /System.Drawing.dll
Adding /System.Threading.Overlapped.dll
Adding /System.Security.Cryptography.Csp.dll
Adding /Microsoft.VisualBasic.dll
Adding /System.ValueTuple.dll
Adding /System.Net.Security.dll
Adding /System.IO.IsolatedStorage.dll
Adding /System.Security.Principal.Windows.dll
Adding /System.Net.NetworkInformation.dll
Adding /System.Diagnostics.StackTrace.dll
Adding /libSystem.Native.so
Adding /System.Text.Encoding.Extensions.dll
Adding /System.Net.NameResolution.dll
Adding /libcoreclr.so
Adding /System.Linq.Parallel.dll
Adding /System.Net.WebClient.dll
Adding /sample2.runtimeconfig.json_
Adding /netstandard.dll
Adding /System.IO.FileSystem.Primitives.dll
Adding /System.Text.Encoding.CodePages.dll
Adding /libhostfxr.so
Adding /System.Xml.ReaderWriter.dll
Adding /sample2.deps.json
Adding /System.Xml.XPath.XDocument.dll
Adding /System.Security.dll
Adding /sample2.pdb
Adding /System.Reflection.DispatchProxy.dll
Adding /System.Runtime.InteropServices.dll
Adding /System.Data.Common.dll
Adding /System.IO.Pipes.dll
Adding /System.AppContext.dll
Adding /System.Net.Http.dll
Adding /System.Dynamic.Runtime.dll
Adding /System.Security.Principal.dll
Adding /System.Data.dll
Adding /System.Runtime.Extensions.dll
Adding /libSystem.Globalization.Native.so
Adding /System.Reflection.dll
Adding /System.Net.HttpListener.dll
Adding /System.Linq.Queryable.dll
Adding /System.Reflection.Emit.dll
Adding /System.Security.Cryptography.Cng.dll
Adding /System.Security.Cryptography.Primitives.dll
Adding /System.Globalization.dll
Adding /Microsoft.Win32.Primitives.dll
Adding /System.Runtime.Handles.dll
Adding /System.ObjectModel.dll
Adding /System.Runtime.InteropServices.RuntimeInformation.dll
Adding /System.Reflection.Emit.ILGeneration.dll
Adding /System.Xml.XDocument.dll
Adding /System.Reflection.Extensions.dll
Adding /System.Diagnostics.Process.dll
Adding /System.Security.Cryptography.Algorithms.dll
Adding /Microsoft.CSharp.dll
Adding /System.Threading.Thread.dll
Adding /System.Threading.Timer.dll
Adding /System.Net.WebSockets.dll
Adding /System.Security.AccessControl.dll
Adding /System.Runtime.Serialization.Json.dll
Adding /System.Private.Xml.dll
Adding /System.Xml.XmlDocument.dll
Adding /System.Private.DataContractSerialization.dll
Adding /System.Reflection.Emit.Lightweight.dll
Adding /libclrjit.so
Adding /libmscordaccore.so
Adding /System.Diagnostics.Contracts.dll
Adding /System.Windows.dll
Adding /System.Threading.Tasks.Parallel.dll
Adding /System.Resources.ResourceManager.dll
Adding /sample2
Adding /System.Net.WebHeaderCollection.dll
Adding /System.Collections.Concurrent.dll
Adding /System.IO.Compression.ZipFile.dll
Adding /System.IO.dll
Adding /System.Globalization.Calendars.dll
Adding /System.IO.FileSystem.Watcher.dll
Adding /System.Net.Http.Json.dll
Adding /System.Collections.Immutable.dll
Adding /System.Net.Primitives.dll
Adding /sample2.deps.json_
Adding /System.IO.Compression.Brotli.dll
Adding /System.ComponentModel.Annotations.dll
Adding /System.Diagnostics.Tracing.dll
Adding /mscorlib.dll
Adding /System.Linq.dll
Adding /System.Threading.Channels.dll
Adding /System.Runtime.Serialization.Primitives.dll
Adding /System.IO.UnmanagedMemoryStream.dll
Adding /System.Runtime.Intrinsics.dll
Adding /System.IO.MemoryMappedFiles.dll
Adding /System.Linq.Expressions.dll
Adding /System.Text.Json.dll
Adding /System.Reflection.Metadata.dll
Adding /System.ComponentModel.dll
Adding /System.Net.Quic.dll
Adding /System.IO.FileSystem.DriveInfo.dll
Adding /System.Diagnostics.TextWriterTraceListener.dll
Adding /System.Text.Encodings.Web.dll
Adding /libSystem.Net.Security.Native.so
Adding /System.Runtime.Numerics.dll
Adding /System.dll
First block: 143908, blocks count: 27
Directory entries count 202
Symlinks count 1
Inodes count 203

# Some relevant trace info from the VFS layer
0xffff800000958040 >init            0         0.086872027 vfs_lstat            pathname=/sample2, stat=0x00002000004fe780
0xffff800000958040 >init            0         0.086875418 vfs_lstat_ret        
0xffff800000958040 >init            0         0.086875750 vfs_open             "/sample2" 0x0 00
0xffff800000958040 >init            0         0.086877622 vfs_open_ret         3
0xffff800000958040 >init            0         0.086877834 vfs_close            3
0xffff800000958040 >init            0         0.086878032 vfs_close_ret        
0xffff800000958040 >init            0         0.087759036 vfs_lstat            pathname=/netcoredeps, stat=0x00002000004fe300
0xffff800000958040 >init            0         0.087762112 vfs_lstat_err        errno=2
0xffff800000958040 >init            0         0.087762539 vfs_open             "/netcoredeps/libstdc++.so.6" 0x0 00
0xffff800000958040 >init            0         0.087764621 vfs_open_err         2
0xffff800000958040 >init            0         0.087765120 vfs_lstat            pathname=/, stat=0x00002000004fe300
0xffff800000958040 >init            0         0.087766111 vfs_lstat_ret        
0xffff800000958040 >init            0         0.087766418 vfs_lstat            pathname=/libstdc++.so.6, stat=0x00002000004fe300
0xffff800000958040 >init            0         0.087768346 vfs_lstat_err        errno=2
0xffff800000958040 >init            0         0.087768521 vfs_open             "//libstdc++.so.6" 0x0 00
0xffff800000958040 >init            0         0.087770402 vfs_open_err         2
0xffff800000958040 >init            0         0.087770888 vfs_lstat            pathname=/usr, stat=0x00002000004fe300
0xffff800000958040 >init            0         0.087773098 vfs_lstat_ret        
0xffff800000958040 >init            0         0.087773304 vfs_lstat            pathname=/usr/lib, stat=0x00002000004fe300
0xffff800000958040 >init            0         0.087776338 vfs_lstat_ret        
0xffff800000958040 >init            0         0.087776546 vfs_lstat            pathname=/usr/lib/libstdc++.so.6, stat=0x00002000004fe300
0xffff800000958040 >init            0         0.087780736 vfs_lstat_ret        
0xffff800000958040 >init            0         0.087781088 vfs_open             "/usr/lib/libstdc++.so.6" 0x0 00
0xffff800000958040 >init            0         0.087784416 vfs_open_ret         3
0xffff800000958040 >init            0         0.087784567 vfs_close            3
0xffff800000958040 >init            0         0.087784885 vfs_close_ret        
0xffff800000958040 >init            0         0.090393638 vfs_lstat            pathname=/, stat=0x00002000004fde80
0xffff800000958040 >init            0         0.090395322 vfs_lstat_ret        
0xffff800000958040 >init            0         0.090395560 vfs_lstat            pathname=/libgcc_s.so.1, stat=0x00002000004fde80
0xffff800000958040 >init            0         0.090397320 vfs_lstat_err        errno=2
0xffff800000958040 >init            0         0.090397591 vfs_open             "//libgcc_s.so.1" 0x0 00
0xffff800000958040 >init            0         0.090398946 vfs_open_err         2
0xffff800000958040 >init            0         0.090399408 vfs_lstat            pathname=/usr, stat=0x00002000004fde80
0xffff800000958040 >init            0         0.090400225 vfs_lstat_ret        
0xffff800000958040 >init            0         0.090400372 vfs_lstat            pathname=/usr/lib, stat=0x00002000004fde80
0xffff800000958040 >init            0         0.090401256 vfs_lstat_ret        
0xffff800000958040 >init            0         0.090401414 vfs_lstat            pathname=/usr/lib/libgcc_s.so.1, stat=0x00002000004fde80
0xffff800000958040 >init            0         0.090403347 vfs_lstat_ret        
0xffff800000958040 >init            0         0.090403580 vfs_open             "/usr/lib/libgcc_s.so.1" 0x0 00
0xffff800000958040 >init            0         0.090405242 vfs_open_ret         3
0xffff800000958040 >init            0         0.090405366 vfs_close            3
0xffff800000958040 >init            0         0.090405464 vfs_close_ret        
0xffff800000d47040 /sample2         0         0.133808846 vfs_open             "/etc/localtime" 0x80800 00
0xffff800000d47040 /sample2         0         0.133818650 vfs_open_err         2
0xffff800000d47040 /sample2         0         0.134359307 vfs_pwritev          2 0x0000200000b00bc0 0x2 0x-1
0xffff800000d47040 /sample2         0         0.135136168 vfs_pwritev_ret      0x2e
0xffff800000d47040 /sample2         0         0.135136948 vfs_pwritev          2 0x0000200000b00d00 0x2 0x-1
0xffff800000d47040 /sample2         0         0.135186456 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.135200022 vfs_pwritev          2 0x0000200000b00b20 0x2 0x-1
0xffff800000d47040 /sample2         0         0.136457941 vfs_pwritev_ret      0x5a
0xffff800000d47040 /sample2         0         0.136458318 vfs_pwritev          2 0x0000200000b00c00 0x2 0x-1
0xffff800000d47040 /sample2         0         0.136609610 vfs_pwritev_ret      0xa
0xffff800000d47040 /sample2         0         0.136610005 vfs_pwritev          2 0x0000200000b00d40 0x2 0x-1
0xffff800000d47040 /sample2         0         0.136655181 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.136655945 vfs_pwritev          2 0x0000200000b00c00 0x2 0x-1
0xffff800000d47040 /sample2         0         0.136786942 vfs_pwritev_ret      0x8
0xffff800000d47040 /sample2         0         0.136787256 vfs_pwritev          2 0x0000200000b00d40 0x2 0x-1
0xffff800000d47040 /sample2         0         0.136832414 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.136832895 vfs_pwritev          2 0x0000200000b00c00 0x2 0x-1
0xffff800000d47040 /sample2         0         0.136869225 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.136869507 vfs_pwritev          2 0x0000200000b00d40 0x2 0x-1
0xffff800000d47040 /sample2         0         0.136914470 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.136920292 vfs_lstat            pathname=/proc, stat=0x0000200000afdd30
0xffff800000d47040 /sample2         0         0.136926571 vfs_lstat_ret        
0xffff800000d47040 /sample2         0         0.136926822 vfs_lstat            pathname=/proc/self, stat=0x0000200000afdd30
0xffff800000d47040 /sample2         0         0.136929680 vfs_lstat_ret        
0xffff800000d47040 /sample2         0         0.136929830 vfs_lstat            pathname=/proc/self/exe, stat=0x0000200000afdd30
0xffff800000d47040 /sample2         0         0.136932462 vfs_lstat_ret        
0xffff800000d47040 /sample2         0         0.136934902 vfs_lstat            pathname=/, stat=0x0000200000afdd30
0xffff800000d47040 /sample2         0         0.136935715 vfs_lstat_ret        
0xffff800000d47040 /sample2         0         0.136935881 vfs_lstat            pathname=/sample2, stat=0x0000200000afdd30
0xffff800000d47040 /sample2         0         0.136936768 vfs_lstat_ret        
0xffff800000d47040 /sample2         0         0.136938937 vfs_lstat            pathname=/sample2, stat=0x0000200000afdd30
0xffff800000d47040 /sample2         0         0.136939523 vfs_lstat_ret        
0xffff800000d47040 /sample2         0         0.136940740 vfs_pwritev          2 0x0000200000b00b10 0x2 0x-1
0xffff800000d47040 /sample2         0         0.137735385 vfs_pwritev_ret      0x3a
0xffff800000d47040 /sample2         0         0.137735747 vfs_pwritev          2 0x0000200000b00c50 0x2 0x-1
0xffff800000d47040 /sample2         0         0.137781053 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.137795053 vfs_lstat            pathname=/sample2.dll, stat=0x0000200000afdd30
0xffff800000d47040 /sample2         0         0.137797764 vfs_lstat_ret        
0xffff800000d47040 /sample2         0         0.137799140 vfs_access           "/libhostfxr.so" 00
0xffff800000d47040 /sample2         0         0.137801497 vfs_access_ret       
0xffff800000d47040 /sample2         0         0.137802379 vfs_pwritev          2 0x0000200000b00a70 0x2 0x-1
0xffff800000d47040 /sample2         0         0.138305201 vfs_pwritev_ret      0x20
0xffff800000d47040 /sample2         0         0.138305541 vfs_pwritev          2 0x0000200000b00bb0 0x2 0x-1
0xffff800000d47040 /sample2         0         0.138351171 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.138354899 vfs_lstat            pathname=/libhostfxr.so, stat=0x0000200000afd9f0
0xffff800000d47040 /sample2         0         0.138356930 vfs_lstat_ret        
0xffff800000d47040 /sample2         0         0.138357293 vfs_open             "/libhostfxr.so" 0x0 00
0xffff800000d47040 /sample2         0         0.138358846 vfs_open_ret         3
0xffff800000d47040 /sample2         0         0.138359046 vfs_close            3
0xffff800000d47040 /sample2         0         0.138359158 vfs_close_ret        
0xffff800000d47040 /sample2         0         0.139408459 vfs_pwritev          2 0x0000200000b00b50 0x2 0x-1
0xffff800000d47040 /sample2         0         0.140315492 vfs_pwritev_ret      0x3e
0xffff800000d47040 /sample2         0         0.140315991 vfs_pwritev          2 0x0000200000b00c90 0x2 0x-1
0xffff800000d47040 /sample2         0         0.140362533 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.140363632 vfs_pwritev          2 0x0000200000b00b50 0x2 0x-1
0xffff800000d47040 /sample2         0         0.140665101 vfs_pwritev_ret      0x15
0xffff800000d47040 /sample2         0         0.140665408 vfs_pwritev          2 0x0000200000b00c90 0x2 0x-1
0xffff800000d47040 /sample2         0         0.140710841 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.140711594 vfs_pwritev          2 0x0000200000b00b50 0x2 0x-1
0xffff800000d47040 /sample2         0         0.140945185 vfs_pwritev_ret      0x10
0xffff800000d47040 /sample2         0         0.140945639 vfs_pwritev          2 0x0000200000b00c90 0x2 0x-1
0xffff800000d47040 /sample2         0         0.140995518 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.140996325 vfs_pwritev          2 0x0000200000b00b50 0x2 0x-1
0xffff800000d47040 /sample2         0         0.141344814 vfs_pwritev_ret      0x18
0xffff800000d47040 /sample2         0         0.141345174 vfs_pwritev          2 0x0000200000b00c90 0x2 0x-1
0xffff800000d47040 /sample2         0         0.141390772 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.143208036 vfs_pwritev          2 0x0000200000b00aa0 0x2 0x-1
0xffff800000d47040 /sample2         0         0.143831660 vfs_pwritev_ret      0x2e
0xffff800000d47040 /sample2         0         0.143832156 vfs_pwritev          2 0x0000200000b00be0 0x2 0x-1
0xffff800000d47040 /sample2         0         0.143878673 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.143886230 vfs_pwritev          2 0x0000200000b00a00 0x2 0x-1
0xffff800000d47040 /sample2         0         0.145180014 vfs_pwritev_ret      0x5b
0xffff800000d47040 /sample2         0         0.145180385 vfs_pwritev          2 0x0000200000b00ae0 0x2 0x-1
0xffff800000d47040 /sample2         0         0.145218912 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.145219310 vfs_pwritev          2 0x0000200000b00c20 0x2 0x-1
0xffff800000d47040 /sample2         0         0.145265669 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.145713434 vfs_pwritev          2 0x0000200000b00a00 0x2 0x-1
0xffff800000d47040 /sample2         0         0.146522487 vfs_pwritev_ret      0x30
0xffff800000d47040 /sample2         0         0.146523048 vfs_pwritev          2 0x0000200000b00b40 0x2 0x-1
0xffff800000d47040 /sample2         0         0.146580432 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.146587825 vfs_access           "/libcoreclr.so" 00
0xffff800000d47040 /sample2         0         0.146591113 vfs_access_ret       
0xffff800000d47040 /sample2         0         0.146598828 vfs_access           "/sample2.deps.json" 00
0xffff800000d47040 /sample2         0         0.146601283 vfs_access_ret   
0xffff800000d47040 /sample2         0         0.146602411 vfs_pwritev          2 0x0000200000b00950 0x2 0x-1
0xffff800000d47040 /sample2         0         0.147889618 vfs_pwritev_ret      0x57
0xffff800000d47040 /sample2         0         0.147890369 vfs_pwritev          2 0x0000200000b00a30 0x2 0x-1
0xffff800000d47040 /sample2         0         0.148209954 vfs_pwritev_ret      0x12
0xffff800000d47040 /sample2         0         0.148210422 vfs_pwritev          2 0x0000200000b00b70 0x2 0x-1
0xffff800000d47040 /sample2         0         0.148256421 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.148257779 vfs_access           "/sample2.dll" 00
0xffff800000d47040 /sample2         0         0.148259937 vfs_access_ret       
0xffff800000d47040 /sample2         0         0.148262731 vfs_pwritev          2 0x0000200000b009c0 0x2 0x-1
0xffff800000d47040 /sample2         0         0.148894154 vfs_pwritev_ret      0x2c
0xffff800000d47040 /sample2         0         0.148894593 vfs_pwritev          2 0x0000200000b00b00 0x2 0x-1
0xffff800000d47040 /sample2         0         0.148942363 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.148946903 vfs_lstat            pathname=/sample2.dll, stat=0x0000200000afdab0
0xffff800000d47040 /sample2         0         0.148954133 vfs_lstat_ret        
0xffff800000d47040 /sample2         0         0.148957135 vfs_pwritev          2 0x0000200000b008d0 0x2 0x-1
0xffff800000d47040 /sample2         0         0.149379722 vfs_pwritev_ret      0x1a
0xffff800000d47040 /sample2         0         0.149380177 vfs_pwritev          2 0x0000200000b00a10 0x2 0x-1
0xffff800000d47040 /sample2         0         0.149425925 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.149886514 vfs_pwritev          2 0x0000200000b00660 0x2 0x-1
0xffff800000d47040 /sample2         0         0.150494192 vfs_pwritev_ret      0x2a
0xffff800000d47040 /sample2         0         0.150494712 vfs_pwritev          2 0x0000200000b007a0 0x2 0x-1
0xffff800000d47040 /sample2         0         0.150541405 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.150551057 vfs_pwritev          2 0x0000200000b004e0 0x2 0x-1
0xffff800000d47040 /sample2         0         0.151780413 vfs_pwritev_ret      0x55
0xffff800000d47040 /sample2         0         0.151780678 vfs_pwritev          2 0x0000200000b005c0 0x2 0x-1
0xffff800000d47040 /sample2         0         0.151780795 vfs_pwritev_ret      0x0
0xffff800000d47040 /sample2         0         0.151781094 vfs_pwritev          2 0x0000200000b00700 0x2 0x-1
0xffff800000d47040 /sample2         0         0.151834579 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.151836311 vfs_pwritev          2 0x0000200000b00510 0x2 0x-1
0xffff800000d47040 /sample2         0         0.152726643 vfs_pwritev_ret      0x3e
0xffff800000d47040 /sample2         0         0.152727016 vfs_pwritev          2 0x0000200000b00650 0x2 0x-1
0xffff800000d47040 /sample2         0         0.152779998 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.153222934 vfs_pwritev          2 0x0000200000b00410 0x2 0x-1
0xffff800000d47040 /sample2         0         0.154225414 vfs_pwritev_ret      0x46
0xffff800000d47040 /sample2         0         0.154225865 vfs_pwritev          2 0x0000200000b00550 0x2 0x-1
0xffff800000d47040 /sample2         0         0.154279210 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.154282888 vfs_lstat            pathname=/sample2.runtimeconfig.dev.json, stat=0x0000200000afd5f0
0xffff800000d47040 /sample2         0         0.154286125 vfs_lstat_err        errno=2
0xffff800000d47040 /sample2         0         0.154286722 vfs_lstat            pathname=/sample2.runtimeconfig.json, stat=0x0000200000afd6f0
0xffff800000d47040 /sample2         0         0.154288988 vfs_lstat_ret        
0xffff800000d47040 /sample2         0         0.154306421 vfs_open             "/sample2.runtimeconfig.json" 0x0 00
0xffff800000d47040 /sample2         0         0.154308221 vfs_open_ret         3
0xffff800000d47040 /sample2         0         0.154323487 vfs_pread            3 0xffff800000f88040 0x1fff 0x-1
0xffff800000d47040 /sample2         0         0.154701818 vfs_pread_ret        0x10f
0xffff800000d47040 /sample2         0         0.154728153 vfs_lseek            3 0x0 2
0xffff800000d47040 /sample2         0         0.154728555 vfs_lseek_ret        0x10f
0xffff800000d47040 /sample2         0         0.154728938 vfs_lseek            3 0x0 1
0xffff800000d47040 /sample2         0         0.154729110 vfs_lseek_ret        0x10f
0xffff800000d47040 /sample2         0         0.154729276 vfs_lseek            3 0x0 0
0xffff800000d47040 /sample2         0         0.154729390 vfs_lseek_ret        0x0
0xffff800000d47040 /sample2         0         0.154736648 vfs_pread            3 0xffff800000f88040 0x1fff 0x-1
0xffff800000d47040 /sample2         0         0.154737175 vfs_pread_ret        0x10f
0xffff800000d47040 /sample2         0         0.154746326 vfs_pwritev          2 0x0000200000b00330 0x2 0x-1
0xffff800000d47040 /sample2         0         0.155546449 vfs_pwritev_ret      0x37
0xffff800000d47040 /sample2         0         0.155546912 vfs_pwritev          2 0x0000200000b00360 0x2 0x-1
0xffff800000d47040 /sample2         0         0.155600719 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.155607121 vfs_close            3
0xffff800000d47040 /sample2         0         0.155607921 vfs_close_ret        
0xffff800000d47040 /sample2         0         0.155616777 vfs_pwritev          2 0x0000200000b00610 0x2 0x-1
0xffff800000d47040 /sample2         0         0.156413659 vfs_pwritev_ret      0x39
0xffff800000d47040 /sample2         0         0.156414115 vfs_pwritev          2 0x0000200000b00750 0x2 0x-1
0xffff800000d47040 /sample2         0         0.156467082 vfs_pwritev_ret      0x1
0xffff800000d47040 /sample2         0         0.156469100 vfs_pwritev          2 0x0000200000b00720 0x2 0x-1
0xffff800000d47040 /sample2         0         0.157712734 vfs_pwritev_ret      0x5a
0xffff800000d47040 /sample2         0         0.157713115 vfs_pwritev          2 0x0000200000b00750 0x2 0x-1
0xffff800000d47040 /sample2         0         0.157766171 vfs_pwritev_ret      0x1

The sample2.runtimeconfig.json:

{
  "runtimeOptions": {
    "tfm": "net6.0",
    "includedFrameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "6.0.1"
      }
    ],
    "configProperties": {
      "System.Reflection.Metadata.MetadataUpdater.IsSupported": false
    }
  }
}

Now when I delete both sample2.deps.json and sample2.runtimeconfig.json from the published directory, redeploy and he app works just fine:

OSv v0.56.0-42-g0db37f7c
eth0: 192.168.122.15
Booted up in 134.96 ms
Cmdline: /sample2 !
Tracing enabled @ Tue Dec 21 16:54:26 2021 UTC
--- Invoked apphost [version: 6.0.1, commit hash: 3a25a7f1cc446b60678ed25c9d829420d6321eba] main = {
/sample2
}
The managed DLL bound to this executable is: 'sample2.dll'
Resolved fxr [/libhostfxr.so]...
Invoking fx resolver [/libhostfxr.so] hostfxr_main_startupinfo
Host path: [/sample2]
Dotnet path: [/]
App path: [/sample2.dll]
Tracing enabled @ Tue Dec 21 16:54:26 2021 UTC
--- Invoked hostfxr_main_startupinfo [commit hash: 3a25a7f1cc446b60678ed25c9d829420d6321eba]
Checking if CoreCLR path exists=[/libcoreclr.so]
Detecting mode... CoreCLR present in dotnet root [/] and checking if [sample2.deps.json] file present=[0]
--- Executing in a native executable mode...
Using dotnet root path [/]
App runtimeconfig.json from [/sample2.dll]
Runtime config is cfg=/sample2.runtimeconfig.json dev=/sample2.runtimeconfig.dev.json
Attempting to read runtime config: /sample2.runtimeconfig.json
Attempting to read dev runtime config: /sample2.runtimeconfig.dev.json
Runtime config [/sample2.runtimeconfig.json] is valid=[1]
Executing as a self-contained app as per config file [/sample2.runtimeconfig.json]
--- Resolving libhostpolicy.so version from deps json [/sample2.deps.json]
Cannot use file stream for [/sample2.deps.json]: No such file or directory
The expected libhostpolicy.so directory is [/]
Tracing enabled @ Tue Dec 21 16:54:26 2021 UTC
Reading from host interface version: [0x16041101:248] to initialize policy version: [0x16041101:248]
--- Invoked hostpolicy [commit hash: 3a25a7f1cc446b60678ed25c9d829420d6321eba] [runtime.linux-x64.Microsoft.NETCore.DotNetHostPolicy,6.0.1,runtimes/linux-x64/native][x64] corehost_main = {
/sample2
}
Mode: apphost
Deps file: 
Using core servicing at []
-- arguments_t: host_path='/sample2' app_root='/' deps='/sample2.deps.json' core_svc='' mgd_app='/sample2.dll'
-- arguments_t: dotnet shared store: ''
Using /sample2.deps.json deps file
Could not locate the dependencies manifest file [/sample2.deps.json]. Some libraries may fail to resolve.
-- Listing probe configurations...
probe_config_t: probe=[pkgs] deps-dir-probe=[0]
probe_config_t: probe=[] deps-dir-probe=[1]
probe_config_t: probe=[] deps-dir-probe=[0]
Adding tpa entry: /sample2.dll, AssemblyVersion: , FileVersion: 
Adding files from local dir /
Adding System.Formats.Asn1 to local assembly set from /System.Formats.Asn1.dll
Adding tpa entry: /System.Formats.Asn1.dll, AssemblyVersion: , FileVersion: 
Adding System.Security.Claims to local assembly set from /System.Security.Claims.dll
Adding tpa entry: /System.Security.Claims.dll, AssemblyVersion: , FileVersion: 
Adding System.Diagnostics.Tools to local assembly set from /System.Diagnostics.Tools.dll
Adding tpa entry: /System.Diagnostics.Tools.dll, AssemblyVersion: , FileVersion: 
Adding System.Xml.XPath to local assembly set from /System.Xml.XPath.dll
Adding tpa entry: /System.Xml.XPath.dll, AssemblyVersion: , FileVersion: 
Adding System.Net.Requests to local assembly set from /System.Net.Requests.dll
Adding tpa entry: /System.Net.Requests.dll, AssemblyVersion: , FileVersion: 
Adding System.Text.Encoding to local assembly set from /System.Text.Encoding.dll
Adding tpa entry: /System.Text.Encoding.dll, AssemblyVersion: , FileVersion: 
Adding System.Net.Sockets to local assembly set from /System.Net.Sockets.dll
Adding tpa entry: /System.Net.Sockets.dll, AssemblyVersion: , FileVersion: 
Adding System.Diagnostics.FileVersionInfo to local assembly set from /System.Diagnostics.FileVersionInfo.dll
Adding tpa entry: /System.Diagnostics.FileVersionInfo.dll, AssemblyVersion: , FileVersion: 
Adding System.Xml.Serialization to local assembly set from /System.Xml.Serialization.dll
Adding tpa entry: /System.Xml.Serialization.dll, AssemblyVersion: , FileVersion: 
Adding System.Runtime.Serialization to local assembly set from /System.Runtime.Serialization.dll
Adding tpa entry: /System.Runtime.Serialization.dll, AssemblyVersion: , FileVersion: 
Adding System.ComponentModel.EventBasedAsync to local assembly set from /System.ComponentModel.EventBasedAsync.dll
Adding tpa entry: /System.ComponentModel.EventBasedAsync.dll, AssemblyVersion: , FileVersion: 
Adding System.Threading.Tasks.Dataflow to local assembly set from /System.Threading.Tasks.Dataflow.dll
Adding tpa entry: /System.Threading.Tasks.Dataflow.dll, AssemblyVersion: , FileVersion: 
Adding System.Threading.ThreadPool to local assembly set from /System.Threading.ThreadPool.dll
Adding tpa entry: /System.Threading.ThreadPool.dll, AssemblyVersion: , FileVersion: 
Adding System.Console to local assembly set from /System.Console.dll
Adding tpa entry: /System.Console.dll, AssemblyVersion: , FileVersion: 
Adding System.Numerics.Vectors to local assembly set from /System.Numerics.Vectors.dll
Adding tpa entry: /System.Numerics.Vectors.dll, AssemblyVersion: , FileVersion: 
Adding System.Resources.Writer to local assembly set from /System.Resources.Writer.dll
Adding tpa entry: /System.Resources.Writer.dll, AssemblyVersion: , FileVersion: 
Adding System.Net.WebProxy to local assembly set from /System.Net.WebProxy.dll
Adding tpa entry: /System.Net.WebProxy.dll, AssemblyVersion: , FileVersion: 
Adding System.Net.Ping to local assembly set from /System.Net.Ping.dll
Adding tpa entry: /System.Net.Ping.dll, AssemblyVersion: , FileVersion: 
Adding System.Runtime.CompilerServices.Unsafe to local assembly set from /System.Runtime.CompilerServices.Unsafe.dll
Adding tpa entry: /System.Runtime.CompilerServices.Unsafe.dll, AssemblyVersion: , FileVersion: 
Adding System.Threading.Tasks.Extensions to local assembly set from /System.Threading.Tasks.Extensions.dll
Adding tpa entry: /System.Threading.Tasks.Extensions.dll, AssemblyVersion: , FileVersion: 
Adding System.Collections to local assembly set from /System.Collections.dll
Adding tpa entry: /System.Collections.dll, AssemblyVersion: , FileVersion: 
Adding System.Transactions to local assembly set from /System.Transactions.dll
Adding tpa entry: /System.Transactions.dll, AssemblyVersion: , FileVersion: 
Adding System.ComponentModel.Primitives to local assembly set from /System.ComponentModel.Primitives.dll
Adding tpa entry: /System.ComponentModel.Primitives.dll, AssemblyVersion: , FileVersion: 
Adding System.Reflection.TypeExtensions to local assembly set from /System.Reflection.TypeExtensions.dll
Adding tpa entry: /System.Reflection.TypeExtensions.dll, AssemblyVersion: , FileVersion: 
Adding Microsoft.Win32.Registry to local assembly set from /Microsoft.Win32.Registry.dll
Adding tpa entry: /Microsoft.Win32.Registry.dll, AssemblyVersion: , FileVersion: 
Adding System.Net to local assembly set from /System.Net.dll
Adding tpa entry: /System.Net.dll, AssemblyVersion: , FileVersion: 
Adding System.Runtime.CompilerServices.VisualC to local assembly set from /System.Runtime.CompilerServices.VisualC.dll
Adding tpa entry: /System.Runtime.CompilerServices.VisualC.dll, AssemblyVersion: , FileVersion: 
Adding System.Reflection.Primitives to local assembly set from /System.Reflection.Primitives.dll
Adding tpa entry: /System.Reflection.Primitives.dll, AssemblyVersion: , FileVersion: 
Adding System.Xml.Linq to local assembly set from /System.Xml.Linq.dll
Adding tpa entry: /System.Xml.Linq.dll, AssemblyVersion: , FileVersion: 
Skipping sample2.dll because the sample2.dll already exists in local assemblies
Adding System.ServiceProcess to local assembly set from /System.ServiceProcess.dll
Adding tpa entry: /System.ServiceProcess.dll, AssemblyVersion: , FileVersion: 
Adding System.Diagnostics.Debug to local assembly set from /System.Diagnostics.Debug.dll
Adding tpa entry: /System.Diagnostics.Debug.dll, AssemblyVersion: , FileVersion: 
Adding System.Data.DataSetExtensions to local assembly set from /System.Data.DataSetExtensions.dll
Adding tpa entry: /System.Data.DataSetExtensions.dll, AssemblyVersion: , FileVersion: 
Adding System.ComponentModel.TypeConverter to local assembly set from /System.ComponentModel.TypeConverter.dll
Adding tpa entry: /System.ComponentModel.TypeConverter.dll, AssemblyVersion: , FileVersion: 
Adding System.Text.RegularExpressions to local assembly set from /System.Text.RegularExpressions.dll
Adding tpa entry: /System.Text.RegularExpressions.dll, AssemblyVersion: , FileVersion: 
Adding System.Security.Cryptography.X509Certificates to local assembly set from /System.Security.Cryptography.X509Certificates.dll
Adding tpa entry: /System.Security.Cryptography.X509Certificates.dll, AssemblyVersion: , FileVersion: 
Adding System.Runtime.Serialization.Formatters to local assembly set from /System.Runtime.Serialization.Formatters.dll
Adding tpa entry: /System.Runtime.Serialization.Formatters.dll, AssemblyVersion: , FileVersion: 
Adding System.Diagnostics.TraceSource to local assembly set from /System.Diagnostics.TraceSource.dll
Adding tpa entry: /System.Diagnostics.TraceSource.dll, AssemblyVersion: , FileVersion: 
Adding System.Private.Uri to local assembly set from /System.Private.Uri.dll
Adding tpa entry: /System.Private.Uri.dll, AssemblyVersion: , FileVersion: 
....
Adding tpa entry: /System.Runtime.Numerics.dll, AssemblyVersion: , FileVersion: 
Adding System to local assembly set from /System.dll
Adding tpa entry: /System.dll, AssemblyVersion: , FileVersion: 
Adding to native path: /
Adding to resources path: /
Property RUNTIME_IDENTIFIER = linux-x64
Property FX_DEPS_FILE = 
Property APP_CONTEXT_DEPS_FILES = /sample2.deps.json
Property APP_CONTEXT_BASE_DIRECTORY = /
Property PLATFORM_RESOURCE_ROOTS = /:
Property PROBING_DIRECTORIES = :
Property NATIVE_DLL_SEARCH_DIRECTORIES = /:
Property TRUSTED_PLATFORM_ASSEMBLIES = /System.dll:/System.Runtime.Numerics.dll:/System.IO.FileSystem.DriveInfo.dll:/System.ComponentModel.dll:/System.Reflection.Metadata.dll:/System.Text.Json.dll:/System.Runtime.Serialization.Primitives.dll:/System.Linq.dll:/System.IO.Compression.Brotli.dll:/System.Net.Primitives.dll:/System.Collections.Immutable.dll:/System.Net.Http.Json.dll:/System.IO.FileSystem.Watcher.dll:/System.Globalization.Calendars.dll:/System.IO.dll:/System.IO.Compression.ZipFile.dll:/System.Collections.Concurrent.dll:/System.Resources.ResourceManager.dll:/System.Diagnostics.Contracts.dll:/System.Xml.XmlDocument.dll:/System.Private.Xml.dll:/System.Runtime.Serialization.Json.dll:/System.Security.AccessControl.dll:/System.Numerics.Vectors.dll:/System.IO.UnmanagedMemoryStream.dll:/System.ServiceModel.Web.dll:/System.Net.NameResolution.dll:/System.Resources.Reader.dll:/System.Transactions.dll:/System.Collections.NonGeneric.dll:/System.Buffers.dll:/System.Private.Uri.dll:/System.Memory.dll:/System.Threading.dll:/System.Xml.XDocument.dll:/System.Net.Ping.dll:/System.Net.Mail.dll:/System.Diagnostics.Debug.dll:/System.IO.MemoryMappedFiles.dll:/System.Diagnostics.TraceSource.dll:/System.Runtime.InteropServices.dll:/System.Threading.Tasks.dll:/System.Text.RegularExpressions.dll:/Microsoft.Win32.Registry.dll:/System.IO.FileSystem.AccessControl.dll:/System.Dynamic.Runtime.dll:/System.ComponentModel.TypeConverter.dll:/System.ComponentModel.EventBasedAsync.dll:/System.Net.Requests.dll:/System.Net.NetworkInformation.dll:/WindowsBase.dll:/System.Data.DataSetExtensions.dll:/System.Diagnostics.FileVersionInfo.dll:/System.Collections.Specialized.dll:/System.Xml.Linq.dll:/System.Xml.Serialization.dll:/System.Security.Claims.dll:/System.Runtime.Handles.dll:/System.Console.dll:/mscorlib.dll:/System.Configuration.dll:/System.Runtime.Serialization.dll:/System.Net.dll:/System.Private.DataContractSerialization.dll:/System.Globalization.Extensions.dll:/System.Diagnostics.Process.dll:/System.Net.Sockets.dll:/System.Text.Encoding.dll:/System.Formats.Asn1.dll:/System.Xml.XPath.XDocument.dll:/System.IO.Pipes.AccessControl.dll:/System.Runtime.Serialization.Xml.dll:/System.Threading.Tasks.Extensions.dll:/System.Security.SecureString.dll:/System.Security.Cryptography.Cng.dll:/sample2.dll:/System.Runtime.CompilerServices.VisualC.dll:/System.Xml.ReaderWriter.dll:/System.Threading.Channels.dll:/System.Reflection.Emit.ILGeneration.dll:/System.Threading.Tasks.Dataflow.dll:/System.Threading.ThreadPool.dll:/System.Linq.Expressions.dll:/System.Resources.Writer.dll:/System.Diagnostics.Tools.dll:/System.Runtime.InteropServices.RuntimeInformation.dll:/System.Runtime.Serialization.Formatters.dll:/System.Reflection.TypeExtensions.dll:/System.Runtime.CompilerServices.Unsafe.dll:/System.Security.Cryptography.OpenSsl.dll:/System.Xml.XPath.dll:/System.Runtime.Loader.dll:/System.Web.dll:/System.Security.Cryptography.X509Certificates.dll:/System.ComponentModel.Primitives.dll:/System.ServiceProcess.dll:/System.Reflection.Extensions.dll:/System.Diagnostics.Tracing.dll:/System.Net.ServicePoint.dll:/Microsoft.VisualBasic.Core.dll:/System.Core.dll:/System.Threading.Thread.dll:/System.Diagnostics.TextWriterTraceListener.dll:/System.IO.Compression.dll:/System.Text.Encoding.Extensions.dll:/System.Net.Quic.dll:/System.ComponentModel.DataAnnotations.dll:/System.Drawing.Primitives.dll:/System.Transactions.Local.dll:/System.Xml.XmlSerializer.dll:/System.Windows.dll:/System.IO.FileSystem.dll:/System.Xml.dll:/System.ValueTuple.dll:/System.IO.Pipes.dll:/System.Net.WebHeaderCollection.dll:/System.Net.WebSockets.Client.dll:/System.Diagnostics.DiagnosticSource.dll:/System.Numerics.dll:/System.Security.Cryptography.Encoding.dll:/System.IO.IsolatedStorage.dll:/System.Threading.Tasks.Parallel.dll:/System.Linq.Parallel.dll:/System.Threading.Timer.dll:/System.Runtime.dll:/System.Private.Xml.Linq.dll:/System.IO.Compression.FileSystem.dll:/System.IO.FileSystem.Primitives.dll:/System.Private.CoreLib.dll:/System.Web.HttpUtility.dll:/System.Drawing.dll:/System.Text.Encoding.CodePages.dll:/System.Reflection.Emit.Lightweight.dll:/System.Net.Http.dll:/System.Diagnostics.StackTrace.dll:/System.Collections.dll:/System.Threading.Overlapped.dll:/System.Net.Security.dll:/System.Security.Cryptography.Csp.dll:/Microsoft.VisualBasic.dll:/System.Security.Principal.Windows.dll:/System.Net.WebClient.dll:/netstandard.dll:/System.Reflection.DispatchProxy.dll:/System.Data.Common.dll:/System.AppContext.dll:/System.Security.Principal.dll:/System.Security.Cryptography.Primitives.dll:/System.Data.dll:/System.Runtime.Extensions.dll:/System.Text.Encodings.Web.dll:/System.Net.WebProxy.dll:/System.Reflection.dll:/System.Net.HttpListener.dll:/System.Linq.Queryable.dll:/System.Runtime.Intrinsics.dll:/System.Reflection.Emit.dll:/System.ComponentModel.Annotations.dll:/System.Globalization.dll:/Microsoft.Win32.Primitives.dll:/System.Reflection.Primitives.dll:/System.Security.dll:/System.ObjectModel.dll:/System.Security.Cryptography.Algorithms.dll:/Microsoft.CSharp.dll:/System.Net.WebSockets.dll:/System.Private.CoreLib.dll
CoreCLR path = '/libcoreclr.so', CoreCLR dir = '/'
syscall(): unimplemented system call 324
mlock() stubbed
Launch host: /sample2, app: /sample2.dll, argc: 0, args: 
--- Begin breadcrumb write
Breadcrumb store [] is not ACL-ed with rw-
Breadcrumb store was not obtained... skipping write.
Hello, World!
Execute managed assembly exit code: 0x0

What could be the reason the app with the JSON files fails to start but without is able to?

Activity

  1. ghost added
    untriaged
    on Dec 21, 2021
  2. am11 commented on Dec 23, 2021

    @am11
    Member

    @wkozaczuk, I am not sure why RapidJSON (used by corehost) is failing to read/parse runtimeconfigs when app is published as self-contained. However, with nanos unikernel (https://github.com/nanovms/ops-examples/tree/master/dotnet#net-hello-world), I publish application as a self-contained && single-file:

    dotnet publish --use-current-runtime -p:PublishSingleFile=true --self-contained true -o mydir

    In 3.1, the single-file apps used to extract files on filesystem on first run, but now with .NET 6, it reads most of the files from app bundle (in memory using mmap) so experience in restricted/minimal environments like unikernels is much improved. Perhaps you can try that publishing mode with OSv?

  3. wkozaczuk commented on Jan 18, 2022

    @wkozaczuk
    Author

    @am11 This is most likely caused by the RAPIDJSON_48BITPOINTER_OPTIMIZATION optimization turned on Linux. I added my comment here - Tencent/rapidjson#1596 (comment). After I turn it off, all the RapidJSON unit tests that used to crash, pass now. I have not tested dotnet yet (I would have to build it from sources), but I am almost certain it is the case.
    Any plans to turn off RAPIDJSON_48BITPOINTER_OPTIMIZATION altogether for Linux given that eventually those 16 bits will be used in some future and relying on it is a little bit dangerous in my humble opinion.

  4. am11 commented on Jan 19, 2022

    @am11
    Member

    Nice catch! I remember that issue. :)
    Based on Tencent/rapidjson#1596 (comment):

    And reading Wikipedia's X86-64 Virtual address space details, also AMD is doing it this way:

    the AMD specification requires that the most significant 16 bits of any virtual address, bits 48 through 63, must be copies of bit 47 (in a manner akin to sign extension). If this requirement is not met, the processor will raise an exception.

    But taking into account that Intel extends the size of virtual addresses from 48 bits to 57 bits, this optimization is going to become obsolete. Should it not be removed completely?

    I think RAPIDJSON_48BITPOINTER_OPTIMIZATION is more harmful than its worth. The performance impact on systems that do have 48 bits virtual address size would slightly regress, some numbers are given here: Tencent/rapidjson#546 (comment). However, .runtimeconfig.json and other two or three config files which we read during the app startup using RapidJSON are typically small enough that it is unlikely to make measurable difference.

    Since "application startup time performance" is kind of a topic which is cared a lot about in .NET, we should measure the impact with BenchmarkDotNet; i.e. roughly benchmark this code: System.Diagnostics.Process.Start("dotnet new console --name foo && dotnet build foo && dotnet run --no-build --project foo").WaitForExit() before and after the change. We can also fill .runtimeconfig.json (after dotnet build step) with some unrealistic noise and measure the impact to find the point where it starts to make a difference (in milliseconds) for a regular app.

    @vitek-karas, @jkotas, basically this is about removing the surrounding ifdef so this (fragile) optimization is disabled all x64 platforms

    #ifdef __sun
    // This optimization relies on zeros in higher 16-bits, whereas SunOS has 1s. More details at
    // https://github.com/Tencent/rapidjson/issues/1596.
    // The impact here was that runtimeOptions key available in hwapp.runtimeconfig.json was not
    // located by RapidJson's FindMember() API from runtime_config_t::ensure_parsed().
    #define RAPIDJSON_48BITPOINTER_OPTIMIZATION 0
    #endif

  5. VSadov commented on Jan 19, 2022

    @VSadov
    Member

    I think on some ARM64 machines the virtual address space is 52bit.
    We should measure, to be sure that 48bit optimization does not buy much, and disable it.

  6. am11 commented on Jan 19, 2022

    @am11
    Member

    Yup, this optimization (and RAPIDJSON_48BITPOINTER_OPTIMIZATION macro) is only applicable to x86-64.

  7. jkotas commented on Jan 19, 2022

    @jkotas
    Member

    basically this is about removing the surrounding ifdef so this (fragile) optimization is disabled all x64 platforms

    Agree. This looks like an optimization that will only cause troubles going forward.

  8. self-assigned this
    on Jan 22, 2022
  9. ghost added
    in-pr
    on Feb 5, 2022
  10. ghost removed
    in-pr
    on Feb 7, 2022
  11. ghost added
    in-pr
    on Feb 7, 2022
  12. ghost removed
    in-pr
    on Feb 7, 2022
  13. ghost locked as resolved and limited conversation to collaborators on Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-Hostuntriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions