Last Comment Bug 296653 - mkdepend takes more than 10 hours on Solaris for nsIconChannel.cpp
: mkdepend takes more than 10 hours on Solaris for nsIconChannel.cpp
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: Sun Solaris
: -- normal (vote)
: mozilla1.9alpha7
Assigned To: Ginn Chen
:
:
Mentors:
: 388525 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-04 16:47 PDT by km
Modified: 2009-05-05 02:23 PDT (History)
10 users (show)
jwalden+bmo: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (5.11 KB, patch)
2007-07-18 22:59 PDT, Ginn Chen
benjamin: review+
cls: review-
Details | Diff | Splinter Review
patch v2 (7.87 KB, patch)
2007-07-25 01:42 PDT, Ginn Chen
cls: review+
bzbarsky: approval1.9+
Details | Diff | Splinter Review

Description km 2005-06-04 16:47:36 PDT
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.
Comment 1 Gervase Markham [:gerv] 2005-09-27 01:40:27 PDT
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/
Comment 2 Wyllys Ingersoll 2005-09-30 10:35:27 PDT
(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.


Comment 3 Greg Onufer 2006-09-14 01:30:24 PDT
Confirmed on Solaris 10 / x86.  mkdepend eventually finishes, but it takes a very long time.
Comment 4 Daniel Veditz [:dveditz] 2006-11-29 14:11:47 PST
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.
Comment 5 Andreas Lange 2006-12-12 03:08:45 PST
> 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...
Comment 6 Justin Dolske [:Dolske] 2007-05-14 19:23:36 PDT
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.
Comment 7 Justin Dolske [:Dolske] 2007-05-14 20:33:40 PDT
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.
Comment 8 cls 2007-07-17 20:30:08 PDT
*** Bug 388525 has been marked as a duplicate of this bug. ***
Comment 9 Ginn Chen 2007-07-18 04:24:34 PDT
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.
Comment 10 Ginn Chen 2007-07-18 04:30:35 PDT
We can use CC -xM or -xM1 for Sun Studio.
Then we don't require mkdepend.
Comment 11 Ginn Chen 2007-07-18 22:59:01 PDT
Created attachment 272921 [details] [diff] [review]
patch

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.
Comment 12 Benjamin Smedberg [:bsmedberg] 2007-07-24 10:41:18 PDT
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.
Comment 13 cls 2007-07-24 14:10:28 PDT
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.
Comment 14 Ginn Chen 2007-07-25 01:42:48 PDT
Created attachment 273751 [details] [diff] [review]
patch v2

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)
Comment 15 Ginn Chen 2007-08-02 00:55:27 PDT
Comment on attachment 273751 [details] [diff] [review]
patch v2

low risk, only affect and benefit Solaris platform.
Comment 16 Boris Zbarsky [:bz] (still a bit busy) 2007-08-17 10:53:33 PDT
Comment on attachment 273751 [details] [diff] [review]
patch v2

a=bzbarsky
Comment 17 Justin Dolske [:Dolske] 2007-08-17 15:57:36 PDT
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.
Comment 18 Jeff Walden [:Waldo] (remove +bmo to email) 2007-08-17 16:10:12 PDT
Checked in.
Comment 19 Gowri Kandasamy 2009-05-04 02:09:18 PDT
I see the same hang on HPUX too . Can this be fixed for HP_UX also ?
Comment 20 Ginn Chen 2009-05-05 02:23:11 PDT
You can do it if the compiler on HPUX has this functionality.
Or you can just use --disable-auto-deps to avoid the hang.

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