[Webkit-unassigned] [Bug 12627] New: register context saved by setjmp is skipped by GC on windows

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 5 21:06:34 PST 2007


http://bugs.webkit.org/show_bug.cgi?id=12627

           Summary: register context saved by setjmp is skipped by GC on
                    windows
           Product: WebKit
           Version: 420+ (nightly)
          Platform: PC
        OS/Version: Windows XP
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: huanr at yahoo.com
                CC: ap at webkit.org, ggaren at apple.com,
                    morganl.webkit at yahoo.com, huanr at yahoo.com,
                    ian.eng.webkit at gmail.com


code snippet in Collector::markCurrentThreadConservatively: 
{
  ...
  // use setjmp to save register context on the stack
  jmp_buf registers;
  setjmp(registers);
  ...
  // get the base of the stack
   NT_TIB *pTib;
   __asm {
       MOV EAX, FS:[18h]
       MOV pTib, EAX
   }
   void *stackBase = (void *)pTib->StackBase;
  ...
  // get the current top of the stack.
  void *dummy;
  void *stackPointer = &dummy;

  markStackObjectsConservatively(stackPointer, stackBase);
  ...
}

If my understanding of the above code is correct, the assumption here is that
the address of dummy should be lower than jmp_buf (assuming stack going
downawards) so all saved register context will be included. however, this is
not the case for windows by examining the stack at run time:

0:000> bp KJS::Collector::markCurrentThreadConservatively
0:000> g
Breakpoint 1 hit
eax=04cb8f40 ebx=00000000 ecx=00000000 edx=00687ee0 esi=04cc8f30 edi=00000030
eip=006833f0 esp=0012f6a8 ebp=7c859d78 iopl=0         nv up ei pl zr na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000246
KJS::Collector::markCurrentThreadConservatively:
006833f0 55              push    ebp
0:000> dv /V
7c859d70 @ebp-0x08           dummy = 0x90007865
7c859d30 @ebp-0x48       registers = int [16]
7c859d74 @ebp-0x04            pTib = 0x90909090

The address of dummy is actually higher than register. Thus all register
context saved by setjmp are ignored.

- Anrong


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list