[Bug 1879154] [NEW] stack-size option ignored by g++-9

Paul Jurczak pauljurczak at hotmail.com
Sun May 17 13:12:52 UTC 2020


Public bug reported:

I was encouraged to repost my stackoverflow question here
(https://stackoverflow.com/questions/61709726). In case stack-size
option is not implemented for this particular environment, a warning
would be helpful.

-------------------------

I'm building a test program with g++ 9.3.0 on Ubuntu 18.04 x64 using
this linker command:

/usr/bin/g++-9  -O3 -DNDEBUG  -Wl,-z,stack-size=268435456
CMakeFiles/af.dir/main.cpp.o  -o af

I'm testing increased stack requirements with this function:

float f() {
  float a[3'000'000];
  return a[42];
}

and results indicate a standard 8MB stack regardless of the stack-size
linker option value. What is the way to increase the stack size?

EDIT

The test is as follows:

float a[3'000'000]; causes Segmentation fault (core dumped)
float a[2'000'000]; returns 0 as expected

** Affects: binutils (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to binutils in Ubuntu.
https://bugs.launchpad.net/bugs/1879154

Title:
  stack-size option ignored by g++-9

Status in binutils package in Ubuntu:
  New

Bug description:
  I was encouraged to repost my stackoverflow question here
  (https://stackoverflow.com/questions/61709726). In case stack-size
  option is not implemented for this particular environment, a warning
  would be helpful.

  -------------------------

  I'm building a test program with g++ 9.3.0 on Ubuntu 18.04 x64 using
  this linker command:

  /usr/bin/g++-9  -O3 -DNDEBUG  -Wl,-z,stack-size=268435456
  CMakeFiles/af.dir/main.cpp.o  -o af

  I'm testing increased stack requirements with this function:

  float f() {
    float a[3'000'000];
    return a[42];
  }

  and results indicate a standard 8MB stack regardless of the stack-size
  linker option value. What is the way to increase the stack size?

  EDIT

  The test is as follows:

  float a[3'000'000]; causes Segmentation fault (core dumped)
  float a[2'000'000]; returns 0 as expected

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/1879154/+subscriptions



More information about the foundations-bugs mailing list