You are not logged in.

#1 2014-09-13 01:40:14

saronno
Member
Registered: 2009-10-02
Posts: 194

[SOLVED] Firefox takes a lot of time to load ...

Since a couple of months I have this little annoying problem with firefox:
It takes 6/7 sec to start.

I use strace to see if I can find what the problem is, but sincerely I am not an expert.

Anyway, I find something interesting ... 

03:31:24.575495 mmap(0x7f2c5aa3d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 7, 0x4000) = 0x7f2c5aa3d000
03:31:24.575543 close(7)                = 0
03:31:24.575613 mprotect(0x7f2c5aa3d000, 4096, PROT_READ) = 0
03:31:24.575636 munmap(0x7f2c6e61a000, 216499) = 0
03:31:24.575712 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 7
03:31:24.575740 connect(7, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, 16) = 0
03:31:24.575793 poll([{fd=7, events=POLLOUT}], 1, 0) = 1 ([{fd=7, revents=POLLOUT}])
03:31:24.575828 sendto(7, "\202\257\1\0\0\1\0\0\0\0\0\0\5kanon\7homenet\rtelec"..., 48, MSG_NOSIGNAL, NULL, 0) = 48
03:31:24.575885 poll([{fd=7, events=POLLIN}], 1, 5000) = 1 ([{fd=7, revents=POLLIN}])
03:31:24.576696 ioctl(7, FIONREAD, [48]) = 0
03:31:24.576734 recvfrom(7, "\202\257\201\203\0\1\0\0\0\0\0\0\5kanon\7homenet\rtelec"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, [16]) = 48
03:31:24.576768 close(7)                = 0
03:31:24.576795 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 7
03:31:24.576816 connect(7, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, 16) = 0
03:31:24.576841 poll([{fd=7, events=POLLOUT}], 1, 0) = 1 ([{fd=7, revents=POLLOUT}])
03:31:24.576863 sendto(7, "\316\21\1\0\0\1\0\0\0\0\0\0\5kanon\0\0\1\0\1", 23, MSG_NOSIGNAL, NULL, 0) = 23
03:31:24.576892 poll([{fd=7, events=POLLIN}], 1, 5000) = 0 (Timeout)
03:31:29.582097 poll([{fd=7, events=POLLOUT}], 1, 0) = 1 ([{fd=7, revents=POLLOUT}])
03:31:29.582251 sendto(7, "\316\21\1\0\0\1\0\0\0\0\0\0\5kanon\0\0\1\0\1", 23, MSG_NOSIGNAL, NULL, 0) = 23
03:31:29.582329 poll([{fd=7, events=POLLIN}], 1, 5000) = 1 ([{fd=7, revents=POLLIN}])
03:31:29.614366 ioctl(7, FIONREAD, [98]) = 0

As you can see, it waits 5 sec after a call.
Any idea?

Last edited by saronno (2014-09-13 13:46:22)

Offline

#2 2014-09-13 10:55:50

stevenhoneyman
Member
From: England
Registered: 2014-05-25
Posts: 241

Re: [SOLVED] Firefox takes a lot of time to load ...

edit: there's a "-v" parameter for strace that should show the unabbreviated stuff

When it happens, run:  lsof -p <pid>
And see what the file descriptors are pointing to

A few questions to try narrow it down if that is a dead end:

Same behaviour if you close it and reopen... or just for the 1st time?
Compiled/linked with "-z now"?
Same with an empty profile?
SSD or HDD?

Last edited by stevenhoneyman (2014-09-13 10:59:18)

Offline

#3 2014-09-13 12:21:52

kang
Member
Registered: 2010-08-07
Posts: 83

Re: [SOLVED] Firefox takes a lot of time to load ...

its not really a wait its a timeout, meaning the operation took too long.

the easiest is probably to go to this URL: about:support
then click "reset firefox"

that's highly likely to fix any such issue (it wont tell what caused it tho, but meh)

