DevTools: duplicating a tab paused inside a loop creates an unresponsive duplicate
Reported by
surenato...@gmail.com,
Nov 18 2016
|
|||||
Issue description
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.90 Safari/537.36
Steps to reproduce the problem:
1. Open DevTool on any tab
2. Create snippets ::: devtool -> source -> snippets
3. Write any loop with more than one iteration in this snippets
for example:
for (var i = 0; i < 15; i++) {
console.log(i);
}
4. Put breakpoint in loop body (in this case on ։։։ console.log(i); line)
5. Run snippet (CTRL + ENTER)
6. When running snippet Chrome will be paused in debugger. Leaving debugger in waiting position make Right click ֊> duplicate on the tab.
7. New opened page will not be responsive, it doesn’t respond to any click, only F12 works.
In this example there is no source in new page. You can make following steps and establish availability of page sources by the same way.
1. Open any tab with url (exmpl. facebook.com)
2. Open devtool
3. Create snippets ::: devtool -> source -> snippets
4. Write any loop with more than one iteration in this snippets
5. for example:
for (var i = 0; i < 15; i++) {
console.log(i);
}
6. Put breakpoint in loop body (in this case on ։։։ console.log(i); line)
7. Run snippet (CTRL + ENTER)
8. When running snippet Chrome will be paused in debugger. Leaving debugger in waiting position make Right click ֊> duplicate on the tab.
9. Take breakpoint off, refresh this tab (CTRL + R or F5)
10. Now we have two tabs. Make steps 5,6,7 again on first tab (don’t’ make step 8, leave debugger in waiting position).
11. Now we have 3 tabs. Let 3-rd tab undefined (it doesn’t respond to any click only F12 works) and its sources are available only trough F12.
12. Note that we can’t send any XHR request in console (Client side is cut from Server side)
What is the expected behavior?
Presumably new tab from duplicate action should not have reverse connection with his “parent”.
What went wrong?
In my opinion the error comes from duplicate action saving connection with his “parent”. It is similar to Unix fork just with reverse connection.
Did this work before? N/A
Chrome version: 54.0.2840.90 Channel: stable
OS Version: 16.04.1
Flash Version: Shockwave Flash 23.0 r0
I tried mentioned actions on following Chrome versions and operation systems
Chrome versions
Stable ::: Google Chrome: 54.0.2840.59 (Official Build) (64-bit)
Stable ::: Google Chrome: 54.0.2840.71 (Official Build) (64-bit)
Unstable ::: Google Chrome: 56.0.2914.3 (Official Build) dev (64-bit)
Chromium
53.0.2785.143 (Developer Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit)
OS: Linux - > Ubuntu 16.04.1 LTS 64 bit (Desktop environment ::: Gnome 3 (Gnome Shell version is 3.20.4))
MacOS -> Sierra 10.12
Firefox doesn’t have duplicate so I can’t check this error on Firefox
Note that it will work without snippet. We can put breakpoint straight in this tab source in any loop body.
All written above is true for any loop with more than one iteration. Example of code (You can put breakpoint 3, 13, 19, 25, 31, 47, 66)։
1. // Usually loop
2. for (var i = 0; i < 10; i++) {
3. console.log(i);
4. }
5.
6. // Loop on array
7.
8. var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
9.
10. console.log('Log ::: ', 'For');
11.
12. for (var i = 0; i < arr.length; i++) {
13. console.log(arr[i]);
14. }
15.
16. console.log('Log ::: ', 'For Each');
17.
18. arr.forEach(function(number, i, arr) {
19. console.log(number);
20. });
21.
22. console.log('Log ::: ', 'For Of');
23.
24. for (let number of arr) {
25. console.log(number);
26. }
27.
28. console.log('Log ::: ', 'For in');
29.
30. for(let key in arr) {
31. console.log(arr[key]);
32. }
33.
34. // Loop on object
35.
36. var user = {
37. name: 'Name',
38. lastname: 'LastName',
39. age: 23,
40. [Symbol.iterator]() {
41. let self = this;
42. let keys = Object.keys(this);
43. let length = keys.length;
44. let i = 0;
45. return {
46. next() {
47. if (i < length) {
48. i++;
49. return {
50. done: false,
51. value: self[keys[i-1]]
52. }
53. } else {
54. return {
55. done: true
56. }
57. }
58. }
59. }
60. }
61. }
62.
63. console.log('Log ::: ', 'Loop on object (for of)');
64.
65. for (let value of user) {
66. console.log(value);
67. }
,
Nov 18 2016
,
Nov 19 2016
At first I want to thank you for quick response. I have some more reports about chrome. There are some view-bugs that I noticed during my work. It was my first report, so I'll write the others also. Thank you.
,
Dec 2 2016
,
Oct 13 2017
I can reproduce it by running in console: debugger; debugger; debugger; Duplicate tab three times, each is unresponsible and then close all three, each tab will resume original tab.
,
Oct 16 2017
,
Sep 26
It looks like it works in latest Google Chrome Canary. Feel free to file another issue if it is still reproducible. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by l...@chromium.org
, Nov 18 2016Status: Assigned (was: Unconfirmed)
Summary: DevTools: duplicating a tab with a paused debugger creates an unresponsive duplicate (was: Chrome crashes during code debugging)