Closed Bug 1688818 Opened 5 years ago Closed 4 years ago

firefox cannot work on headless mode. (Ubuntu OS)

Categories

(Core :: Widget: Gtk, defect)

Firefox 84
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: smaLL_guan, Unassigned, NeedInfo)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36

Steps to reproduce:

firefox cannot work on headless mode.

$ uname -a
Linux ubuntu 5.8.0-41-generic #46~20.04.1-Ubuntu SMP Mon Jan 18 17:52:23 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ firefox -v
Mozilla Firefox 84.0.2
$ firefox --headless www.google.com
*** You are running in headless mode.
*** You are running in headless mode.

(firefox:16360): GLib-GObject-WARNING **: 23:39:03.135: invalid (NULL) pointer instance

(firefox:16360): GLib-GObject-CRITICAL **: 23:39:03.135: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

Actual results:

firefox cannot work on headless mode.

Expected results:

firefox can work on headless mode.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

I think the messages:

(firefox:16360): GLib-GObject-WARNING **: 23:39:03.135: invalid (NULL) pointer instance
(firefox:16360): GLib-GObject-CRITICAL **: 23:39:03.135: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

are here even in non-headless mode. Why do you think the browser does not work? Does it crash or so?

Flags: needinfo?(smaLL_guan)

./b2g --headless -no-remote -marionette -profile ~/workspace/next/sidl/daemon/tmp-profile/
[9575, Unnamed thread 7f46a084f5e0] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /builds/kaios/gecko/xpcom/base/nsTraceRefcnt.cpp:202
[9575, Unnamed thread 7f46a084f5e0] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /builds/kaios/gecko/xpcom/base/nsTraceRefcnt.cpp:202
[9575, Unnamed thread 7f46a084f5e0] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /builds/kaios/gecko/xpcom/base/nsTraceRefcnt.cpp:202
[9575, Unnamed thread 7f46a084f5e0] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /builds/kaios/gecko/xpcom/base/nsTraceRefcnt.cpp:202
*** You are running in headless mode.
*** UTM:SVC TimerManager:registerTimer - timerID: xpi-signature-verification interval: 86400 skipFirst: false

(b2g:9575): GLib-GObject-WARNING **: 01:22:06.178: invalid (NULL) pointer instance

(b2g:9575): GLib-GObject-CRITICAL **: 01:22:06.179: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

Flags: needinfo?(stransky)

[App]
Vendor=B2GOS
Name=b2g
RemotingName=b2g
CodeName=B2G
Version=84.0.3
BuildID=20211123041140
ID={3c2e2abc-06d4-11e1-ac3b-374f68613e61}

The issue does not exist in newer version 96

(In reply to viga from comment #5)

The issue does not exist in newer version 96

Okay, let's close it then, thanks.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Flags: needinfo?(stransky)
Resolution: --- → WORKSFORME

But wait, we need to fix it in gecko84, is that possible?
My point is, should be easy for you to point out which patches are involved and we can cherry pick them to 84.

Flags: needinfo?(stransky)

Why do you need the fix in gecko 84? (a year old release).

Anyway, there's no way how to fix that on gecko 84 unless you create your own custom build.

You can use mozregression to find where it was fixed:
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems?rd=Bug_info_Firefox#Use_Mozregression_tool

Flags: needinfo?(stransky)

Also, you can run firefox with --g-fatal-warnings command line argument, get coredumps and fix the crashes. Or run that from gdb.
I guess the fixes are related to avoid X11 calls in headless mode (i.e. the IsX11Display()). When running on headless Displays() returns null for X11 display connection.

You need to log in before you can comment on or make changes to this bug.