Running WPT tests with /home/user/Desktop/servo/target/release/servo
Running 1 tests in web-platform-tests
This GDB supports auto-downloading debuginfo from the following URLs:
<https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n]) [answered N; input not from terminal]
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after vfork from child process 240167]
[Detaching after vfork from child process 240169]
[Detaching after vfork from child process 240175]
[New Thread 0x7fffea3ff6c0 (LWP 240176)]
[New Thread 0x7fffe9bfe6c0 (LWP 240177)]
[New Thread 0x7fffe93fd6c0 (LWP 240179)]
[New Thread 0x7fffe8bfc6c0 (LWP 240180)]
[New Thread 0x7fffdbdff6c0 (LWP 240181)]
[New Thread 0x7fffdb5fe6c0 (LWP 240182)]
[New Thread 0x7fffdabfd6c0 (LWP 240183)]
[Thread 0x7fffdabfd6c0 (LWP 240183) exited]
[New Thread 0x7fffdabfd6c0 (LWP 240184)]
[New Thread 0x7fffda3ff6c0 (LWP 240188)]
[New Thread 0x7fffda1fe6c0 (LWP 240191)]
[New Thread 0x7fffd9ffd6c0 (LWP 240195)]
[New Thread 0x7fffd987c6c0 (LWP 240196)]
[New Thread 0x7fffd967b6c0 (LWP 240197)]
[New Thread 0x7fffd947a6c0 (LWP 240198)]
[New Thread 0x7fffd8fff6c0 (LWP 240199)]
[New Thread 0x7fffaffff6c0 (LWP 240200)]
[New Thread 0x7fffafdfe6c0 (LWP 240201)]
[New Thread 0x7fffaefff6c0 (LWP 240202)]
[New Thread 0x7fffaebfe6c0 (LWP 240203)]
[New Thread 0x7fffadfff6c0 (LWP 240204)]
[Thread 0x7fffadfff6c0 (LWP 240204) exited]
[New Thread 0x7fffadfff6c0 (LWP 240205)]
[New Thread 0x7fffad3ff6c0 (LWP 240206)]
[New Thread 0x7fffac9ff6c0 (LWP 240207)]
[New Thread 0x7fffac7fe6c0 (LWP 240208)]
[New Thread 0x7fff8bfff6c0 (LWP 240209)]
[New Thread 0x7fff83fff6c0 (LWP 240210)]
[New Thread 0x7fff8b7ff6c0 (LWP 240211)]
[New Thread 0x7fff8b5fe6c0 (LWP 240212)]
[New Thread 0x7fff8afff6c0 (LWP 240213)]
[New Thread 0x7fff8a3fe6c0 (LWP 240214)]
[New Thread 0x7fff8a5ff6c0 (LWP 240215)]
[New Thread 0x7fff899ff6c0 (LWP 240216)]
[New Thread 0x7fff88dff6c0 (LWP 240217)]
[New Thread 0x7fff83bfd6c0 (LWP 240219)]
[New Thread 0x7fff83dfe6c0 (LWP 240218)]
[New Thread 0x7fff831ff6c0 (LWP 240220)]
[New Thread 0x7fff829ff6c0 (LWP 240221)]
[New Thread 0x7fff825fe6c0 (LWP 240222)]
[New Thread 0x7fff81fff6c0 (LWP 240223)]
[New Thread 0x7fff811ff6c0 (LWP 240224)]
[New Thread 0x7fff80bff6c0 (LWP 240225)]
[New Thread 0x7fff803ff6c0 (LWP 240226)]
[New Thread 0x7fff7bbff6c0 (LWP 240227)]
[New Thread 0x7fff7b3ff6c0 (LWP 240228)]
[New Thread 0x7fff78fff6c0 (LWP 240229)]
[New Thread 0x7fff78dfe6c0 (LWP 240230)]
[Thread 0x7fffd987c6c0 (LWP 240196) exited]
[New Thread 0x7fffd987c6c0 (LWP 240231)]
[New Thread 0x7fff73fff6c0 (LWP 240232)]
[New Thread 0x7fffd8bfe6c0 (LWP 240233)]
[New Thread 0x7fffad7fe6c0 (LWP 240234)]
[New Thread 0x7fffacffe6c0 (LWP 240235)]
[New Thread 0x7fff8bdfe6c0 (LWP 240236)]
[New Thread 0x7fff8abfe6c0 (LWP 240237)]
[New Thread 0x7fff895fe6c0 (LWP 240238)]
[New Thread 0x7fff889fe6c0 (LWP 240239)]
[New Thread 0x7fff82dfe6c0 (LWP 240240)]
[New Thread 0x7fff706ff6c0 (LWP 240241)]
[New Thread 0x7fff704fe6c0 (LWP 240242)]
[New Thread 0x7fff702fd6c0 (LWP 240243)]
[New Thread 0x7fff615ff6c0 (LWP 240244)]
[New Thread 0x7fff613fe6c0 (LWP 240245)]
[New Thread 0x7fff611fd6c0 (LWP 240246)]
[New Thread 0x7fff60ffc6c0 (LWP 240247)]
[New Thread 0x7fff60dfb6c0 (LWP 240248)]
[New Thread 0x7fff60bfa6c0 (LWP 240249)]
[New Thread 0x7fff609f96c0 (LWP 240250)]
[New Thread 0x7fff607f86c0 (LWP 240251)]
[New Thread 0x7fff605f76c0 (LWP 240252)]
[New Thread 0x7fff603f66c0 (LWP 240253)]
[New Thread 0x7ffeebfff6c0 (LWP 240254)]
[New Thread 0x7ffeebdfe6c0 (LWP 240255)]
[New Thread 0x7ffeebbfd6c0 (LWP 240256)]
[New Thread 0x7fffae9766c0 (LWP 240262)]
[New Thread 0x7fffae8f56c0 (LWP 240263)]
[New Thread 0x7fffac5fd6c0 (LWP 240264)]
Thread 48 "Script(1,1)" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd987c6c0 (LWP 240231)]
0x0000555559593cc1 in hashbrown::map::HashMap<K,V,S,A>::insert ()
#0 0x0000555559593cc1 in hashbrown::map::HashMap<K,V,S,A>::insert ()
#1 0x00005555596036db in script::script_module::ModuleTree::find_first_parse_error ()
#2 0x0000555559603a99 in script::script_module::ModuleTree::find_first_parse_error ()
#3 0x0000555559603a99 in script::script_module::ModuleTree::find_first_parse_error ()
#4 0x0000555559603a99 in script::script_module::ModuleTree::find_first_parse_error ()
#5 0x0000555559603a99 in script::script_module::ModuleTree::find_first_parse_error ()
#6 0x0000555559603a99 in script::script_module::ModuleTree::find_first_parse_error ()
#7 0x0000555559603a99 in script::script_module::ModuleTree::find_first_parse_error ()
#8 0x0000555559603a99 in script::script_module::ModuleTree::find_first_parse_error ()
#9 0x0000555559603a99 in script::script_module::ModuleTree::find_first_parse_error ()
#10 0x000055555960590b in script::script_module::ModuleTree::advance_finished_and_link ()
---------------------- ommited -----------------------------------
#7543 0x0000555559605851 in script::script_module::ModuleTree::advance_finished_and_link ()
#7544 0x00005555596050a8 in script::script_module::ModuleTree::fetch_module_descendants ()
#7545 0x0000555559608c19 in <script::script_module::ModuleContext as net_traits::FetchResponseListener>::process_response_eof ()
#7546 0x000055555993b474 in <net_traits::FetchResponseMsg as net_traits::Action<T>>::process ()
#7547 0x000055555960011a in <script::network_listener::ListenerTask<A,Listener> as script::task::TaskOnce>::run_once ()
#7548 0x0000555558f9ad2b in <T as script::task::TaskBox>::run_box ()
#7549 0x000055555942f0a0 in script::script_thread::ScriptThread::handle_msg_from_script ()
#7550 0x00005555594271bf in script::script_thread::ScriptThread::handle_msgs::{{closure}} ()
#7551 0x0000555559423f04 in script::script_thread::ScriptThread::handle_msgs ()
#7552 0x000055555941de80 in script::script_thread::ScriptThread::start ()
#7553 0x0000555558f5b8ff in profile_traits::mem::ProfilerChan::run_with_memory_reporting ()
#7554 0x0000555558fe2ee6 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#7555 0x0000555558fe84a2 in core::ops::function::FnOnce::call_once{{vtable.shim}} ()
#7556 0x000055555bc07075 in alloc::boxed::{impl#47}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2007
#7557 alloc::boxed::{impl#47}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> () at library/alloc/src/boxed.rs:2007
#7558 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108
#7559 0x00007ffff6c97b5a in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:444
#7560 0x00007ffff6d285fc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
▶ TIMEOUT [expected ERROR] /_webgpu/webgpu/cts.https.html?q=webgpu:shader,execution,expression,call,builtin,dot:f32_vec4:*
Ran 1 tests finished in 9.4 seconds.
• 0 ran as expected. 0 tests skipped.
• 1 tests timed out unexpectedly
Tests with unexpected results:
▶ TIMEOUT [expected ERROR] /_webgpu/webgpu/cts.https.html?q=webgpu:shader,execution,expression,call,builtin,dot:f32_vec4:*
I can try looking into this this weekend. Per spec, I did a quick check and I think it’s already updated and the algorithm of
find first parse errordoesn’t exist anymore. I will also check if we can fix the spec update to solve this issue as well.@sagudev sorry for missing to update with you 🙏 I had an in-progress patch locally to remove the recursive call though, it’s still buggy around propagating errors. I will try to work on it and update more here (possibly with a PR when it passes more tests) 🙇
I recalled https://github.com/servo/servo/issues/26903 which should be related to the issue what we’d like to fix here.
OH, some more observation sharing: so, the
mAwaitingImportswould be decremented in this function: https://searchfox.org/mozilla-central/rev/a39aed6c2042ba2fa5af779e8b97e8a3f660e480/js/loader/ModuleLoadRequest.cpp#240-250and the function would be triggered when the ModuleRequest is gc-ed (iiuc)
https://searchfox.org/mozilla-central/rev/a39aed6c2042ba2fa5af779e8b97e8a3f660e480/js/loader/ModuleLoadRequest.cpp#28-37
I see. Thank you!
iirc, if we only do a zero checking (which we have
incomplete_fetch_urlsfor the same purpose), modules sometimes could be instantiated wrongly. Or, possibly there are still some other difference between our impl and Gecko’s impl. Let me check it carefully 🙏After quickly skimming at code I think
DependenciesLoadedis not checker but more of an assert. It just verifies that all deps are loaded and do some post-steps after that, so it is supposed to be run after they are already loaded. You can also see this by the way it is called: https://searchfox.org/mozilla-central/source/js/loader/ModuleLoaderBase.cpp#955.But I might be wrong, as I only took a quick glance at code.
While reading through the Gecko implementation, I noticed they also need to check if dependencies are all fetched or not at
https://searchfox.org/mozilla-central/rev/a39aed6c2042ba2fa5af779e8b97e8a3f660e480/js/loader/ModuleLoadRequest.cpp#184-200
however, I don’t fully understand this part:
https://searchfox.org/mozilla-central/rev/a39aed6c2042ba2fa5af779e8b97e8a3f660e480/js/loader/ModuleLoadRequest.cpp#202-223
In this for-loop, is it run in a blocking way? or how does it work? if a child request is still fetching, I think
mModuleScriptis still an initial null pointer though, in that case, if this for-loop doesn’t wait for the request to be done, wouldn’t it break the checking? 🤔In the meanwhile, I also checked how WebKit implemented the logic of fetching modules with Promises so that it’s easier to handle cyclic dependencies than manual checking:
https://github.com/WebKit/WebKit/blob/d4c4d4bd1fcfb8bfee7f7a51333f8bebf5e0e369/Source/JavaScriptCore/builtins/ModuleLoader.js#L430-L434
and actually, when I implemented the
script_module, it was initially implemented withPromise.alltoo… but I changed it to manual dependencies status checking in https://github.com/servo/servo/pull/26395.With looking at the WebKit implementation, I start to think that maybe it’s worth trying moving the fetch mechanism for modules back to Promise.all so that it would be easier to maintain. I will try to experiment loading modules with Promise.all (again).
Thanks! as we don’t support worker script modules yet, let me share the DOM script modules here as well: https://searchfox.org/mozilla-central/source/dom/script/ModuleLoader.cpp#285
GECKO: https://searchfox.org/mozilla-central/source/dom/workers/loader/WorkerModuleLoader.h#28
Another spec mismatch is at https://html.spec.whatwg.org/multipage/#fetch-the-descendants-of-and-link-a-module-script. Currently, SpiderMonkey doesn’t provide such API for
LoadRequestedModulesso I will look into how Gecko implemented descendant fetches and align our implementation with Gecko first. (because, inadvance_finish_and_link, it contains another recursive call, I guess it could be another cause for the occasional crash)hmm, I’ve also tried to check it with
lsof -i :8889but there’s nothing.Let me try to clean and rebuild. I hope it will work.
Quick update: I’ve noticed the
find first parse erroralready became the step 8-1 of https://html.spec.whatwg.org/multipage/#creating-a-javascript-module-script so I will try to adapt current implementation to match it.Hm, I never got this. Maybe you are already running something on port 8889? I do not think we actually need ws for cts tests (actually we probably do not need it for any wpt test except for websocket tests).
./mach cleanis sometimes needed after new pull.I will look into this issue again today 🙏 but somehow after pulling latest main branch to my local, I ran into
Servers failed to start: wss:8889issue that it seems we had similar issue before in https://github.com/servo/servo/issues/20734 🤔 I will work on spec-update changes first and look into fixing this wpt error lately.I observed the same thing in https://github.com/servo/servo/issues/31397#issuecomment-1961802764 and later did further investigation in https://github.com/servo/servo/issues/31397#issuecomment-1979288715, I also did try to create minimal repro with cyclic deps, but it was all fruitless, so unfortunately webgpu tests are the best we have right now.
I am pretty confident that bringing us closer to spec should solve this issue, so thank you for doing the work.
The log is too long so I omitted most of them but basically before crashing it almost running into the endless loop for those cyclic modules… I think currently we don’t handle multiple cyclic modules properly and it results in crashing in the endless loop for multiple cyclic modules.
Yes! I following the instructions in https://github.com/servo/servo/issues/31397#issuecomment-1987158499 to add the launch.json for my VSCode though, somehow the debugger is not always attached on my editor 🤔 and when it’s attached, I couldn’t find stacktraces related to
script_module.If vscode lldb still doesn’t work for me, I may try
--debugger lldblater 🙏 Thank you!Great news.
What exactly does not work with debugger?
I posted some instructions for VSCode in https://github.com/servo/servo/issues/31397#issuecomment-1987158499, but you might need to change the path for the binary. There is also
--debugger lldboption you can use via mach.some progress update here:
I’m trying to get rid of the recursive find-first-parse-error locally, while the algorithm is not fully spec compliant yet, with adding following patch, I can already pass the WPT test more times and it needs more times to get the CRASH from
webgpu:shader,execution,expression,unary,i32_conversion:f16:*test.On the other hand, I’m still trying to use lldb to attach but it doesn’t work well on my local yet; I may be able to find more information when I can use debugger to debug 🙏
Open to check the patch
OH! Good catch! Thank you! The test is running expectedly on my local now; as I’m using zsh, I need to wrap the path with single quotes 👇
I may not have enough bandwidth to work on this during weekdays but I will share more progress here.
@sagudev Thanks for the tips! I’m going to look into the issue and I will ping you if I find any questions about testing it.
@CYBAI I did some cleanup on https://github.com/servo/servo/pull/31194, so you can base on it for your work and then rebase it on top of main. I usually built with
--production --with-asanand test with./mach test-wpt --production _webgpu/webgpu/cts.https.html?=webgpu:shader,execution,expression,unary,u32_conversion:u32:* --repeat-until-unexpectedwhich will rerun test until it crashes, which usually happens in 30 runs. If you need any help with testing, don’t hesitate to ping me.