Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpmbuild Floating Point Exception in rpmDoDigest while packaging guile 2.2.3 #420

Closed
berolinux opened this issue Mar 26, 2018 · 6 comments
Closed

Comments

@berolinux
Copy link
Contributor

Packaging guile 2.2.3 results in a Floating Point Exception from rpmbuild.
A very similar error occurs while building gdb with guile support enabled.

Processing files: guile-runtime-2.2.3-2.x86_64

Program received signal SIGFPE, Arithmetic exception.
0x00007ffff7f03055 in rpmDoDigest () from /usr/lib64/librpmio.so.8

gdb backtrace:
#0 0x00007ffff7f03055 in rpmDoDigest () from /usr/lib64/librpmio.so.8
#1 0x00007ffff7f87a21 in genCpioListAndHeader () from /usr/lib64/librpmbuild.so.8
#2 0x00007ffff7f89a97 in processBinaryFiles () from /usr/lib64/librpmbuild.so.8
#3 0x00007ffff7f85a5d in buildSpec () from /usr/lib64/librpmbuild.so.8
#4 0x0000000000402bf3 in buildForTarget ()
#5 0x00000000004025b7 in build ()
#6 0x00000000004022a4 in main ()

@abucodonosor
Copy link

@n3npq

Floating Point Exception is a division by 0 error not a signal issue.

@berolinux
Copy link
Contributor Author

Seems to happen reliably with this simplified test case (even while just building a src.rpm)

test.zip

@mlschroe
Copy link
Contributor

My guess is the int maxndx = data->d_size / shdr.sh_entsize line in is_prelinked(). There should be a test if shdr.sh_entsize is zero.

@mlschroe
Copy link
Contributor

(I.e. the build should work if you comment out the __prelink_undo_cmd definition in /usr/lib/rpm/macros. Can you confirm this?)

@berolinux
Copy link
Contributor Author

Yes, just traced it to exactly that line as well.
Adding an "if(shdr.sh_entsize == 0) continue;" just before it fixes the problem. Will send a pull request for that...

berolinux added a commit to berolinux/rpm that referenced this issue Mar 27, 2018
Avoid dividing by zero when hitting an ELF section without fixed-size
entries.
Thanks to Michael Schroeder for helping trace the problem (in rpm-software-management#420)
ffesti pushed a commit that referenced this issue Apr 9, 2018
Avoid dividing by zero when hitting an ELF section without fixed-size
entries.
Thanks to Michael Schroeder for helping trace the problem (in #420)
@ffesti
Copy link
Contributor

ffesti commented Apr 9, 2018

Closed by #421

@ffesti ffesti closed this as completed Apr 9, 2018
pmatilai pushed a commit that referenced this issue Jun 29, 2018
Avoid dividing by zero when hitting an ELF section without fixed-size
entries.
Thanks to Michael Schroeder for helping trace the problem (in #420)

(cherry picked from commit 2e3867e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants