Bug 220108

Summary: Simulated Python crash during test runs
Product: WebKit Reporter: Dean Jackson <dino>
Component: Tools / TestsAssignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, cdumez, ews-watchlist, ggaren, glenn, jbedard, katherine_cheney, ryanhaddad, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=187270
Attachments:
Description Flags
Patch
none
Patch none

Description Dean Jackson 2020-12-22 16:08:39 PST
Seems to be related to https://bugs.webkit.org/show_bug.cgi?id=187270

When I run-webkit-tests long enough, I get a lot of Python (simulated) crashes.

Python[58104]: unlink: 'observations.db-wal' guarded by com.apple.WebKit[58126] (0x8fd4dbfade2dead)


Process:               Python [58124]
Path:                  /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Identifier:            Python
Version:               2.7.16 (2.7.16)
Build Info:            python-136060002000001~1
Code Type:             X86-64 (Native)
Parent Process:        Python [57992]
Responsible:           Terminal [13029]
User ID:               501

Date/Time:             2020-12-23 11:06:58.300 +1100
OS Version:            macOS 11.3 (20E147)
Report Version:        12
Bridge OS Version:     5.0 (18P4149)
Anonymous UUID:        C729D507-17A9-EEE1-9174-B0F1EEC1411A


Time Awake Since Boot: 1200000 seconds

System Integrity Protection: disabled

Crashed Thread:        0

Exception Type:        EXC_GUARD
Exception Codes:       0x800000040000e322, 0x08fd4dbfade2dead
Exception Subtype:     GUARD_TYPE_VN, id=0x08fd4dbfade2dead, pid=58146, flavor=0x00000004 (VNG_UNLINK)
Exception Note:        SIMULATED (this is NOT a crash)

Termination Reason:    Namespace <0x17>, Code 0x1
Termination Details:   <0x17>, /private/var/folders/6f/chyryk8d7cjdt4pln4rqyv780000gn/T/WebKitTestRunners-4B4P3U/ResourceLoadStatistics/735734988/observations.db-wal

Application Specific Information:
crashed on child side of fork pre-exec

Thread 0 Crashed:
0   libsystem_kernel.dylib        	0x00007fff2045cace __unlink + 10
1   libsystem_kernel.dylib        	0x00007fff2045cab0 unlink + 11
2   org.python.python             	0x000000010d7dc3d0 0x10d71f000 + 775120
3   org.python.python             	0x000000010d7a877c PyEval_EvalFrameEx + 20840
4   org.python.python             	0x000000010d7a3009 PyEval_EvalCodeEx + 533
5   org.python.python             	0x000000010d7ada51 0x10d71f000 + 584273
6   org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
7   org.python.python             	0x000000010d7a3009 PyEval_EvalCodeEx + 533
8   org.python.python             	0x000000010d7ada51 0x10d71f000 + 584273
9   org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
10  org.python.python             	0x000000010d7a3009 PyEval_EvalCodeEx + 533
11  org.python.python             	0x000000010d7ada51 0x10d71f000 + 584273
12  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
13  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
14  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
15  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
16  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
17  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
18  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
19  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
20  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
21  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
22  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
23  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
24  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
25  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
26  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
27  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
28  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
29  org.python.python             	0x000000010d7a3009 PyEval_EvalCodeEx + 533
30  org.python.python             	0x000000010d749f8e 0x10d71f000 + 176014
31  org.python.python             	0x000000010d72c55e PyObject_Call + 97
32  org.python.python             	0x000000010d736e3c 0x10d71f000 + 97852
33  org.python.python             	0x000000010d72c55e PyObject_Call + 97
34  org.python.python             	0x000000010d77283f 0x10d71f000 + 342079
35  org.python.python             	0x000000010d76fa52 0x10d71f000 + 330322
36  org.python.python             	0x000000010d72c55e PyObject_Call + 97
37  org.python.python             	0x000000010d7a876a PyEval_EvalFrameEx + 20822
38  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
39  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
40  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
41  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
42  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
43  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
44  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
45  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
46  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
47  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
48  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
49  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
50  org.python.python             	0x000000010d7a3009 PyEval_EvalCodeEx + 533
51  org.python.python             	0x000000010d7ada51 0x10d71f000 + 584273
52  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
53  org.python.python             	0x000000010d7a3009 PyEval_EvalCodeEx + 533
54  org.python.python             	0x000000010d7ada51 0x10d71f000 + 584273
55  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
56  org.python.python             	0x000000010d7a3009 PyEval_EvalCodeEx + 533
57  org.python.python             	0x000000010d7ada51 0x10d71f000 + 584273
58  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
59  org.python.python             	0x000000010d7a3009 PyEval_EvalCodeEx + 533
60  org.python.python             	0x000000010d7ada51 0x10d71f000 + 584273
61  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
62  org.python.python             	0x000000010d7a3009 PyEval_EvalCodeEx + 533
63  org.python.python             	0x000000010d7ada51 0x10d71f000 + 584273
64  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
65  org.python.python             	0x000000010d7a3009 PyEval_EvalCodeEx + 533
66  org.python.python             	0x000000010d7a2dee PyEval_EvalCode + 32
67  org.python.python             	0x000000010d7c5e6c 0x10d71f000 + 683628
68  org.python.python             	0x000000010d7c5f13 PyRun_FileExFlags + 130
69  org.python.python             	0x000000010d7c5a99 PyRun_SimpleFileExFlags + 690
70  org.python.python             	0x000000010d7d73dc Py_Main + 3208
71  libdyld.dylib                 	0x00007fff204aa539 start + 1

Thread 1:
0   libsystem_kernel.dylib        	0x00007fff2045c472 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff2048eea1 _pthread_cond_wait + 1298
2   org.python.python             	0x000000010d7d5400 PyThread_acquire_lock + 72
3   org.python.python             	0x000000010d7d9675 0x10d71f000 + 763509
4   org.python.python             	0x000000010d7a877c PyEval_EvalFrameEx + 20840
5   org.python.python             	0x000000010d7a3009 PyEval_EvalCodeEx + 533
6   org.python.python             	0x000000010d7ada51 0x10d71f000 + 584273
7   org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
8   org.python.python             	0x000000010d7a3009 PyEval_EvalCodeEx + 533
9   org.python.python             	0x000000010d749f8e 0x10d71f000 + 176014
10  org.python.python             	0x000000010d72c55e PyObject_Call + 97
11  org.python.python             	0x000000010d7a8ead PyEval_EvalFrameEx + 22681
12  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
13  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
14  org.python.python             	0x000000010d7ad9f7 0x10d71f000 + 584183
15  org.python.python             	0x000000010d7a868d PyEval_EvalFrameEx + 20601
16  org.python.python             	0x000000010d7a3009 PyEval_EvalCodeEx + 533
17  org.python.python             	0x000000010d749f8e 0x10d71f000 + 176014
18  org.python.python             	0x000000010d72c55e PyObject_Call + 97
19  org.python.python             	0x000000010d736e3c 0x10d71f000 + 97852
20  org.python.python             	0x000000010d72c55e PyObject_Call + 97
21  org.python.python             	0x000000010d7ad392 PyEval_CallObjectWithKeywords + 159
22  org.python.python             	0x000000010d7d94ce 0x10d71f000 + 763086
23  org.python.python             	0x000000010d7d526e 0x10d71f000 + 746094
24  libsystem_pthread.dylib       	0x00007fff2048e954 _pthread_start + 224
25  libsystem_pthread.dylib       	0x00007fff2048a4a7 thread_start + 15

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x000000000200000a  rbx: 0x0000000000000000  rcx: 0x00007ffee24ef0d8  rdx: 0x00001e0000001e00
  rdi: 0x00007fb1ce504110  rsi: 0x000000000007be00  rbp: 0x00007ffee24ef0f0  rsp: 0x00007ffee24ef0d8
   r8: 0x000000000007be00   r9: 0x0007be010007be00  r10: 0x0000000000000000  r11: 0x0000000000000206
  r12: 0x00007fb1ce604400  r13: 0x00007fb1ce604408  r14: 0x00007fb21c406ef0  r15: 0x000000010fed6d50
  rip: 0x00007fff2045cace  rfl: 0x0000000000000206  cr2: 0x00007fb1d980d7fc
  
Logical CPU:     0
Error Code:      0x0200000a
Trap Number:     133

Thread 0 instruction stream not available.

Thread 0 last branch register state not available.
Comment 1 Dean Jackson 2020-12-22 16:34:59 PST
Looks like Tools/Scripts/webkitpy/port/driver.py
should add ~/Library/WebKit to its SQLITE_EXEMPT_PATH_FROM_VNODE_GUARDS

But I'm not sure if that variable can take multiple paths.
Comment 2 Dean Jackson 2020-12-22 16:39:17 PST
Seems not:

> Processes can now set SQLITE_EXEMPT_PATH_FROM_VNODE_GUARDS in their environment to have that path exempted from vnode guards.

> Note that (for now, at least) the path is matched exactly; SQLite does not attempt to resolve symbolic links or '..'
Comment 3 Radar WebKit Bug Importer 2020-12-22 16:43:55 PST
<rdar://problem/72605338>
Comment 4 Dean Jackson 2020-12-22 16:46:41 PST
Created attachment 416697 [details]
Patch
Comment 5 Dean Jackson 2020-12-22 17:56:18 PST
Created attachment 416700 [details]
Patch
Comment 6 Geoffrey Garen 2020-12-22 19:49:53 PST
Comment on attachment 416700 [details]
Patch

r=me
Comment 7 EWS 2020-12-23 10:51:32 PST
Committed r271071: <https://trac.webkit.org/changeset/271071>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 416700 [details].