Skip to content

Fix CLR startup issues provided by Clang sanitizer #15849

Closed

Description

@steveharter

As part of #15298, attempt fix the clr startup issues so that test-specific sanitizer output can be determined and evaluated.

Currently, when the sanitizers are enabled, several messages from the undefined behavior sanitizer are displayed when any program is run:
/src/inc/clrhost.h:137:30: runtime error: call to function CExecutionEngine::GetTlsData() through pointer to incorrect function type 'void ()()'

/src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp:336:22: runtime error: call to function coreclr_initialize through pointer to incorrect function type 'int ()(const char *, const char *, int, const char *, const char *, void *, unsigned int *)'
/src/dlls/mscoree/unixinterface.cpp:187: note: coreclr_initialize defined here

/src/inc/clrhost.h:137:30: runtime error: call to function ClrFlsGetBlockGeneric() through pointer to incorrect function type 'void *()()'
/src/utilcode/clrhost_nodependencies.cpp:768: note: ClrFlsGetBlockGeneric() defined here

/src/inc/clrhost.h:184:30: runtime error: call to function ClrFlsGetBlockGeneric() through pointer to incorrect function type 'void *()()'

/src/vm/object.cpp:2633:5: runtime error: member call on null pointer of type 'Object'

/src/vm/object.cpp:2712:5: runtime error: member call on null pointer of type 'Object'

/src/gc/handletablecore.cpp:1987:42: runtime error: shift exponent 64 is too large for 32-bit type 'unsigned int'

/src/debug/ee/debugger.cpp:2351:24: runtime error: reference binding to null pointer of type 'const InteropSafe'

/src/debug/ee/controller.cpp:894:26: runtime error: reference binding to null pointer of type 'const InteropSafe'

/src/inc/random.h:108:30: runtime error: signed integer overflow: 1855390761 - -1417746578 cannot be represented in type 'int'

/src/gc/gc.cpp:9922:14: runtime error: member access within null pointer of type 'WKS::gc_heap'

/src/inc/sstring.inl:2090:20: runtime error: left shift of negative value -1

/src/pal/src/map/map.cpp:1588:35: runtime error: member access within null pointer of type 'MAPPED_VIEW_LIST' (aka 'CorUnix::_MVL')

There is also an address sanitizer error (these errors stop processing so it is blocking)
==51212==ERROR: AddressSanitizer: stack-buffer-underflow on address 0x7ffd252450df at pc 0x7fe3711c2a68 bp 0x7ffd25244f70 sp 0x7ffd25244f68
READ of size 1 at 0x7ffd252450df thread T0
#0 0x7fe3711c2a67 in CMiniMdBase::UsesAllocatedMemory(CMiniColDef*) /src/md/runtime/metamodel.cpp:1240:5

Activity

  1. self-assigned this
    on Dec 3, 2015
  2. danmoseley commented on Oct 11, 2016

    @danmoseley
    Contributor

    Shouldn't this move to a coreclr issue

  3. steveharter commented on Oct 11, 2016

    @steveharter
    ContributorAuthor

    Sure it could be moved as the bulk of the work is in coreclr. However, it is enabled for corefx native code as well.

  4. danmoseley commented on Oct 17, 2016

    @danmoseley
    Contributor

    Clearing assignee per our policy that assignment is for work that is imminent. UP for grabs

  5. danmoseley commented on Nov 29, 2016

    @danmoseley
    Contributor
  6. transferred this issue fromdotnet/corefxon Jan 31, 2020
  7. added this to the 2.0.0 milestone on Jan 31, 2020
  8. ghost locked as resolved and limited conversation to collaborators on Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-MetaenhancementProduct code improvement that does NOT require public API changes/additionshelp wanted[up-for-grabs] Good issue for external contributors

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions