elf.cpp:261: Elf::Elf(std::ifstream&): Assertion `segment->getFileSize() == phdr.p_filesz'

RESOLVED FIXED in Firefox 46

Status

()

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: harri, Assigned: glandium)

Tracking

43 Branch
Firefox 46
x86_64
Linux
Points:
---

Firefox Tracking Flags

(firefox46 fixed)

Details

Attachments

(2 attachments)

(Reporter)

Description

3 years ago
Created attachment 8700305 [details]
build.43.0.1.log

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36

Steps to reproduce:

trying to build 43.0.1 on Debian unstable I get a build error and the request to file a bug report. pbuilder log file is attached. Hope this helps.
(Reporter)

Updated

3 years ago
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
(Reporter)

Comment 1

3 years ago
% gcc --version
gcc (Debian 5.3.1-3) 5.3.1 20151207
% ld --version
GNU ld (GNU Binutils for Debian) 2.25.90.20151209

Comment 2

3 years ago
Lat lines from the log attachment:

elfhack: /build/raw-firefox-43.0.1/mozilla-release/build/unix/elfhack/elf.cpp:261: Elf::Elf(std::ifstream&): Assertion `segment->getFileSize() == phdr.p_filesz' failed.
Makefile:18: recipe for target 'test-array.so' failed
make[6]: *** [test-array.so] Aborted
make[6]: *** Waiting for unfinished jobs....
===
# Fail if the library doesn't have INIT .dynamic info
readelf -d test-ctors.so | grep '(INIT)'
 0x000000000000000c (INIT)               0x4020
/build/raw-firefox-43.0.1/mozilla-release/obj/build/unix/elfhack/elfhack -b -f test-ctors.so
elfhack: /build/raw-firefox-43.0.1/mozilla-release/build/unix/elfhack/elf.cpp:261: Elf::Elf(std::ifstream&): Assertion `segment->getFileSize() == phdr.p_filesz' failed.
Makefile:18: recipe for target 'test-ctors.so' failed
make[6]: *** [test-ctors.so] Aborted
make[6]: Leaving directory '/build/raw-firefox-43.0.1/mozilla-release/obj/build/unix/elfhack'
/build/raw-firefox-43.0.1/mozilla-release/config/recurse.mk:79: recipe for target 'build/unix/elfhack/libs' failed
make[5]: *** [build/unix/elfhack/libs] Error 2
make[5]: Leaving directory '/build/raw-firefox-43.0.1/mozilla-release/obj'
/build/raw-firefox-43.0.1/mozilla-release/config/recurse.mk:32: recipe for target 'libs' failed
make[4]: *** [libs] Error 2
make[4]: Leaving directory '/build/raw-firefox-43.0.1/mozilla-release/obj'
/build/raw-firefox-43.0.1/mozilla-release/config/rules.mk:549: recipe for target 'default' failed
make[3]: *** [default] Error 2
make[3]: Leaving directory '/build/raw-firefox-43.0.1/mozilla-release/obj'
/build/raw-firefox-43.0.1/mozilla-release/client.mk:396: recipe for target 'realbuild' failed
make[2]: *** [realbuild] Error 2
make[2]: Leaving directory '/build/raw-firefox-43.0.1/mozilla-release'
client.mk:171: recipe for target 'build' failed
make[1]: *** [build] Error 2
make[1]: Leaving directory '/build/raw-firefox-43.0.1/mozilla-release'
debian/rules:41: recipe for target 'build-stamp' failed
make: *** [build-stamp] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
E: Failed autobuilding of package
I: unmounting dev/pts filesystem
I: unmounting run/shm filesystem
I: unmounting proc filesystem
I: cleaning the build env 
I: removing directory /home/pbuilder/build//28361 and its subdirectories

Updated

3 years ago
Component: Untriaged → Build Config
(Reporter)

Comment 3

3 years ago
PS: Building on Jessie was fine (using the same build procedure).
(Assignee)

Comment 4

3 years ago
Since you're not building with --enable-release or MOZILLA_OFFICIAL, you're getting the local developer options, which means you're using gold, not ld. There is likely something fishy going on with gold. Try --disable-gold.
(Assignee)

Comment 5

3 years ago
(In reply to Mike Hommey [:glandium] from comment #4)
> There is likely something fishy going on with gold.

And yes, there is something fishy going on with gold. I will file a bug against binutils with a reduced test case.
(Assignee)

Comment 7

3 years ago
Created attachment 8709259 [details] [diff] [review]
Work around recent GNU gold behavior with segments starting before the first section they contain
Assignee: nobody → mh+mozilla
Attachment #8709259 - Flags: review?(nfroyd)
(Assignee)

Updated

3 years ago
Summary: elfhack bug report as requested → elf.cpp:261: Elf::Elf(std::ifstream&): Assertion `segment->getFileSize() == phdr.p_filesz'
Attachment #8709259 - Flags: review?(nfroyd) → review+

Comment 9

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/1a4c479ec7cd
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
status-firefox46: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 46
(Assignee)

Updated

3 years ago
Duplicate of this bug: 1148523
(Assignee)

Updated

3 years ago
Duplicate of this bug: 1246416

Comment 12

3 years ago
[bugday-20160323]

Status: RESOLVED,FIXED -> UNVERIFIED

Comments:
STR: Not clear.
Developer specific testing

Component: 
Name			Firefox
Version			46.0b9
Build ID		20160322075646
Update Channel	beta
User Agent		Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
OS				Windows 7 SP1 x86_64

Expected Results: 
Developer specific testing

Actual Results: 
As expected

Comment 13

3 years ago
(In reply to Mayur Patil from comment #12)
> [bugday-20160323]
> 
> Status: RESOLVED,FIXED -> UNVERIFIED
> 
> Comments:
> STR: Not clear.
> Developer specific testing
> 
> Component: 
> Name			Firefox
> Version			46.0b9
> Build ID		20160322075646
> Update Channel	beta
> User Agent		Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101
> Firefox/46.0
> OS				Windows 7 SP1 x86_64
> 
> Expected Results: 
> Developer specific testing
> 
> Actual Results: 
> As expected

I think you have the wrong bug - this one is for linux using the gnu gold linker, but you appear to be reporting against Windows 7. Also, changing the status to unverified when your results are "As expected" seems a strange thing to do.
You need to log in before you can comment on or make changes to this bug.