Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Borrow hazard during Response::finish #24117

Open
jdm opened this issue Aug 30, 2019 · 2 comments · May be fixed by #24069
Open

Borrow hazard during Response::finish #24117

jdm opened this issue Aug 30, 2019 · 2 comments · May be fixed by #24069

Comments

@jdm
Copy link
Member

@jdm jdm commented Aug 30, 2019

26:07.08 pid:99319 Full command: /Users/worker/tasks/task_1567196401/repo/target/release/servo --hard-fail -u Servo/wptrunner -Z replace-surrogates -z http://web-platform.test:8000/xhr/overridemimetype-blob.html --user-stylesheet /Users/worker/tasks/task_1567196401/repo/resources/ahem.css --certificate-path /Users/worker/tasks/task_1567196401/repo/tests/wpt/web-platform-tests/tools/certs/cacert.pem --pref=js.mem.gc.zeal.level=2 --pref=js.mem.gc.zeal.frequency=10
pid:99319 
27:15.17 pid:99319 DomRefCell<T> already mutably borrowed: BorrowError (thread ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(1) }, at src/libcore/result.rs:1084)
27:15.32 pid:99319 stack backtrace:
27:15.32 pid:99319    0: __ZN9backtrace9backtrace5trace17hc4a0d1f273e07024E (0x10a73123b)
27:15.32 pid:99319    1: __ZN9backtrace7capture9Backtrace3new17h765760e39b281a50E (0x10a730427)
27:15.32 pid:99319    2: __ZN5servo4main28_$u7b$$u7b$closure$u7d$$u7d$17h510947304905906eE (0x106e9393b)
27:15.32 pid:99319    3: __ZN3std9panicking20rust_panic_with_hook17h099fe3773ce1a793E (0x10a8bd301)
27:15.32 pid:99319    4: __ZN3std9panicking18continue_panic_fmt17h8a4b76634870b383E (0x10a8bcd6c)
27:15.32 pid:99319    5: _rust_begin_unwind (0x10a8bcc68)
27:15.32 pid:99319    6: __ZN4core9panicking9panic_fmt17h885799c19d2b8b0cE (0x10a8dd49e)
27:15.32 pid:99319    7: __ZN4core6result13unwrap_failed17h91161a3faccc6622E (0x10a8dd578)
27:15.32 pid:99319    8: __ZN110_$LT$script..dom..bindings..cell..DomRefCell$LT$T$GT$$u20$as$u20$script..dom..bindings..trace..JSTraceable$GT$5trace17h9797e02ad9957a99E (0x1074bc1c4)
27:15.32 pid:99319    9: ___rust_maybe_catch_panic (0x10a8c569e)
27:15.32 pid:99319   10: __ZN6script3dom8bindings7codegen8Bindings15ResponseBinding15ResponseBinding6_trace17h1e307327fc13c2faE (0x107c8b0b7)
27:15.32 pid:99319   11: __ZNK2js5Class7doTraceEP8JSTracerP8JSObject (0x10888c09b)
27:15.32 pid:99319   12: __ZL13CallTraceHookIZN2js8GCMarker19processMarkStackTopERNS0_11SliceBudgetEEUlT_E_EPNS0_12NativeObjectEOS4_P8JSTracerP8JSObject15CheckGeneration (0x108b1ca43)
27:15.33 pid:99319   13: __ZN2js8GCMarker19processMarkStackTopERNS_11SliceBudgetE (0x108ad538f)
27:15.33 pid:99319   14: __ZN2js8GCMarker24markUntilBudgetExhaustedERNS_11SliceBudgetE (0x108ab95f4)
27:15.33 pid:99319   15: __ZN2js2gc9GCRuntime24markUntilBudgetExhaustedERNS_11SliceBudgetENS_7gcstats9PhaseKindE (0x108ab63a5)
27:15.33 pid:99319   16: __ZN2js2gc9GCRuntime16incrementalSliceERNS_11SliceBudgetEN2JS8GCReasonERNS0_13AutoGCSessionE (0x108abe623)
27:15.33 pid:99319   17: __ZN2js2gc9GCRuntime7gcCycleEbNS_11SliceBudgetEN2JS8GCReasonE (0x108ac02f2)
27:15.33 pid:99319   18: __ZN2js2gc9GCRuntime7collectEbNS_11SliceBudgetEN2JS8GCReasonE (0x108ac19a3)
27:15.33 pid:99319   19: __ZN2js2gc9GCRuntime2gcE18JSGCInvocationKindN2JS8GCReasonE (0x108a8b176)
27:15.33 pid:99319   20: __ZN2js2gc9GCRuntime10runDebugGCEv (0x108a8aef4)
27:15.33 pid:99319   21: __ZN2js2gc9GCRuntime22gcIfNeededAtAllocationEP9JSContext (0x108a8a865)
27:15.33 pid:99319   22: __ZN2js2gc9GCRuntime19checkAllocatorStateILNS_7AllowGCE1EEEbP9JSContextNS0_9AllocKindE (0x108a85eb1)
27:15.33 pid:99319   23: __ZN2js18AllocateStringImplI17JSFatInlineStringLNS_7AllowGCE1EEEPT_P9JSContextNS_2gc11InitialHeapE (0x108a86c06)
27:15.33 pid:99319   24: __ZN2js14AllocateStringI17JSFatInlineStringLNS_7AllowGCE1EEEPT_P9JSContextNS_2gc11InitialHeapE (0x1088f9e0e)
27:15.33 pid:99319   25: __ZN17JSFatInlineString4new_ILN2js7AllowGCE1EEEPS_P9JSContext (0x1088f9ce6)
27:15.33 pid:99319   26: __ZN2jsL20AllocateInlineStringILNS_7AllowGCE1EhEEP14JSInlineStringP9JSContextmPPT0_ (0x108684c0f)
27:15.33 pid:99319   27: __ZL23NewInlineStringDeflatedILN2js7AllowGCE1EEP14JSInlineStringP9JSContextN7mozilla5RangeIKDsEE (0x10868b431)
27:15.33 pid:99319   28: __ZL17NewStringDeflatedILN2js7AllowGCE1EEP12JSFlatStringP9JSContextPKDsm (0x108689c3c)
27:15.33 pid:99319   29: __ZN2js14NewStringCopyNILNS_7AllowGCE1EDsEEP12JSFlatStringP9JSContextPKT0_m (0x10868adce)
27:15.33 pid:99319   30: __ZN2js10JSONParserIDsE10readStringILNS_14JSONParserBase10StringTypeE1EEENS3_5TokenEv (0x1084a11b7)
27:15.33 pid:99319   31: __ZN2js10JSONParserIDsE7advanceEv (0x10849f79a)
27:15.33 pid:99319   32: __ZN2js10JSONParserIDsE5parseEN2JS13MutableHandleINS2_5ValueEEE (0x10849e5b2)
27:15.34 pid:99319   33: __ZN2js27MutableWrappedPtrOperationsINS_10JSONParserIDsEEN2JS6RootedIS2_EEE5parseENS3_13MutableHandleINS3_5ValueEEE (0x1082a5cfd)
27:15.34 pid:99319   34: __ZN2js20ParseJSONWithReviverIDsEEbP9JSContextN7mozilla5RangeIKT_EEN2JS6HandleINS8_5ValueEEENS8_13MutableHandleISA_EE (0x1082b8709)
27:15.34 pid:99319   35: __Z12JS_ParseJSONP9JSContextPKDsjN2JS13MutableHandleINS3_5ValueEEE (0x10886e033)
27:15.34 pid:99319   36: __ZN6script4body23run_json_data_algorithm17hf534158dfe76a0bfE (0x107974819)
27:15.34 pid:99319   37: __ZN6script4body25consume_body_with_promise17hb298939f1da61fe9E (0x1079738c8)
27:15.34 pid:99319   38: __ZN6script3dom8response8Response6finish17h8d0100192c012cc3E (0x107d0600a)
27:15.34 pid:99319   39: __ZN81_$LT$script..fetch..FetchContext$u20$as$u20$net_traits..FetchResponseListener$GT$20process_response_eof17h2a62f33273c3c37bE (0x107b74338)
27:15.34 pid:99319   40: __ZN76_$LT$net_traits..FetchResponseMsg$u20$as$u20$net_traits..Action$LT$T$GT$$GT$7process17h5a61201b1a7b0b55E (0x107f85d0b)
27:15.34 pid:99319   41: __ZN101_$LT$script..network_listener..ListenerTask$LT$A$C$Listener$GT$$u20$as$u20$script..task..TaskOnce$GT$8run_once17h85af352354819a3cE (0x107e1943c)
27:15.34 pid:99319   42: __ZN43_$LT$T$u20$as$u20$script..task..TaskBox$GT$7run_box17h1fbddac42b7cdce0E (0x107fa9d1e)
27:15.34 pid:99319   43: __ZN6script13script_thread12ScriptThread22handle_msg_from_script17h9e03eb14b1d6d27aE (0x107b85f27)
27:15.34 pid:99319   44: __ZN6script13script_thread12ScriptThread11handle_msgs17h689a61696977da24E.llvm.1967242945246974025 (0x107b7dd4b)
27:15.34 pid:99319   45: __ZN14profile_traits3mem12ProfilerChan25run_with_memory_reporting17h7b6e9bd38e1ab8feE (0x107cb0ea7)
27:15.34 pid:99319   46: __ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17he46720d101a3e6efE (0x107f5e47b)
27:15.34 pid:99319   47: __ZN3std9panicking3try7do_call17h5f1d988e7dc73db4E.llvm.16932765531113996662 (0x10742b6aa)
27:15.34 pid:99319   48: ___rust_maybe_catch_panic (0x10a8c569e)
27:15.34 pid:99319   49: __ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17hc92a2538c3cac723E (0x107667bf5)
27:15.34 pid:99319   50: __ZN83_$LT$alloc..boxed..Box$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$9call_once17hb03304ace7f89c63E (0x10a8aca2d)
27:15.34 pid:99319   51: __ZN3std3sys4unix6thread6Thread3new12thread_start17hd2d570f25bb299f3E (0x10a8c4bcd)
27:15.34 pid:99319   52: __pthread_body (0x7fff63578660)
27:15.34 pid:99319   53: __pthread_start (0x7fff6357850c)
@jdm jdm linked a pull request that will close this issue Aug 31, 2019
bors-servo added a commit that referenced this issue Aug 31, 2019
[WIP] Add debugmozjs CI task

Fixes #24115. Fixes #24117. Fixes #24118. Fixes #24116.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24069)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Aug 31, 2019
[WIP] Add debugmozjs CI task

Fixes #24115. Fixes #24117. Fixes #24118. Fixes #24116.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24069)
<!-- Reviewable:end -->
@gterzian
Copy link
Member

@gterzian gterzian commented Sep 2, 2019

This can probably be fixed by flattening the below call, so that self.body_promise is not borrowed while running consume_body_with_promise:

if let Some((p, body_type)) = self.body_promise.borrow_mut().take() {

@gterzian
Copy link
Member

@gterzian gterzian commented Sep 2, 2019

@jdm Ah you fixed all those already...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.