Closed Bug 463561 Opened 14 years ago Closed 14 years ago

mkdepend crashes while compiling freetype


(Firefox Build System :: General, defect)

Windows XP
Not set


(Not tracked)



(Reporter: blassey, Assigned: blassey)


(Keywords: fixed1.9.1, mobile)


(1 file, 1 obsolete file)

It also crashes when compiling other sources that include freetype headers.  For some reason we're dividing by zero when parsing some macros.
Attached patch fixes the crash (obsolete) — Splinter Review
instead of dividing by zero, set the result to the largest integer it can hold
Attachment #346839 - Flags: review?(benjamin)
What file is being compiled when mkdepend crashes? I'm a little leery of changing the mkdepend sources independently, since I'm pretty certain it is a straight import of external code (FreeBSD stuff, perhaps?)
CVS logs say it's from X11, but they also say we've taken local patches:
It appears to crash anywhere ftconfig.h is included, while evaluating "FT_SIZEOF_INT  (32 / FT_CHAR_BIT)."  So there are two bugs here.  First being FT_CHAR_BIT is defined to be 0, which is wrong.  It appears to expect CHAR_BIT to be defined in <limits.h>

  /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a      */
  /* `char' type.                                                        */

#ifndef FT_CHAR_BIT

The second problem being that mkdepend crashes when it encounters this, giving no useful error message.
Comment on attachment 346839 [details] [diff] [review]
fixes the crash

Yeah, I don't think this is the right solution.
Attachment #346839 - Flags: review?(benjamin) → review-
Without this patch (and just using the CHAR_BIT=8 patch in, i continue to crash when building cairo.
Attachment #346839 - Flags: review- → review?(benjamin)
Comment on attachment 346839 [details] [diff] [review]
fixes the crash

Benjamin, what do you think the right solution is?
I think the right solution is for mkdepend to report an error if you try to divide by zero.
Attachment #346839 - Attachment is obsolete: true
Attachment #358419 - Flags: review?(benjamin)
Attachment #346839 - Flags: review?(benjamin)
Attachment #358419 - Flags: review?(benjamin) → review+
Comment on attachment 358419 [details] [diff] [review]
throws an error for division by zero

Attachment #358419 - Flags: approval1.9.1+
Closed: 14 years ago
Resolution: --- → FIXED
Why hasn't this landed on branch yet?
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.