You also start firefox with extensions disabled (ie safe mode) by holding the shift key and see if that helps. if it does, it means one of your extension is doing bad stuff (since firefox extensions can modify anything they want, it happens quite often actually).

Offline

#4 2014-09-13 13:04:01

saronno
Member
Registered: 2009-10-02
Posts: 194

Re: [SOLVED] Firefox takes a lot of time to load ...

kang wrote:

its not really a wait its a timeout, meaning the operation took too long.

the easiest is probably to go to this URL: about:support
then click "reset firefox"

that's highly likely to fix any such issue (it wont tell what caused it tho, but meh)

You also start firefox with extensions disabled (ie safe mode) by holding the shift key and see if that helps. if it does, it means one of your extension is doing bad stuff (since firefox extensions can modify anything they want, it happens quite often actually).

Reset doesn't solve the problem.
New profile doesn't solve the problem.
Safe mode doesn't solve the problem.

Offline

#5 2014-09-13 13:08:52

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] Firefox takes a lot of time to load ...

Do you have your hostname listed in /etc/hosts?
I used to experience a delay starting Firefox if this was not set...
https://wiki.archlinux.org/index.php/Be … e#Hostname

Offline

#6 2014-09-13 13:25:32

saronno
Member
Registered: 2009-10-02
Posts: 194

Re: [SOLVED] Firefox takes a lot of time to load ...

stevenhoneyman wrote:

edit: there's a "-v" parameter for strace that should show the unabbreviated stuff

When it happens, run:  lsof -p <pid>
And see what the file descriptors are pointing to

A few questions to try narrow it down if that is a dead end:

Same behaviour if you close it and reopen... or just for the 1st time?
Compiled/linked with "-z now"?
Same with an empty profile?
SSD or HDD?

Timeout happens only if you start firefox and only if no other instances of firefox
are running: so, if there is an existing instance running, the second window
start very quickly.
On reopen same problem.
On closing no problem.

Same thing if I cancel the profile and start it with a new one.

I tried the -v option with strace but I get
the same information as above.

