kenz-gelsoft / gecko-dev

Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/setup/index.html
Other
16 stars 2 forks source link

Investigate TestUDPSocket.TestUDPSocketMain failure #47

Open kenz-gelsoft opened 1 month ago

kenz-gelsoft commented 1 month ago

TestUDPSocket.TestUDPSocketMain

 0:05.94 /boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/firefox -unittest --gtest_death_test_style=threadsafe
[158684, Unnamed thread 1182baa3b020] WARNING: XPCOM object StringBuffer addrefed from static ctor/dtor: file /boot/home/src/gecko-dev/xpcom/base/nsTraceRefcnt.cpp:216
[158684, Unnamed thread 1182baa3b020] WARNING: XPCOM object StringBuffer addrefed from static ctor/dtor: file /boot/home/src/gecko-dev/xpcom/base/nsTraceRefcnt.cpp:216
[158684, Unnamed thread 1182baa3b020] WARNING: XPCOM object StringBuffer addrefed from static ctor/dtor: file /boot/home/src/gecko-dev/xpcom/base/nsTraceRefcnt.cpp:216
[158684, Unnamed thread 1182baa3b020] WARNING: XPCOM object StringBuffer addrefed from static ctor/dtor: file /boot/home/src/gecko-dev/xpcom/base/nsTraceRefcnt.cpp:216
[158684, Unnamed thread 1182baa3b020] WARNING: XPCOM object StringBuffer addrefed from static ctor/dtor: file /boot/home/src/gecko-dev/xpcom/base/nsTraceRefcnt.cpp:216
[158684, Unnamed thread 1182baa3b020] WARNING: XPCOM object StringBuffer addrefed from static ctor/dtor: file /boot/home/src/gecko-dev/xpcom/base/nsTraceRefcnt.cpp:216
*** You are running in headless mode.
Running GTest tests...
Note: Google Test filter = TestUDPSocket.TestUDPSocketMain
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from TestUDPSocket
[ RUN      ] TestUDPSocket.TestUDPSocketMain
[Parent 158684, Main Thread] WARNING: Failed to connect to client: Could not connect: No such file or directory
: file /boot/home/src/gecko-dev/widget/gtk/nsAppShell.cpp:262
[Parent 158684, Main Thread] WARNING: Failed to connect to client: Could not connect: No such file or directory
: file /boot/home/src/gecko-dev/widget/gtk/nsAppShell.cpp:262
Couldn't convert chrome URL: chrome://branding/locale/brand.properties
[Parent 158684, Main Thread] WARNING: Could not get the program name for a cubeb stream.: 'NS_SUCCEEDED(rv)', file /boot/home/src/gecko-dev/dom/media/CubebUtils.cpp:467
Joining multicast group
Multicast ping timeout expired
/boot/home/src/gecko-dev/netwerk/test/gtest/TestUDPSocket.cpp:334: Failure
Expected: (timerCb->mResult) succeeds.
  Actual: NS_ERROR_FAILURE

[  FAILED  ] TestUDPSocket.TestUDPSocketMain (2005 ms)
[----------] 1 test from TestUDPSocket (2005 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (2005 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] TestUDPSocket.TestUDPSocketMain

 1 FAILED TEST
[158684] Assertion failure: mPending, at /boot/home/src/gecko-dev/netwerk/test/gtest/TestCommon.h:36

It's not intuitive, but DBus connection error could cause IPC failure?

void nsAppShell::DBusConnectClientResponse(GObject* aObject,
                                           GAsyncResult* aResult,
                                           gpointer aUserData) {
  GUniquePtr<GError> error;
  RefPtr<GDBusProxy> proxyClient =
      dont_AddRef(g_dbus_proxy_new_finish(aResult, getter_Transfers(error)));
  if (!proxyClient) {
    if (!IsCancelledGError(error.get())) {
      NS_WARNING(
          nsPrintfCString("Failed to connect to client: %s\n", error->message)
              .get());
    }
    return;
  }

  RefPtr self = static_cast<nsAppShell*>(aUserData);
  if (!strcmp(g_dbus_proxy_get_name(proxyClient), "org.freedesktop.login1")) {
    self->mLogin1Proxy = std::move(proxyClient);
    g_signal_connect(self->mLogin1Proxy, "g-signal",
                     G_CALLBACK(DBusSessionSleepCallback), self);
  } else {
    self->mTimedate1Proxy = std::move(proxyClient);
    g_signal_connect(self->mTimedate1Proxy, "g-signal",
                     G_CALLBACK(DBusTimedatePropertiesChangedCallback), self);
  }
}
kenz-gelsoft commented 1 month ago

Maybe we can test with -no-remote option whether remoting protocol affects to current problem or not.

I bet this has nothing to do with early tab crashes.

kenz-gelsoft commented 1 month ago

freedesktop specific code

https://searchfox.org/mozilla-esr128/source/widget/gtk/nsAppShell.cpp#279

kenz-gelsoft commented 1 month ago

Maybe we can test with -no-remote option whether remoting protocol affects to current problem or not.

we already specified that implicitly when we do ./mach run:

~/src/gecko-dev> ./mach run
 0:00.31 /boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/firefox -no-remote -profile /boot/home/src/gecko-dev/obj-ff-dbg/tmp/profile-default
kenz-gelsoft commented 1 month ago

Try disabling forcibly. This changes build configuration, so takes hours to rebuild.

~/src/gecko-dev> git diff toolkit/moz.configure
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
index a424446c7d44..0f951fe5d466 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -2624,6 +2624,7 @@ with only_when(compile_environment & target_is_windows):

 @depends(toolkit)
 def has_remote(toolkit):
+    return False
     if toolkit in ("gtk", "windows", "cocoa"):
         return True
kenz-gelsoft commented 1 month ago

It was not easy to disable remoting protocol. Will try another approach, or investigate other failure first.

kenz-gelsoft commented 1 month ago

waiter

https://searchfox.org/mozilla-esr128/source/netwerk/test/gtest/TestCommon.h#19

fails around this

https://searchfox.org/mozilla-esr128/source/netwerk/test/gtest/TestUDPSocket.cpp#313

kenz-gelsoft commented 1 month ago

Infomative to me

https://stackoverflow.com/a/10260885