Last Comment Bug 706724 - firefox-beta repository: error: ‘ftruncate’ was not declared in this scope
: firefox-beta repository: error: ‘ftruncate’ was not decl...
Product: Core
Classification: Components
Component: IPC (show other bugs)
: Trunk
: x86_64 Linux
: P3 normal (vote)
: mozilla12
Assigned To: :aceman
: Bill McCloskey (:billm)
Depends on:
Blocks: 736765
  Show dependency treegraph
Reported: 2011-11-30 17:08 PST by George R. Goffe
Modified: 2012-03-19 04:12 PDT (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

build.log showing the error. (2.64 KB, text/plain)
2011-11-30 17:08 PST, George R. Goffe
no flags Details
build fix (520 bytes, patch)
2011-12-10 06:11 PST, :aceman
benjamin: review+
Details | Diff | Splinter Review

Description George R. Goffe 2011-11-30 17:08:10 PST
Created attachment 578139 [details]
build.log showing the error.

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20100101 Firefox/8.0
Build ID: 20111104165243

Steps to reproduce:

This is a fresh copy of the firefox-beta repository. I'm trying to build firefox-beta on my Ubuntu 10.4.1 system and have encountered the following error: error: ‘ftruncate’ was not declared in this scope

Actual results:

See above.

Expected results:

I was expecting a clean build.
Comment 1 :aceman 2011-12-01 04:38:39 PST
What is your gcc version?
Comment 2 :aceman 2011-12-01 07:33:55 PST
Can you try adding the line
"#include <unistd.h>"
as the 14th line in that file? (before #include <fstream>)
Comment 3 George R. Goffe 2011-12-01 12:49:10 PST

I have two gcc compilers here and have tried both... Each gets the same failure.


/usr/bin/gcc --version
gcc-4.4.real (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO

goffe@goffeg bash-4.1 /tools/mozilla/firefox };-) gcc --version
gcc (GCC) 4.7.0 20111201 (experimental)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
Comment 4 George R. Goffe 2011-12-01 12:49:40 PST
I'm building with our suggested change now.


Comment 5 :aceman 2011-12-01 13:14:58 PST
Ok, comment if it builds and runs fine.

I wonder where that include disappeared, it seems it was already included in the past: commit .
Comment 6 George R. Goffe 2011-12-01 14:31:38 PST

I did see the include in the ifdef just before where you told me to insert that include... Maybe the ifdef is wrong?

By the way, I had autoconf-4.65 on this system which caused the build processes to fail with something called "defn" missing... 

These files have a mixture of m4_defn, m4_define, and defn. The "defn"s cause my build to fail until I downgraded my autoconf to 2.13. Is this a bug?



Comment 7 George R. Goffe 2011-12-01 14:38:40 PST

I tried both compilers with the same resulting failure. Way past your(?) code.

Now what?


c++ -o crashreporter.o -c  -I../../../dist/system_wrappers -include /usr/local/google/tools/mozilla/firefox/beta-src/config/gcc_hidden.h -DOSTYPE=\"Linux2.6.38\" -DOSARCH=Linux -I/usr/local/google/tools/mozilla/firefox/beta-src/toolkit/crashreporter/client/../google-breakpad/src -I/usr/local/google/tools/mozilla/firefox/beta-src/toolkit/crashreporter/client -I/usr/local/google/tools/mozilla/firefox/beta-src/toolkit/crashreporter/client -I. -I../../../dist/include -I../../../dist/include/nsprpub  -I/tools/mozilla/firefox/beta-src/obj-x86_64-unknown-linux-gnu/dist/include/nspr -I/tools/mozilla/firefox/beta-src/obj-x86_64-unknown-linux-gnu/dist/include/nss      -fPIC  -fno-rtti -pedantic -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -Wno-long-long -fno-exceptions -fno-strict-aliasing -std=gnu++0x -pthread -ffunction-sections -fdata-sections -pipe -pthread -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/gtk-unix-print-2.0   -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include    -DNDEBUG -DTRIMMED -g -Os -freorder-blocks  -fomit-frame-pointer   -DMOZILLA_CLIENT -include ../../../mozilla-config.h -MD -MF .deps/crashreporter.pp /usr/local/google/tools/mozilla/firefox/beta-src/toolkit/crashreporter/client/crashreporter.cpp
In file included from /usr/include/c++/4.4/memory:83,
                 from ../../../dist/system_wrappers/memory:3,
                 from /usr/local/google/tools/mozilla/firefox/beta-src/toolkit/crashreporter/client/crashreporter.cpp:49:
/usr/include/c++/4.4/bits/shared_ptr.h: In member function ‘virtual void* std::_Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp>::_M_get_deleter(const std::type_info&)’:
/usr/include/c++/4.4/bits/shared_ptr.h:146: error: cannot use typeid with -fno-rtti
/usr/include/c++/4.4/bits/shared_ptr.h: In member function ‘virtual void* std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_M_get_deleter(const std::type_info&)’:
/usr/include/c++/4.4/bits/shared_ptr.h:204: error: cannot use typeid with -fno-rtti
/usr/include/c++/4.4/bits/shared_ptr.h: In constructor ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_make_shared_tag, _Alloc, _Args&& ...)’:
/usr/include/c++/4.4/bits/shared_ptr.h:861: error: cannot use typeid with -fno-rtti
/usr/include/c++/4.4/bits/shared_ptr.h: In function ‘_Del* std::get_deleter(const std::__shared_ptr<_Tp2, _Lp>&)’:
/usr/include/c++/4.4/bits/shared_ptr.h:1005: error: cannot use typeid with -fno-rtti
Comment 8 :aceman 2011-12-01 14:45:33 PST
Yes, only autoconf 2.13 are supported (yes, that is ancient but there are some reasons).

See more here
Comment 9 :aceman 2011-12-10 06:11:02 PST
Created attachment 580642 [details] [diff] [review]
build fix
Comment 10 :aceman 2011-12-12 13:18:18 PST
(In reply to George R. Goffe from comment #7)
> /usr/include/c++/4.4/bits/shared_ptr.h:1005: error: cannot use typeid with
> -fno-rtti

Is -fno-rtti compiler flag added by you? If yes, try to remove it.
You can also add 'ac_add_options --disable-crashreporter' into mozconfig, if you do not need it.
But this no longer the topic of this bug. Try to discuss this on with somebody.
Comment 11 Ed Morley [:emorley] 2011-12-12 17:43:30 PST
Please could you tweak your hgrc to automatically add author info (guide here: + add a commit message when attaching patches, since it makes pushing half a dozen checkin-neededs a lot easier. Thanks :-)
Comment 12 :aceman 2011-12-13 02:08:20 PST
Ok, I can try that. But you will still need to add the reviewers.
Comment 13 Ed Morley [:emorley] 2011-12-15 02:21:53 PST
Adding "; r=foo" takes a lot less time than constructing the user line / coming up with a commit message, so if you could do the latter, that would be a big help :-)
Comment 14 :aceman 2011-12-15 02:37:04 PST
Yes, I'll try to migrate to using the mq extension according to the page you linked. I'll try creating new patches with it.

But I have one question. Visitors not logged into bugzilla do not see email addresses of bug commenters. But I think they can see attachment contents. The patch will contain my email. I am not yet sure if it is a problem for me. But is this solved in any way?
Comment 15 Ed Morley [:emorley] 2011-12-15 02:41:00 PST
Once your patch lands, it will be public anyway, see:

As such, if you would rather keep your email address hidden (I can totally empathise, I have an aversion to spam myself), then I recommend setting up a bugzilla/mozilla only account and forwarding/fetching mail to your current email address.
Comment 16 :aceman 2011-12-15 02:51:01 PST
OK, thanks. I already have the separate address for bugzilla, I just wanted to protect it too, if possible.

Is it enough to put the bug number and summary as the user commit line? Do other people put something better there?
Comment 17 Ed Morley [:emorley] 2011-12-15 03:02:47 PST
The commit message is normally in the format:
Bug 123456 - What was changed; r=foo

ie: Making sure to explain what changed and not just what the problem was. (Bugzilla bug summaries are obviously often more about the latter).
Comment 18 :aceman 2011-12-15 12:54:06 PST
OK, can you see if my patch in bug 652555 meets these criteria?
Comment 19 Ed Morley [:emorley] 2011-12-15 15:22:55 PST
Patch commit message in bug 652555 looks fine to me :-)
Comment 20 :aceman 2011-12-16 00:27:36 PST
Thanks. So what about the patch here? Will you merge it, or do you wait for me to update it?
Comment 22 Ed Morley [:emorley] 2012-01-11 18:05:41 PST

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