#4144 new defect

fileio - Stack too small for login with password (cloned)

Reported by: Frank Kuehndel Owned by: joel@…
Priority: normal Milestone: 5.2
Component: test Version: 5
Severity: minor Keywords: fileio, stack, password, login, root
Cc: Blocked By:
Blocking:

Description

Cloned from #4143:


When I use the 'shell' from the fileio sample with the command below:

   env QEMU_AUDIO_DRV="none" \
   qemu-system-arm -no-reboot -net none -nographic -M realview-pbx-a9 -m 256M \
   -kernel build/arm/realview_pbx_a9_qemu/testsuites/samples/fileio.exe

The executable crashes with an "BLOWN STACK!!!" as soon as I try to login
as 'root' with password. (The logins without password work fine.) Increasing
the stack size of the affected thread a bit (to 5 times RTEMS_MINIMUM_STACK_SIZE) solves the issue.

How to reproduce:

  1. Start the fileio sample in QEMU with the above command.
  1. Type a key to stop the timer.
  1. Type "s" <return> to enter the shell.
  1. Login as "root" with the password printed to the terminal.
  1. In the line with the first shell prompt, the text "BLOWN STACK!!!" appears unexpectedly followed by further crash information.
[...]
/dev/foobar login: root
Password: 

RTEMS Shell on /dev/foobar. Use 'help' to list commands.
SHLL [/] # BLOWN STACK!!!
task control block: 0x00205278
[...]

Change History (1)

comment:1 Changed on Oct 12, 2020 at 1:27:26 PM by Joel Sherrill

At the risk of repeating myself, why do we ever use -O0 anymore now that GCC has -Og. From https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

-Og
Optimize debugging experience. -Og should be the optimization level of choice for the standard edit-compile-debug cycle, offering a reasonable level of optimization while maintaining fast compilation and a good debugging experience. It is a better choice than -O0 for producing debuggable code because some compiler passes that collect debug information are disabled at -O0.

Like -O0, -Og completely disables a number of optimization passes so that individual options controlling them have no effect. Otherwise -Og enables all -O1 optimization flags except for those that may interfere with debugging:

-fbranch-count-reg  -fdelayed-branch 
-fdse  -fif-conversion  -fif-conversion2  
-finline-functions-called-once 
-fmove-loop-invariants  -fssa-phiopt 
-ftree-bit-ccp  -ftree-dse  -ftree-pta  -ftree-sra

I don't have problem with increasing the configured minimum stack size value for this sample. It would be better than tinkering with individual create invocations. But if -O0 is the culprit, let's just switch away from it.

Note: See TracTickets for help on using tickets.