Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-5819

[drlvm][signals] Not enough stack for SO processing in pure native threads

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • DRLVM
    • None
    • Windows
    • Patch Available
    • Moderate

    Description

      When stack overflow occurs in pure native thread (i.e. not created not through Portlib or HyThread), thread stack layout is like Windows created.

      There are 3 pages from stack end: 1 guard page (when SO occured), then 1 normal page with read/write access, and 1 not committed page. So total stack amount for SO processing is 8Kb.

      When printing crash dump, SymInitialize() function is called to initialize DBGHelp library. This call consumes >8Kb, so VM runs out of accessible stack memory and crashes with ACCESS_VIOLATION.

      I tried to commit last uncommitted page to increase remaining stack on 4Kb. This solves the problem on Windows/x86 - the patch is in attachment.
      But this does not help on Windows/x86_64 - SymInitialize() call takes > 12Kb so one additional page is still not enough.

      I think the first patch should not be attached - it's workaround only.
      I'm now working on complete solution - I try to call crash processing on specially allocated alternative stack.

      Attachments

        1. H-5819.patch
          10 kB
          Ilya Berezhniuk
        2. H-5819.patch
          10 kB
          Ilya Berezhniuk
        3. H-5819.patch
          2 kB
          Ilya Berezhniuk

        Issue Links

          Activity

            People

              Unassigned Unassigned
              iberezhn Ilya Berezhniuk
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: