Re: large binary immediately SEGV's redux!

From: Kurt (kurt_at_noemail.com)
Date: 02/28/04


Date: Sat, 28 Feb 2004 20:59:59 +1100


"Jeff" <foobarbaz99@hotmail.com> wrote in message
news:91744de5.0402261422.48e91a85@posting.google.com...
> Hi,
>
> I'm starting a new thread. Catch up on what's happened so far here:
>
>
http://groups.google.com/groups?q=g:thl793738458d&dq=&hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8&safe=off&selm=91744de5.0402191757.2bc81114%40posting.google.com
>
> So I now have a very small test case that you can try at home
> yourself!
>
> Compile and run the following program:
>
> #include <stdio.h>
> #define BIG 100362657 // crashes
> // #define BIG 100362656 // works
> char big[BIG];
> main(int argc,char* argv[])
> {
> int i;
> for(i=0; i<BIG; i++) big[i] = 0;
> printf("Done\n");
> return 0;
> }
>
> This will SEGV before it gets to main() on our RH7.2 machines with
> 2.4.7-10 machines with the BigMem patch. Stock gcc. No NFS. Nothing
> fancy.

Nothing like patching the redhat system with patches released by Redhat ?

I bet not.

Redhat use their own *special* version of GCC, in fact they used a
not-tested snapshot and very alpha patches , and did minimal testing before
releasing it into the wild.

And so you should get the updates for redhat ...

>
> Now comment out the line that says "crashes" and uncomment the line
> that says "works." Recompile and re-run. Now program runs fine for us.
> We can also take the "crashes" a.out and run it on a newer kernel and
> it also works fine. But the newer kernel also doesn't have the BigMem
> patch.
>
> So:
>
> 1) Is this a known bug in the kernel that's been fixed?
> 2) Is this crash caused by the BigMem patch?
> 3) What's the earliest version of the kernel where this has been
> fixed?
> 4) Can we do anything to 2.4.7-10 make it work?
>
> Any insight that people could be provide would be great.

I think it was a bug to do with the odd size of the array.
I recall such a bug with gcc from redhat.

Simple solution, install the patched gcc, or the other version that came
with redhat 7.2

Use gcc3 instead of gcc

Or grab gcc binaries from www.gnu.org or something.

>
> Thanks,
>
> Jeff



Relevant Pages

  • Re: [Bugme-new] [Bug 13012] New: 2.6.28.9 causes init to segfault on Debian etch; 2.6.28.8 OK
    ... before reporting this bug, but this might be the best I can do for the next few ... The system in question is a Debian etch system which has a static /dev (no ... the resulting kernel works again. ... I have not yet had a chance to try vanilla gcc 4.1.2. ...
    (Linux-Kernel)
  • kernel + gcc 4.1 = several problems
    ... Could you reproduce the bug by the new kernel, ... This is with the GCC recompile, so it's not a distro problem. ... using this compiler, and will report back if it ...
    (Linux-Kernel)
  • Re: supported kernel versions by gcc 3.3.3
    ... But actually iam looking for all (RedHat linux versions) and their specific ... The executables we give are compiled with gcc 2.96 (for RedHat). ... Customers may use different Redhat linux versions and with different kernel ...
    (RedHat)
  • Re: [patch 00/2] improve .text size on gcc 4.0 and newer compilers
    ... Taking an older compiler from gcc.gnu.org ... OK, but precisely, we don't have any bug free version of gcc anyway. ... kernel has a long history of workaround for gcc bugs. ...
    (Linux-Kernel)
  • Re: Oops in 2.6.19.1
    ... Could you reproduce the bug by the new kernel, ... This is with the GCC recompile, so it's not a distro problem. ... using this compiler, and will report back if it ...
    (Linux-Kernel)