Skip to content

SIGSEGV ( and than Illegal instruction) on Debian 9.0 x64 Celeron #1285

Description

@sherlock1982

SIGSEGV (and than Illegal instruction) on Debian 9.0 x64 Celeron

Core: .NET Core 2.0.5
Kernel: Linux 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u2 (2018-02-21) x86_64 GNU/Linux
CPU: Intel(R) Celeron(R) CPU J3455 @ 1.50GHz, 4GB RAM, 25GB
(Mini PC)

Self contained package produced with "dotnet publish -r linux-x64" finishes with illegal instruction after exception.

Code to review:

using System;

namespace App1
{
    class Program
    {
        static void Main(string[] args)
        {
            try {
                String a = null;
                Console.WriteLine(a.Length);
            }
            catch(Exception ex){
                Console.WriteLine(ex);
            }
            Console.WriteLine("Bye");
        }
    }
}

Expected behavior: Print exception and Bye.

Actual behavior:

System.NullReferenceException: Object reference not set to an instance of an object.
   at App1.Program.Main(String[] args) in /home/repomaster/App1/Program.cs:line 11
Illegal instruction

Faulting stacktrace:

* thread #1: tid = 32628, 0x00007fff7d1704c7, name = 'myApp', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    frame #0: 0x00007fff7d1704c7
->  0x7fff7d1704c7: cmpl   %edi, (%rdi)
    0x7fff7d1704c9: callq  0x7ffff654f740            ; COMString::Length(StringObject*)
    0x7fff7d1704ce: movl   %eax, -0x24(%rbp)
    0x7fff7d1704d1: movl   -0x24(%rbp), %edi
(lldb) bt
* thread #1: tid = 32628, 0x00007fff7d1704c7, name = 'myApp', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
  * frame #0: 0x00007fff7d1704c7
    frame #1: 0x00007ffff6344f07 libcoreclr.so`CallDescrWorkerInternal + 124
    frame #2: 0x00007ffff6255ce0 libcoreclr.so`MethodDescCallSite::CallTargetWorker(unsigned long const*, unsigned long*, int) + 1264
    frame #3: 0x00007ffff6366c03 libcoreclr.so`RunMain(MethodDesc*, short, int*, PtrArray**) + 755
    frame #4: 0x00007ffff6366ea3 libcoreclr.so`Assembly::ExecuteMainMethod(PtrArray**, int) + 227
    frame #5: 0x00007ffff61983fb libcoreclr.so`CorHost2::ExecuteAssembly(unsigned int, char16_t const*, int, char16_t const**, unsigned int*) + 475
    frame #6: 0x00007ffff6172dd6 libcoreclr.so`coreclr_execute_assembly + 262
    frame #7: 0x00007ffff6890433 libhostpolicy.so`coreclr::execute_assembly(void*, unsigned int, int, char const**, char const*, unsigned int*) + 131
    frame #8: 0x00007ffff68850d8 libhostpolicy.so`run(arguments_t const&) + 5976
    frame #9: 0x00007ffff6885772 libhostpolicy.so`corehost_main + 610
    frame #10: 0x00007ffff6b458f4 libhostfxr.so`execute_app(std::string const&, corehost_init_t*, int, char const**) + 212
    frame #11: 0x00007ffff6b4f978 libhostfxr.so`fx_muxer_t::read_config_and_execute(std::string const&, std::string const&, std::unordered_map<std::string, std::vector<std::string, std::allocator<std::string> >, std::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<std::string const, std::vector<std::string, std::allocator<std::string> > > > > const&, int, char const**, host_mode_t) + 4024
    frame #12: 0x00007ffff6b4e8f7 libhostfxr.so`fx_muxer_t::parse_args_and_execute(std::string const&, std::string const&, int, int, char const**, bool, host_mode_t, bool*) + 1975
    frame #13: 0x00007ffff6b4feb9 libhostfxr.so`fx_muxer_t::execute(int, char const**) + 713
    frame #14: 0x00007ffff6b45975 libhostfxr.so`hostfxr_main + 53
    frame #15: 0x000000000040a2bf myApp`run(int, char const**) + 623
    frame #16: 0x000000000040a407 myApp`main + 167
    frame #17: 0x00007ffff6d9c2b1 libc.so.6`__libc_start_main + 241
    frame #18: 0x0000000000409a95 myApp`_start + 41

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions