Bug 195755 - gcc segfaults with malloc_perturb
gcc segfaults with malloc_perturb
Product: Fedora
Classification: Fedora
Component: binutils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2006-06-17 01:33 EDT by Dave Jones
Modified: 2015-01-04 17:27 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-06-27 08:06:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dave Jones 2006-06-17 01:33:10 EDT
whilst building the kernel on i686, I puzzled as to why as segfaulted when
compiling the i386 vsyscall code.

as was segfaulting whilst assembling arch/i386/kernel/vsyscall.S
in particular, on an incbin of two files..

Looking at the files that were incbin'd explained it..

$ ll arch/i386/kernel/vsyscall-*.so
-rwxr-xr-x 1 davej davej 623185380 Jun 17 00:50 arch/i386/kernel/vsyscall-int80.so*
-rwxr-xr-x 1 davej davej 623185404 Jun 17 00:50

Why were they so enormous ?

objdump revealed..

Program Header:
    LOAD off    0x00000000 vaddr 0xdadadada paddr 0xdadadada align 2**30
         filesz 0x25250b3a memsz 0x25250b3a flags r-x
 DYNAMIC off    0x25250ab6 vaddr 0xffffe590 paddr 0xffffe590 align 2**2
         filesz 0x00000078 memsz 0x00000078 flags r--
    NOTE off    0x25250986 vaddr 0xffffe460 paddr 0xffffe460 align 2**2
         filesz 0x00000018 memsz 0x00000018 flags r--
EH_FRAME off    0x2525099e vaddr 0xffffe478 paddr 0xffffe478 align 2**2
         filesz 0x00000024 memsz 0x00000024 flags r--

Normally, without the perturb, it comes out as ..

-rwxr-xr-x 1 davej davej 2192 Jun 17 01:38 arch/i386/kernel/vsyscall-int80.so*
-rwxr-xr-x 1 davej davej 2216 Jun 17 01:38 arch/i386/kernel/vsyscall-sysenter.so*

I tried to put together a small testcase, but there's a bunch of dependant .o's
from arch/i386/kernel.  Let me know if you can't reproduce, and I'll try again
to come up with something small.
Comment 1 Jakub Jelinek 2006-06-19 07:48:49 EDT
I have found two places where ld used uninitialized memory:
but all that it caused to the i386 vsyscall-int80.so was that it couldn't be
linked at all, so I'd like to verify this is the same thing as you were seeing
and not something else.
So, please create a reproducer:
1) note the exact gcc commands to build vsyscall-*.o files as well as
2) add -save-temps to the command lines, attach here the preprocessed
vsyscall-*.s files as well as vmlinux.lds you used
3) what exact binutils you were using?
4) what exact MALLOC_PERTURB_=N value was used?
Comment 2 Jakub Jelinek 2006-06-27 08:06:07 EDT
Assuming binutils- fixes this, if not, please reopen with details.

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