Commit 57ae7ec1 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Add 10K stack offset for Linux binaries (not visible in checkStackUsage output)

parent e6c3edc5
......@@ -11,6 +11,10 @@ def report_partition_@_LOWER:Name_@():
@@ELSE@@
elf_binary = "../binaries/@_LOWER:Name_@"
@@END_IF@@
shift_offset = 0
@@IF@@ @_CPU_Platform_@ = PLATFORM_GENERIC_LINUX or @_CPU_Platform_@ = PLATFORM_NATIVE
shift_offset = 10000 # Linux tasks start at 10K that are 'hidden'
@@END_IF@@
if not os.path.exists(elf_binary):
print("[x] Failed to locate ELF binary:", elf_binary)
print("[x] Aborting...")
......@@ -27,7 +31,6 @@ def report_partition_@_LOWER:Name_@():
def check_task(task_name):
task_name_job = task_name + "_job"
print("[-] Checking", task_name_job, "...")
if task_name not in pohic_stack_of:
print("[!] WARNING: Unable to check stack usage of", task_name+"_job")
elif task_name_job not in stack_usage:
......@@ -35,7 +38,9 @@ def report_partition_@_LOWER:Name_@():
" is either recursive or missing in", elf_binary)
else:
reserved_stack = pohic_stack_of[task_name]
actual_stack = stack_usage[task_name_job]
actual_stack = stack_usage[task_name_job] + shift_offset
print("[-] Stack usage of %32s" % task_name, "is %7d /%7d" % (
actual_stack, reserved_stack))
if reserved_stack < actual_stack:
print("[x] ERROR: Stack usage of", task_name, "is", actual_stack,
"which is higher than", reserved_stack)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment