Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27643

Stack locator can return invalid stack size when stack size ulimit is unlimited

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.15, 3.5.3
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • v3.4
    • Platforms 2017-01-23, Platforms 2017-02-13

      The stack locator calls pthread_getattr_np and then pthread_attr_getstack to determine how big the stack is. With glibc, that means that if the stack ulimit is set to "unlimited" it will try to determine the size of the stack as though it were UINT64_MAX which can cause the stack size to be reported as a negative number. This can cause the javascript engine to set its internal stack limit to a negative number which will prevent the creation of any new javascript scopes - although this only applies to main(), all our other threads either have an implicit stack size of 2MB or an explicit stack size of 1MB depending on how they were created.

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            jonathan.reams@mongodb.com Jonathan Reams
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: