public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc-2.95: Program dies with Sig 11 before doing anything - RH Linux 5.2
@ 1999-06-13 10:35 Toon Moene
  1999-06-13 14:00 ` Sylvain Pion
  1999-06-30 15:43 ` Toon Moene
  0 siblings, 2 replies; 8+ messages in thread
From: Toon Moene @ 1999-06-13 10:35 UTC (permalink / raw)
  To: egcs

Pretty scary, this one (using gcc-2.95pre):

[hirlam@moene ref]$ gdb hlprog32.x core 
GNU gdb 4.17.0.4 with Linux/x86 hardware watchpoint and FPU support
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux"...
Core was generated by `/usr/scratch/hirlam/ref/hlprog32.x'.
Program terminated with signal 11, Segmentation fault.
#0  init (argc=1, argv=0xbffff88c, envp=0xbffff894)
    at ../sysdeps/unix/sysv/linux/init-first.c:70
../sysdeps/unix/sysv/linux/init-first.c:70: No such file or directory.

For a program that plain works under the compilers from the trunk -
errmmm, oh yes, I changed this one in f/com.c for those:

#define FFECOM_sizeMAXSTACKITEM 0
#ifndef FFECOM_sizeMAXSTACKITEM
#define FFECOM_sizeMAXSTACKITEM 32*1024 /* Keep user-declared things
                                           larger than this # bytes
                                           off stack if possible. */
#endif

[ the first line is mine ]

What this does is make the compiler generate code to allocate all local
arrays on the stack, regardless of size.

Which means that the error I get is still pretty scary:  A 45 Mbyte
working set program that cannot be linked successfully on RH Linux 5.2 -
brrr :-(

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://world.std.com/~burley/g77.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gcc-2.95: Program dies with Sig 11 before doing anything - RH Linux 5.2
  1999-06-13 10:35 gcc-2.95: Program dies with Sig 11 before doing anything - RH Linux 5.2 Toon Moene
@ 1999-06-13 14:00 ` Sylvain Pion
  1999-06-14 13:04   ` Toon Moene
  1999-06-30 15:43   ` Sylvain Pion
  1999-06-30 15:43 ` Toon Moene
  1 sibling, 2 replies; 8+ messages in thread
From: Sylvain Pion @ 1999-06-13 14:00 UTC (permalink / raw)
  To: Toon Moene; +Cc: egcs

On Sun, Jun 13, 1999 at 07:35:30PM +0200, Toon Moene wrote:
> What this does is make the compiler generate code to allocate all local
> arrays on the stack, regardless of size.

If you go beyond the default stack size (8MB), you'll get a sig11.
Did you try running it with "unlimit stacksize" ?
For example, just run the following:

int main()
{
  int a[1<<21];
  return a[0];
}

-- 
Sylvain

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gcc-2.95: Program dies with Sig 11 before doing anything - RH Linux 5.2
  1999-06-13 14:00 ` Sylvain Pion
@ 1999-06-14 13:04   ` Toon Moene
  1999-06-17 12:23     ` Toon Moene
  1999-06-30 15:43     ` Toon Moene
  1999-06-30 15:43   ` Sylvain Pion
  1 sibling, 2 replies; 8+ messages in thread
From: Toon Moene @ 1999-06-14 13:04 UTC (permalink / raw)
  To: Sylvain Pion; +Cc: egcs

Sylvain Pion wrote:

> On Sun, Jun 13, 1999 at 07:35:30PM +0200, Toon Moene wrote:
> > What this does is make the compiler generate code to allocate all local
> > arrays on the stack, regardless of size.
> 
> If you go beyond the default stack size (8MB), you'll get a sig11.
> Did you try running it with "unlimit stacksize" ?
> For example, just run the following:

Ah, sorry, I see that my mail was less than clear.  Try the following
Fortran source:

      common /com/ a(20000000)
      a(1) = 1.
      print*, a(1)
      call sub
      end
      subroutine sub
      dimension b(10000000)
      b(1) = 2.
      print*, b(1)
      end

This should pass (as it does), even if b were allocated on the stack
with the following stack size limit:

[toon@moene g77-bugs]$ ulimit -s
65536

However, as distributed, g77 will allocate b statically, because it is
larger than 32 Kbyte;  I can simulate that with the compiler as I
modified it by compiling it thusly:

[toon@moene g77-bugs]$ /usr/rel/bin/g77 -fno-automatic s.f
[toon@moene g77-bugs]$ ./a.out
Segmentation fault (core dumped)

For completeness:

[toon@moene g77-bugs]$ /usr/rel/bin/g77 -v
g77 version gcc-2.95 19990613 (prerelease) (from FSF-g77 version 0.5.25
19990526 (prerelease))
Driving: /usr/rel/bin/g77 -v -c -xf77-version /dev/null -xnone
Reading specs from /usr/rel/lib/gcc-lib/i686-pc-linux-gnu/gcc-2.95/specs
gcc version gcc-2.95 19990613 (prerelease)
... etc ...

As I said, stock Red Hat Linux 5.2.

Cheers,

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://world.std.com/~burley/g77.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gcc-2.95: Program dies with Sig 11 before doing anything - RH Linux 5.2
  1999-06-14 13:04   ` Toon Moene
@ 1999-06-17 12:23     ` Toon Moene
  1999-06-30 15:43       ` Toon Moene
  1999-06-30 15:43     ` Toon Moene
  1 sibling, 1 reply; 8+ messages in thread
From: Toon Moene @ 1999-06-17 12:23 UTC (permalink / raw)
  To: egcs

Toon Moene wrote:

False Alarm [ It's the Swap Space, Stupid ! ]

> Ah, sorry, I see that my mail was less than clear.  Try the following
> Fortran source:
> 
>       common /com/ a(20000000)
>       a(1) = 1.
>       print*, a(1)
>       call sub
>       end
>       subroutine sub
>       dimension b(10000000)
>       b(1) = 2.
>       print*, b(1)
>       end

4 * (20 000 000 + 10 000 000) = 120 000 000 which is just a little bit
less than 128 Mbyte, which is RAM + Swap on my machine.  Given that I
also have three Netscape windows open - and you see the connection.

Changing 20 000 000 to 15 000 000 makes it work.

My Apologies,

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://world.std.com/~burley/g77.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gcc-2.95: Program dies with Sig 11 before doing anything - RH Linux 5.2
  1999-06-13 14:00 ` Sylvain Pion
  1999-06-14 13:04   ` Toon Moene
@ 1999-06-30 15:43   ` Sylvain Pion
  1 sibling, 0 replies; 8+ messages in thread
From: Sylvain Pion @ 1999-06-30 15:43 UTC (permalink / raw)
  To: Toon Moene; +Cc: egcs

On Sun, Jun 13, 1999 at 07:35:30PM +0200, Toon Moene wrote:
> What this does is make the compiler generate code to allocate all local
> arrays on the stack, regardless of size.

If you go beyond the default stack size (8MB), you'll get a sig11.
Did you try running it with "unlimit stacksize" ?
For example, just run the following:

int main()
{
  int a[1<<21];
  return a[0];
}

-- 
Sylvain

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gcc-2.95: Program dies with Sig 11 before doing anything - RH Linux 5.2
  1999-06-14 13:04   ` Toon Moene
  1999-06-17 12:23     ` Toon Moene
@ 1999-06-30 15:43     ` Toon Moene
  1 sibling, 0 replies; 8+ messages in thread
From: Toon Moene @ 1999-06-30 15:43 UTC (permalink / raw)
  To: Sylvain Pion; +Cc: egcs

Sylvain Pion wrote:

> On Sun, Jun 13, 1999 at 07:35:30PM +0200, Toon Moene wrote:
> > What this does is make the compiler generate code to allocate all local
> > arrays on the stack, regardless of size.
> 
> If you go beyond the default stack size (8MB), you'll get a sig11.
> Did you try running it with "unlimit stacksize" ?
> For example, just run the following:

Ah, sorry, I see that my mail was less than clear.  Try the following
Fortran source:

      common /com/ a(20000000)
      a(1) = 1.
      print*, a(1)
      call sub
      end
      subroutine sub
      dimension b(10000000)
      b(1) = 2.
      print*, b(1)
      end

This should pass (as it does), even if b were allocated on the stack
with the following stack size limit:

[toon@moene g77-bugs]$ ulimit -s
65536

However, as distributed, g77 will allocate b statically, because it is
larger than 32 Kbyte;  I can simulate that with the compiler as I
modified it by compiling it thusly:

[toon@moene g77-bugs]$ /usr/rel/bin/g77 -fno-automatic s.f
[toon@moene g77-bugs]$ ./a.out
Segmentation fault (core dumped)

For completeness:

[toon@moene g77-bugs]$ /usr/rel/bin/g77 -v
g77 version gcc-2.95 19990613 (prerelease) (from FSF-g77 version 0.5.25
19990526 (prerelease))
Driving: /usr/rel/bin/g77 -v -c -xf77-version /dev/null -xnone
Reading specs from /usr/rel/lib/gcc-lib/i686-pc-linux-gnu/gcc-2.95/specs
gcc version gcc-2.95 19990613 (prerelease)
... etc ...

As I said, stock Red Hat Linux 5.2.

Cheers,

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://world.std.com/~burley/g77.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: gcc-2.95: Program dies with Sig 11 before doing anything - RH Linux 5.2
  1999-06-17 12:23     ` Toon Moene
@ 1999-06-30 15:43       ` Toon Moene
  0 siblings, 0 replies; 8+ messages in thread
From: Toon Moene @ 1999-06-30 15:43 UTC (permalink / raw)
  To: egcs

Toon Moene wrote:

False Alarm [ It's the Swap Space, Stupid ! ]

> Ah, sorry, I see that my mail was less than clear.  Try the following
> Fortran source:
> 
>       common /com/ a(20000000)
>       a(1) = 1.
>       print*, a(1)
>       call sub
>       end
>       subroutine sub
>       dimension b(10000000)
>       b(1) = 2.
>       print*, b(1)
>       end

4 * (20 000 000 + 10 000 000) = 120 000 000 which is just a little bit
less than 128 Mbyte, which is RAM + Swap on my machine.  Given that I
also have three Netscape windows open - and you see the connection.

Changing 20 000 000 to 15 000 000 makes it work.

My Apologies,

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://world.std.com/~burley/g77.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* gcc-2.95: Program dies with Sig 11 before doing anything - RH Linux 5.2
  1999-06-13 10:35 gcc-2.95: Program dies with Sig 11 before doing anything - RH Linux 5.2 Toon Moene
  1999-06-13 14:00 ` Sylvain Pion
@ 1999-06-30 15:43 ` Toon Moene
  1 sibling, 0 replies; 8+ messages in thread
From: Toon Moene @ 1999-06-30 15:43 UTC (permalink / raw)
  To: egcs

Pretty scary, this one (using gcc-2.95pre):

[hirlam@moene ref]$ gdb hlprog32.x core 
GNU gdb 4.17.0.4 with Linux/x86 hardware watchpoint and FPU support
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux"...
Core was generated by `/usr/scratch/hirlam/ref/hlprog32.x'.
Program terminated with signal 11, Segmentation fault.
#0  init (argc=1, argv=0xbffff88c, envp=0xbffff894)
    at ../sysdeps/unix/sysv/linux/init-first.c:70
../sysdeps/unix/sysv/linux/init-first.c:70: No such file or directory.

For a program that plain works under the compilers from the trunk -
errmmm, oh yes, I changed this one in f/com.c for those:

#define FFECOM_sizeMAXSTACKITEM 0
#ifndef FFECOM_sizeMAXSTACKITEM
#define FFECOM_sizeMAXSTACKITEM 32*1024 /* Keep user-declared things
                                           larger than this # bytes
                                           off stack if possible. */
#endif

[ the first line is mine ]

What this does is make the compiler generate code to allocate all local
arrays on the stack, regardless of size.

Which means that the error I get is still pretty scary:  A 45 Mbyte
working set program that cannot be linked successfully on RH Linux 5.2 -
brrr :-(

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://world.std.com/~burley/g77.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1999-06-30 15:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-13 10:35 gcc-2.95: Program dies with Sig 11 before doing anything - RH Linux 5.2 Toon Moene
1999-06-13 14:00 ` Sylvain Pion
1999-06-14 13:04   ` Toon Moene
1999-06-17 12:23     ` Toon Moene
1999-06-30 15:43       ` Toon Moene
1999-06-30 15:43     ` Toon Moene
1999-06-30 15:43   ` Sylvain Pion
1999-06-30 15:43 ` Toon Moene

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).