15:13:23.715748 open("/usr/lib/libnss_dns.so.2", O_RDONLY|O_CLOEXEC) = 7
15:13:23.715774 read(7, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\21\0\0\0\0\0\0"..., 832) = 832
15:13:23.715808 fstat(7, {st_dev=makedev(8, 4), st_ino=4639110, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=48, st_size=22960, st_atime=2014/09/13-14:53:16, st_mtime=2014/05/16-10:15:29, st_ctime=2014/05/24-14:28:05}) = 0
15:13:23.715867 mmap(NULL, 2117896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 7, 0) = 0x7f8b10639000
15:13:23.715893 mprotect(0x7f8b1063e000, 2093056, PROT_NONE) = 0
15:13:23.715927 mmap(0x7f8b1083d000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 7, 0x4000) = 0x7f8b1083d000
15:13:23.715969 close(7)                = 0
15:13:23.716053 mprotect(0x7f8b1083d000, 4096, PROT_READ) = 0
15:13:23.716077 munmap(0x7f8b24413000, 216499) = 0
15:13:23.716157 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 7
15:13:23.716186 connect(7, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, 16) = 0
15:13:23.716253 poll([{fd=7, events=POLLOUT}], 1, 0) = 1 ([{fd=7, revents=POLLOUT}])
15:13:23.716292 sendto(7, "\24\214\1\0\0\1\0\0\0\0\0\0\5kanon\7homenet\rtelec"..., 48, MSG_NOSIGNAL, NULL, 0) = 48
15:13:23.716361 poll([{fd=7, events=POLLIN}], 1, 5000) = 1 ([{fd=7, revents=POLLIN}])
15:13:23.717180 ioctl(7, FIONREAD, [48]) = 0
15:13:23.717231 recvfrom(7, "\24\214\201\203\0\1\0\0\0\0\0\0\5kanon\7homenet\rtelec"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, [16]) = 48
15:13:23.717292 close(7)                = 0
15:13:23.717318 socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 7
15:13:23.717350 connect(7, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, 16) = 0
15:13:23.717403 poll([{fd=7, events=POLLOUT}], 1, 0) = 1 ([{fd=7, revents=POLLOUT}])
15:13:23.717438 sendto(7, "n\343\1\0\0\1\0\0\0\0\0\0\5kanon\0\0\1\0\1", 23, MSG_NOSIGNAL, NULL, 0) = 23
15:13:23.717467 poll([{fd=7, events=POLLIN}], 1, 5000) = 0 (Timeout)
15:13:28.722665 poll([{fd=7, events=POLLOUT}], 1, 0) = 1 ([{fd=7, revents=POLLOUT}])
15:13:28.722813 sendto(7, "n\343\1\0\0\1\0\0\0\0\0\0\5kanon\0\0\1\0\1", 23, MSG_NOSIGNAL, NULL, 0) = 23
15:13:28.722885 poll([{fd=7, events=POLLIN}], 1, 5000) = 1 ([{fd=7, revents=POLLIN}])
15:13:28.743628 ioctl(7, FIONREAD, [98]) = 0
15:13:28.743697 recvfrom(7, "n\343\201\203\0\1\0\0\0\1\0\0\5kanon\0\0\1\0\1\0\0\6\0\1\0\0&\364"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.1.1")}, [16]) = 98
15:13:28.743750 close(7)                = 0

Anyway, if I understand correctly, It waits for something to read (POLLIN event) ...
fd=7 should be a socket ... a connection to the port 53 of my router ... probably a DNS request, right?

I use an HDD on this machine.

A curious thing is that thunderbird have the same problem.

Last edited by saronno (2014-09-13 13:28:57)

Offline

#7 2014-09-13 13:34:33

saronno
Member
Registered: 2009-10-02
Posts: 194

Re: [SOLVED] Firefox takes a lot of time to load ...

k7r2GKw.png

I use wireshark to see what is going on .... it asks the for "kanon" that is my computer name ...

Last edited by saronno (2014-09-13 13:36:37)

Offline

#8 2014-09-13 13:37:53

stevenhoneyman
Member
From: England
Registered: 2014-05-25
Posts: 241

Re: [SOLVED] Firefox takes a lot of time to load ...

sounds exactly the problem described above by Head_on_a_Stick

Offline

#9 2014-09-13 13:38:14

saronno
Member
Registered: 2009-10-02
Posts: 194

Re: [SOLVED] Firefox takes a lot of time to load ...

Head_on_a_Stick wrote:

Do you have your hostname listed in /etc/hosts?
I used to experience a delay starting Firefox if this was not set...
https://wiki.archlinux.org/index.php/Be … e#Hostname

No.

#<ip-address>	<hostname.domain.org>	<hostname>
127.0.0.1	localhost.localdomain	localhost
::1		localhost.localdomain	localhost
# End of file

Offline

#10 2014-09-13 13:39:23

stevenhoneyman
Member
From: England
Registered: 2014-05-25
Posts: 241

Re: [SOLVED] Firefox takes a lot of time to load ...

saronno wrote:
Head_on_a_Stick wrote:

Do you have your hostname listed in /etc/hosts?
I used to experience a delay starting Firefox if this was not set...
https://wiki.archlinux.org/index.php/Be … e#Hostname

No.

#<ip-address>	<hostname.domain.org>	<hostname>
127.0.0.1	localhost.localdomain	localhost
::1		localhost.localdomain	localhost
# End of file

add

127.0.0.1 kanon

Offline

#11 2014-09-13 13:46:01

saronno
Member
Registered: 2009-10-02
Posts: 194

Re: [SOLVED] Firefox takes a lot of time to load ...

Problem solved, thanks.

Thunderbird too.

Last edited by saronno (2014-09-13 13:47:02)

Offline

Board footer

Powered by FluxBB