Fixed
Created: Mar 10, 2013
Updated: Dec 19, 2017
Resolved Date: Jan 21, 2014
Previous ID: LIN4-20005
Found In Version: 5.0
Fix Version: 5.0.1.12
Severity: Severe
Applicable for: Wind River Linux 5
Component/s: Userspace
Problem Description
======================
When CLONE_THREAD is used, the new process starts with the program counter pointing to the system call instruction, rather than the instruction immediately following it. This causes an infinite cascade (linear growth, not exponential) of thread creation, which quickly crashes when the threads start running and they're all using the same stack.
1 build a x86_64 project with qemu-kvm
2 deploy it on target
3 run following test case will crash qemu:
.global main
main:
ori r5, r0, 0x7d8f00
addi r6, r1, -32760
ori r7, r6, 0
ori r8, r6, 0
ori r9, r6, 0
ori r12, r0, 120
brki r14, 8
ori r12, r0, 1
brki r14, 8