Closed Bug 296653 Opened 15 years ago Closed 12 years ago

mkdepend takes more than 10 hours on Solaris for nsIconChannel.cpp

Categories

(Firefox Build System :: General, defect)

Sun
Solaris
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9alpha7

People

(Reporter: km, Assigned: ginnchen+exoracle)

References

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7.8) Gecko/20050602 Firefox/1.0.4
Build Identifier: http://ftp.mozilla.org/pub/mozilla.org/mozilla/nightly/latest/mozilla-source.tar.bz2

When I build on Solaris 10, all goes well until

Building deps for ..  /mozilla/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp

At this point mkdepend runs forever in an infinite loop.
I don't see this on Solaris 9.



Reproducible: Always

Steps to Reproduce:
1.build it
2.
3.
Version: unspecified → Trunk
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
(In reply to comment #0)
> User-Agent:       Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7.8)
Gecko/20050602 Firefox/1.0.4
> Build Identifier:
http://ftp.mozilla.org/pub/mozilla.org/mozilla/nightly/latest/mozilla-source.tar.bz2
> 
> When I build on Solaris 10, all goes well until
> 
> Building deps for ..  /mozilla/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp
> 
> At this point mkdepend runs forever in an infinite loop.
> I don't see this on Solaris 9.
> 


I can confirm this is indeed a problem.  I am running on Solaris 
10 and have encountered this same problem building on sparc and x86
platforms.

I'm not sure what is going on, but it seems to get stuck in the 'fdefined'
function (mozilla/config/mkdepend/parse.c) which seems to get into 
an infinitely recursive loop and never returns.


Confirmed on Solaris 10 / x86.  mkdepend eventually finishes, but it takes a very long time.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I think I've been seeing this doing a windows trunk build, too. The build has hung (usually with 100% CPU) in the mkdepend step several times.
> When I build on Solaris 10, all goes well until
> 
> Building deps for .. 
> /mozilla/modules/libpr0n/decoders/icon/gtk/nsIconChannel.cpp
> 
> At this point mkdepend runs forever in an infinite loop.
> I don't see this on Solaris 9.
> 

Which compiler did you use? I'm suspection that this might be a Sun Studio bug. I see the hang with Studio 11 and Solaris 10, but it works if you replace the mkdepend with one built with gcc on the same machine...
Product: Firefox → Core
QA Contact: build.config → build-config
I've hit this before. It's not actually an infinite loop, as it will finish if you let it run for hours and hours.

I did a little investigation, and the call stack is roughly add_includes() for nsEscape.h, then nsString.h, and more string stuff beyond that. Seems to spend most of the time a pile of fdefined() calls... Perhaps it's slurped in a huge amount of data somehow, or a screwey pointer has it checking bogus info.
http://cvsweb.xfree86.org/cvsweb/xc/config/makedepend/

We're a version or so behind The XFree86 version (which we copied into the tree). Dunno if updating that will help.
Duplicate of this bug: 388525
If you're using gcc, you might just switched on COMPILER_DEPEND.

On Linux, I switched off MOZ_NATIVE_MAKEDEPEND and COMPILER_DEPEND, it takes about 5 mins for nsIconChannel.cpp
(makedepend by gcc takes less than 1 sec)

On Solairs, I tried to compile mkdepend with gcc, also tried /usr/openwin/bin/makedepend, they won't help.

I guess the time makedepend takes raises at exponential rate of defines and includes.
It takes me about 15 hrs on Ultra45.
Summary: mkdepend has infinite loop on Solaris 10 → mkdepend takes more than 10 hours on Solaris for nsIconChannel.cpp
We can use CC -xM or -xM1 for Sun Studio.
Then we don't require mkdepend.
Attached patch patch (obsolete) — Splinter Review
Use -xM for Sun Studio compiler on Solairs

I hope this patch is not too messy.
I don't find a easy way to get around.

1) I borrowed -disable-md to switch off
2) -xM is not like -MD, the source will not compiled to .o if you're using this option.
So I defined MAKE_DEPS_AUTO_CC and MAKE_DEPS_AUTO_CXX to do the job

I hope this patch can make Solaris Dep tinderbox run faster,
and help Solaris developers have the benefit of makedep.
Assignee: nobody → ginn.chen
Status: NEW → ASSIGNED
Attachment #272921 - Flags: review?(benjamin)
Comment on attachment 272921 [details] [diff] [review]
patch

I think this is ok, but I'd like cls to take a look at it if he has the time.
Attachment #272921 - Flags: review?(cls)
Attachment #272921 - Flags: review?(benjamin)
Attachment #272921 - Flags: review+
Comment on attachment 272921 [details] [diff] [review]
patch

There are other references to MAKE_DEPS_AUTO in the tree.  See lxr.

For ease of understanding, I would change the
#ifndef COMPILER_DEPEND
to
#ifdef COMPILER_DEPEND
and swap around the sections.  

I'm not sure off-hand if changing the default for _DEPEND_CFLAGS (to be empty) will have any practical side effects.  Right now, it's possible for someone to explicitly use --enable-md and use the defaults without using gcc & g++. I don't know offhand if anyone's actually using that configuration.
Attachment #272921 - Flags: review?(cls) → review-
Attached patch patch v2Splinter Review
Thanks for your review! (both of you)

Changes:
1) only change _DEPEND_CFLAGS to empty for Solaris non-GCC compiler,
i.e. Sun Studio
2) Change ifndef COMPILER_DEPEND to ifdef COMPILER_DEPEND
3) Update js/src/Makefile.in and modules/libpref/src/Makefile.in
although they only use MAKE_DEPS_AUTO for some specific platform (not Solaris)
Attachment #272921 - Attachment is obsolete: true
Attachment #273751 - Flags: review?(cls)
Attachment #273751 - Flags: review?(cls) → review+
Keywords: checkin-needed
Comment on attachment 273751 [details] [diff] [review]
patch v2

low risk, only affect and benefit Solaris platform.
Attachment #273751 - Flags: approval1.9?
Comment on attachment 273751 [details] [diff] [review]
patch v2

a=bzbarsky
Attachment #273751 - Flags: approval1.9? → approval1.9+
Bah, this needs a JS peer to checkin, since it's touching a file under /js.

I did a (successful) clobber build under OS X just to make extra sure nothing broke, so this should be good to go.
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite-
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M7
I see the same hang on HPUX too . Can this be fixed for HP_UX also ?
You can do it if the compiler on HPUX has this functionality.
Or you can just use --disable-auto-deps to avoid the hang.
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.