# System stack error in Signals

**URL:** <https://www.ruby-forum.com/t/system-stack-error-in-signals/68289>\
**Category:** Ruby\
**Created:** [September 11, 2006, 2:12pm UTC](https://www.ruby-forum.com/t/system-stack-error-in-signals/68289 "2006-09-11T14:12:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hemant\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/8797f3/32.png) [@Hemant\_S](https://www.ruby-forum.com/u/Hemant_S)\
**Post date:** [September 11, 2006, 2:12pm UTC](https://www.ruby-forum.com/t/system-stack-error-in-signals/68289/1 "2006-09-11T14:12:07Z")

</div>

Why following code, should cause a SystemStackError(\* after i let it run  
for  
sometime, mostly till count=8000), while the equivalent C program runs  
forever without any problem:

count = 0  
Signal.trap(“ALRM”) {  
p count  
count += 1  
syscall(27, 1)  
}

Process.kill(“ALRM”, Process.pid)

t = Thread.new {  
msg = STDIN.gets.chomp  
}  
t.join

## –

The Road goes ever on and on  
Down from the door where it began.  
Now far ahead the Road has gone,  
And I must follow, if I can,  
Pursuing it with eager feet,  
Until it joins some larger way  
Where many paths and errands meet.  
And whither then? I cannot say.
