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
I'm not sure if native compile is supposed to work yet or not, but I figured I'd try it and open an issue since I ran into something. This is a simple compute N digits of pi app.
Ubuntu 14.04.3 LTS
Microsoft .NET Development Utility CoreClr-x64-1.0.0-rc1-16048
dotnet 1.0.16776.1449511470-1
jg@hxz:~/pi$ bin/Debug/dnxcore50/pi
Result: 314159265358979323846264338327941028841971693993689
jg@hxz:~/pi$ bin/Debug/dnxcore50/native/pi
terminate called after throwing an instance of 'char const*'
Aborted
jg@hxz:~/pi$ gdb bin/Debug/dnxcore50/native/pi
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from bin/Debug/dnxcore50/native/pi...(no debugging symbols found)...done.
(gdb) break main
Breakpoint 1 at 0x4289f0
(gdb) run
Starting program: /home/jg/pi/bin/Debug/dnxcore50/native/pi
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Breakpoint 1, 0x00000000004289f0 in main ()
(gdb) s
Single stepping until exit from function main,
which has no line number information.
[New Thread 0x7fffdebbf700 (LWP 5841)]
terminate called after throwing an instance of 'char const*'
Program received signal SIGABRT, Aborted.
0x00007ffff6c01cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff6c01cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff6c050d8 in __GI_abort () at abort.c:89
#2 0x00007ffff7b36535 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff7b346d6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff7b34703 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff7b34922 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00000000004280b6 in __fail_fast ()
#7 0x0000000000405435 in System_Private_CoreLib_System_Globalization_NumberFormatInfo__get_CurrentInfo ()
#8 0x0000000000000000 in ?? ()
(gdb)
Source code:
using System;
using System.Text;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
try {
Console.WriteLine($"Result: {CalculatePi(50)}");
} catch(Exception e) {
Console.WriteLine($"Exception: {e.Message}");
}
}
static public string CalculatePi(int digits)
{
StringBuilder sb = new StringBuilder();
digits++;
uint[] x = new uint[digits*3+2];
uint[] r = new uint[digits*3+2];
for (int j = 0; j < x.Length; j++)
x[j] = 20;
for (int i = 0; i < digits; i++)
{
uint carry = 0;
for (int j = 0; j < x.Length; j++)
{
uint num = (uint)(x.Length - j - 1);
uint dem = num * 2 + 1;
x[j] += carry;
uint q = x[j] / dem;
r[j] = x[j] % dem;
carry = q * num;
}
if(i<digits-1)
sb.Append((x[x.Length-1] / 10).ToString());
r[x.Length - 1] = x[x.Length - 1] % 10; ;
for (int j = 0; j < x.Length; j++)
x[j] = r[j] * 10;
}
return sb.ToString();
}
}
}
Not sure if this is related, but one of the times I mistyped a dotnet command I got this exception:
Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'api-ms-win-core-localization-l1-2-0.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
at Interop.mincore.FormatMessage(Int32 dwFlags, IntPtr lpSource_mustBeNull, UInt32 dwMessageId, Int32 dwLanguageId, StringBuilder lpBuffer, Int32 nSize, IntPtr[] arguments)
at Interop.mincore.TryGetErrorMessage(Int32 errorCode, StringBuilder sb, String& errorMsg)
at Interop.mincore.GetMessage(Int32 errorCode)
at System.Diagnostics.Process.ResolvePath(String filename)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at Microsoft.DotNet.Cli.Utils.Command.Execute()
at Microsoft.DotNet.Cli.Program.Main(String[] args)
Aborted
The text was updated successfully, but these errors were encountered:
I'm not sure if native compile is supposed to work yet or not, but I figured I'd try it and open an issue since I ran into something. This is a simple compute N digits of pi app.
Ubuntu 14.04.3 LTS
Microsoft .NET Development Utility CoreClr-x64-1.0.0-rc1-16048
dotnet 1.0.16776.1449511470-1
Source code:
(Source of pi function http://stackoverflow.com/a/11679007/251002)
Not sure if this is related, but one of the times I mistyped a dotnet command I got this exception:
Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'api-ms-win-core-localization-l1-2-0.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
at Interop.mincore.FormatMessage(Int32 dwFlags, IntPtr lpSource_mustBeNull, UInt32 dwMessageId, Int32 dwLanguageId, StringBuilder lpBuffer, Int32 nSize, IntPtr[] arguments)
at Interop.mincore.TryGetErrorMessage(Int32 errorCode, StringBuilder sb, String& errorMsg)
at Interop.mincore.GetMessage(Int32 errorCode)
at System.Diagnostics.Process.ResolvePath(String filename)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at Microsoft.DotNet.Cli.Utils.Command.Execute()
at Microsoft.DotNet.Cli.Program.Main(String[] args)
Aborted
The text was updated successfully, but these errors were encountered: