Closed Bug 9886 Opened 27 years ago Closed 27 years ago

[Crasher] closing child window through JS is causing parent window to be closed.

Categories

(Core :: DOM: Core & HTML, defect, P1)

x86
Windows 95
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: desale, Assigned: scc-obsolete)

References

()

Details

If we open one child window using method window.open(), and if we try to close that child window using method self.close(), it closes parent window instead of just closing child window. PRODUCT: Seamonkey [Apprunner/Viewer] BUILD: 1999-07-14-08. STEPS TO REPRODUCE: 1] Please visit URL I provided. or 1] copy code I'm providing for parent window as well as child window as HTML files. 2] Open parent window HTML file. DESCRIPTION: I'm providing two codes. First code is for parent window and second code is for child window. CODE 1: <html> <head> <title> </title> </head> <body> <form name="testform"> <script> <!-- window.open("closetest1.html"); //--> </script> </form> </body> </html> END OF CODE 1: Above code is for parent window. Here I'm using window.open to open one child window. CODE 2: <html> <head> <title> </title> </head> <body> <form name="testform"> <script> <!-- self.close(); //--> </script> </form> </body> </html> END OF CODE 2: Above code is for child window which is opend by parent window and has code to close itself immediately. I'm using self.close() to close this child window. EXPECTED RESULTS: Only child window should be closed. ACTUAL RESULTS: Parent window as well as child window both get closed.
Status: NEW → RESOLVED
Closed: 27 years ago
Resolution: --- → WORKSFORME
Verfied bug with build 1999-07-14-17 (M8) on Windows 98. WORKSFORME with build 1999-07-29-08 on Windows 98.
Status: RESOLVED → REOPENED
Summary: closing child window through JS is causing parent window to be closed. → [Crasher] closing child window through JS is causing parent window to be closed.
I tried this bug and I'm afraid that its still there, rather its showing worse effects than what it used to show before. Build used : 08-02-09. Viewer: Parent window gets closed. Apprunner: Application Crashes. [Initially only parent used to get closed, but this application crash is new now.] Please test on Windows-95. This bug is crasher now.
Resolution: WORKSFORME → ---
Clearing WroksForMe resolution due to reopen.
Are you still seeing this with a modern build? If so, can you provide a stack trace to help us track down the guilty code?
Yes I can still see this bug. I'm gonna submit stack report ASAP.
Target Milestone: M11
Crashes need to be fixed in beta, unless we explicitly decide otherwise.
Here is a stack trace report. Incident ID: 13583216 Trigger Type: Program Crash Trigger Reason: Access violation Call Stack: (Signature = KERNEL32.DLL + 0x9fa4 (0xbff79fa4) 6396c59f) KERNEL32.DLL + 0x9fa4 (0xbff79fa4) KERNEL32.DLL + 0x2222f (0xbff9222f) 0x00638bf8 Registers: EAX:00000000 EBX:0234bd50 ECX:00000006 EDX:8173a9b8 ESI:014d8218 EDI:014d81fc ESP:0063fb38 EBP:0063fba8 EIP:bff79fa4 cf PF af ZF sf of IF df nt rf vm IOPL: 0 CS:016f DS:0177 SS:0177 ES:0177 FS:29bf GS:3a07 Stack Dump: 0x0063fb30: 00 01 76 00 77 06 A9 60 [ ..v.w..` ] 0x0063fb40: 18 82 4D 01 FC 81 4D 01 50 BD 34 02 C5 FC A8 60 [ ..M...M.P.4....` ] 0x0063fb50: FC 81 4D 01 70 BD 34 02 00 00 00 00 1B 16 AE 60 [ ..M.p.4........` ] 0x0063fb60: 50 BD 34 02 04 00 00 00 70 BD 34 02 FE 8B 00 00 [ P.4.....p.4..... ] 0x0063fb70: 44 18 AE 60 70 BD 34 02 FE 8B 00 00 DA FB 63 00 [ D..`p.4.......c. ] 0x0063fb80: 90 FB 63 00 18 1B AE 60 70 BD 34 02 D9 35 F7 BF [ ..c....`p.4..5.. ] 0x0063fb90: 24 07 00 00 65 D6 00 00 00 00 00 00 70 BD 34 02 [ $...e.......p.4. ] 0x0063fba0: B7 29 D8 8B 77 01 00 00 BC FB 63 00 2F 22 F9 BF [ .)..w.....c./".. ] 0x0063fbb0: FE 8B 07 3A 07 3A 00 00 00 00 00 00 7C 19 F7 BF [ ...:.:......|... ] 0x0063fbc0: F8 8B 63 00 28 FE 63 00 31 18 F7 BF B7 29 D8 8B [ ..c.(.c.1....).. ] 0x0063fbd0: 00 00 00 00 D8 8B 07 3A 00 00 00 00 46 02 00 00 [ .......:....F... ] 0x0063fbe0: 36 8C 00 00 2E 3B 63 00 BF 16 21 0F 37 27 5F 01 [ 6....;c...!.7'_. ] 0x0063fbf0: 00 00 07 3A FE 8B 07 3A 3C 8C FA 3B DF 16 04 00 [ ...:...:<..;.... ] 0x0063fc00: 00 00 00 00 00 00 00 1B AE 60 70 BD 34 02 00 00 [ .........`p.4... ] 0x0063fc10: 00 00 65 D6 00 00 24 07 00 00 24 07 65 D6 00 00 [ ..e...$...$.e... ] 0x0063fc20: 00 00 70 BD 34 02 1B 7A 01 00 00 00 0A C3 00 00 [ ..p.4..z........ ] 0x0063fc30: DF 16 01 00 07 3A 07 3A DC FC 74 8C 68 8C 00 00 [ .....:.:..t.h... ] 0x0063fc40: 03 00 00 1B AE 60 91 0E A7 17 00 00 70 BD 34 02 [ .....`......p.4. ] 0x0063fc50: 00 00 65 D6 24 07 65 D6 24 07 BF 16 DC FC 63 00 [ ..e.$.e.$.....c. ] 0x0063fc60: A4 8C 00 00 29 02 2E 02 A4 8C B9 37 DF 16 01 00 [ ....)......7.... ] 0x0063fc70: 64 0B 3F 14 24 07 65 D6 00 00 70 BD 34 02 30 C9 [ d.?.$.e...p.4.0. ] 0x0063fc80: 73 01 68 02 4C 00 00 00 24 07 65 D6 00 00 00 00 [ s.h.L...$.e..... ] 0x0063fc90: 70 BD 34 02 6F 01 DF 16 01 00 0A C3 00 00 01 00 [ p.4.o........... ] 0x0063fca0: 2C 37 2C 37 D9 14 F7 BF 6F 01 7D 00 B4 FC 63 00 [ ,7,7....o.}...c. ] 0x0063fcb0: 77 01 63 00 BF 29 00 00 BD 4C F6 BF 70 3D 7D 00 [ w.c..)...L..p=}. ] 0x0063fcc0: 00 00 00 00 F8 FC 63 00 07 C7 B9 60 DC FC 63 00 [ ......c....`..c. ] 0x0063fcd0: 38 FD 63 00 80 A7 7A 00 00 00 00 80 24 07 00 00 [ 8.c...z.....$... ] 0x0063fce0: 65 D6 00 00 00 00 00 00 70 BD 34 02 30 C9 73 01 [ e.......p.4.0.s. ] 0x0063fcf0: 68 02 00 00 4C 00 00 00 94 FD 63 00 1C 19 A6 60 [ h...L.....c....` ] 0x0063fd00: C2 12 40 00 80 A7 7A 00 00 00 00 00 34 A8 73 81 [ ..@...z.....4.s. ] 0x0063fd10: 00 00 53 00 52 FD 8C 73 CF AB D2 11 AB 4B 00 80 [ ..S.R..s.....K.. ] 0x0063fd20: C7 87 AD 96 00 94 85 00 74 77 39 AB D3 12 D3 11 [ ........tw9..... ] 0x0063fd30: 8A D1 00 10 5A 1B 88 60 F0 EC 80 00 F5 83 47 E3 [ ....Z..`......G. ] 0x0063fd40: 08 AC D2 11 8D 19 00 80 5F C2 50 0C B0 AD 7A 00 [ ........_.P...z. ] 0x0063fd50: 93 88 A6 B2 A2 BF D2 11 96 C8 00 60 B0 FB 99 56 [ ...........`...V ] 0x0063fd60: A4 AA 7A 00 80 7B 14 43 39 8A D2 11 99 38 00 80 [ ..z..{.C9....8.. ] 0x0063fd70: C7 CB 10 80 80 A7 7A 00 5B 62 B0 02 F3 E7 D2 11 [ ......z.[b...... ] 0x0063fd80: 9F 5A 00 60 08 A6 EF E9 00 97 7D 00 B0 AD 7A 00 [ .Z.`......}...z. ] 0x0063fd90: 00 00 00 00 C4 FD 63 00 33 10 40 00 01 00 00 00 [ ......c.3.@..... ] 0x0063fda0: 80 A7 7A 00 00 00 00 00 00 00 00 00 34 A8 73 81 [ ..z.........4.s. ] 0x0063fdb0: 04 0A 76 00 08 0A 76 00 CC FD 63 00 00 00 00 00 [ ..v...v...c..... ] 0x0063fdc0: 00 00 00 00 38 FE 63 00 5F 23 40 00 01 00 00 00 [ ....8.c._#@..... ] 0x0063fdd0: 00 0A 76 00 60 0E 76 00 00 40 40 00 04 40 40 00 [ ..v.`.v..@@..@@. ] 0x0063fde0: 1C FE 63 00 0C FE 63 00 18 FE 63 00 00 00 00 00 [ ..c...c...c..... ] 0x0063fdf0: 10 FE 63 00 08 40 40 00 0C 40 40 00 00 00 00 00 [ ..c..@@..@@..... ] 0x0063fe00: 34 A8 73 81 00 00 53 00 05 00 00 C0 00 0A 76 00 [ 4.s...S.......v. ] 0x0063fe10: 00 00 00 00 8C FC 63 00 60 0E 76 00 01 00 00 00 [ ......c.`.v..... ] 0x0063fe20: FC FD 63 00 E8 F7 63 00 68 FF 63 00 C0 23 40 00 [ ..c...c.h.c..#@. ] 0x0063fe30: 00 38 40 00 00 00 00 00 78 FF 63 00 49 93 F8 BF [ .8@.....x.c.I... ] 0x0063fe40: 00 00 00 00 34 A8 73 81 00 00 53 00 41 70 70 72 [ ....4.s...S.Appr ] 0x0063fe50: 75 6E 6E 65 72 00 45 58 45 00 53 00 61 70 70 72 [ unner.EXE.S.appr ] 0x0063fe60: 75 6E 6E 65 72 00 78 65 73 4E 44 4F 57 53 5C 53 [ unner.xesNDOWS\S ] 0x0063fe70: B0 FE 63 00 D0 08 00 00 4C C7 73 81 50 00 00 00 [ ..c.....L.s.P... ] 0x0063fe80: D1 89 F7 BF 00 60 70 81 9C C7 73 81 D0 08 00 00 [ .....`p...s..... ] 0x0063fe90: 00 00 00 00 0C 60 70 81 00 60 70 81 4C C7 73 81 [ .....`p..`p.L.s. ] 0x0063fea0: 40 00 00 00 40 00 00 00 0C 60 70 81 A0 B0 0C C1 [ @...@....`p..... ] 0x0063feb0: 3E 87 F7 BF 50 60 70 81 00 60 70 81 98 8B F7 BF [ >...P`p..`p..... ] 0x0063fec0: 00 60 70 81 40 00 00 00 34 A8 73 81 08 00 00 00 [ .`p.@...4.s..... ] 0x0063fed0: 0C A8 73 81 00 00 00 00 1F 41 F7 BF BC C2 73 81 [ ..s......A....s. ] 0x0063fee0: 6C FF 63 00 1C DF F8 BF 40 C7 73 81 1F 41 F7 BF [ l.c.....@.s..A.. ] 0x0063fef0: 50 C7 73 81 38 BD F7 BF 70 14 FC BF 1F 41 F7 BF [ P.s.8...p....A.. ] 0x0063ff00: 50 C7 73 81 38 BD F7 BF 70 14 FC BF 34 A8 73 81 [ P.s.8...p...4.s. ] 0x0063ff10: 34 A8 73 81 10 00 00 00 34 FF 63 00 CD BB F8 BF [ 4.s.....4.c..... ] 0x0063ff20: 1F 41 F7 BF 50 C7 73 81 DA BB F8 BF 70 14 FC BF [ .A..P.s.....p... ] 0x0063ff30: 48 C6 F8 BF 72 C7 73 81 40 00 00 00 FC A4 73 81 [ H...r.s.@.....s. ] 0x0063ff40: A0 B0 0C C1 3E 87 F7 BF 50 60 70 81 7C 22 40 00 [ ....>...P`p.|"@. ] 0x0063ff50: 57 99 F7 BF 00 00 00 00 54 A8 73 81 00 00 AE 29 [ W.......T.s....) ] 0x0063ff60: 40 FE 63 00 00 00 53 00 FF FF FF FF A8 88 FB BF [ @.c...S......... ] 0x0063ff70: B0 80 F7 BF 00 00 00 00 F4 FF 63 00 FB 91 F8 BF [ ..........c..... ] 0x0063ff80: B0 A9 73 81 08 00 00 00 34 A8 73 81 44 00 00 00 [ ..s.....4.s.D... ] 0x0063ff90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ ................ ] 0x0063ffa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ ................ ] 0x0063ffb0: 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 [ ................ ] 0x0063ffc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ ................ ] 0x0063ffd0: FF FF 02 00 63 F2 00 00 00 E0 63 00 00 00 64 00 [ ....c.....c...d. ] 0x0063ffe0: 00 00 00 00 FF FF FF FF E4 9F 73 81 00 00 00 00 [ ..........s..... ] 0x0063fff0: AE 29 0F 34 EC 0F FA 82 38 7C F8 BF 00 00 00 00 [ .).4....8|...... ] Command Line: "C:\Program Files\Netscape\Seamonkey2\x86rel\apprunner.exe" Operating System: Windows 95 4.0 build 67306684 Service Pack: C Processor: Not Available Processor Speed: Not Available Physical Memory: 128.0 MB MEMORYSTATUS Structure: Available Total Physical Memory: 14.6 MB 128.0 MB Page File: 1024.6 MB 1026.7 MB Virtual Memory: 2000.6 MB 2044.0 MB Screen Information: 1024 x 768, 24 bits per pixel
I hate to have to tell you this, but that stack dump isn't really useful at all. We need to get a stack trace, which will include function names and source line numbers. You may need to run under a debugger to generate this information. Do you or someone in your group have VC++ installed on a Win95 box? Are others on Win95 seeing this?
Crashes are all M11/P1/critical.
Assignee: vidur → scc
Status: REOPENED → NEW
There are a couple of problems here: 1) window.open() isn't opening a new window for this test case since the name parameter isn't provided (this is, of course, incorrect). CC:ing danm since he's had his fingers in window.open() for the longest and is now default owner. :-) 2) The test crashes as a result of a QueryReferent() on a weak pointer to a DocLoader occurring downstream from the destructor of the DocLoader. This results in a the destructor being called again while the original call is lower on the stack. Said differently, a class that supports weak references should clear its proxy's reference to it at the start of its destructor. Assigning to Scott Collins based on my conversation with him - he will probably add a ClearProxy() method to nsSupportsWeakReference and invoke it from the DocLoader destructor.
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 27 years ago → 27 years ago
Resolution: --- → FIXED
Added a protected member function |ClearWeakReferences()| which is now called from |nsDocLoaderImpl::~nsDocLoaderImpl()|. I'm not sure this is the _best_ solution; but it's pretty good. An alternative would be incrementing the refcount in docloader's destructor. This would prevent the same thing from happening for raw pointers as well. This technique is also in common use elsewhere. It's something to consider.
Status: RESOLVED → VERIFIED
Marking verified. Working really fine now.
You need to log in before you can comment on or make changes to this bug.