Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Ruby hangs on OSX

2 views
Skip to first unread message

Mariano Kamp

unread,
Nov 22, 2006, 9:39:02 AM11/22/06
to
Hi,

I encountered a strange problem.

When running "ruby soduku_test.rb -n test_next_cell" the process
hangs and eats up all of the assigned CPU . I have no idea why that
is ... I asked a friend to run it on windows and it does work there.
The program yield in a stack overflow.

I recently reinstalled my computer and used darwinports. I don't
think that I've seen that problem before. I also reinstalled ruby
again, but with not much success and the same thing happens on
another Mac too.

Installing ruby the way I used to do it before, using the
hivelogic tutorial, also didn't work.

That are the versions that fail:

ruby 1.8.5 (2006-08-25) [i686-darwin8.8.3] # darwin ports 1.3.1,
gcc 4.0
ruby 1.8.4 (2005-12-24) [i686-darwin8.8.3] # directly from the
sources (hivelogic tutorial)
ruby 1.8.2 (2004-12-25) [universal-darwin8.0] # comes with Tiger

Both Macs (MB C2D, MBP CD) are running OSX 10.4.8 with all updates.

uname -v:
Darwin Kernel Version 8.8.3: Wed Oct 18 21:57:10 PDT 2006;
root:xnu-792.15.4.obj~4/RELEASE_I386

A stack trace of the "working" run on Windows is below this mail.

I attached the code. Unfortunately I haven't been able to isolate
the problem, but at least the code consistently fails.

Any ideas? Can somebody please try it out on another Mac? I will
also do that later on.

Cheers,
Mariano

sudoku_test.rb
sudoku.rb

Mariano Kamp

unread,
Nov 23, 2006, 5:10:07 PM11/23/06
to
Hi,

still not sure what the problem really is about. As nobody
answered I assume this is something with my two described fresh
installs?

Anyway ... What I found is that reducing the stack size from 8192
to 4096 with "ulimit -s 4096" it works. I get the stacklevel too deep
error.

Now I am wondering what the "right" value and why is nobody else
hitting that wall?

Cheers,
Mariano

> <sudoku_test.rb>
> <sudoku.rb>
>
>
> 1) Error:
> test_next_cell(SudokuTests):
> SystemStackError: stack level too deep
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:344:in `deq'
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:343:in `deq'
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:171:in
> `break_outmost_groups'
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:197:in `text'
> C:/dev/ruby/lib/ruby/1.8/pp.rb:258:in `pretty_print_cycle'
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:224:in `group'
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:247:in `nest'
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:223:in `group'
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:235:in `group_sub'
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:222:in `group'
> [.. tons of repetition ]
> C:/dev/ruby/lib/ruby/1.8/pp.rb:142:in `object_address_group'
> C:/dev/ruby/lib/ruby/1.8/pp.rb:192:in `pp_object'
> C:/dev/ruby/lib/ruby/1.8/pp.rb:249:in `pretty_print'
> C:/dev/ruby/lib/ruby/1.8/pp.rb:126:in `pp'
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:224:in `group'
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:247:in `nest'
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:223:in `group'
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:235:in `group_sub'
> C:/dev/ruby/lib/ruby/1.8/prettyprint.rb:222:in `group'
> C:/dev/ruby/lib/ruby/1.8/pp.rb:126:in `pp'
> C:/dev/ruby/lib/ruby/1.8/pp.rb:69:in `pp'
> C:/dev/ruby/lib/ruby/1.8/pp.rb:105:in `guard_inspect_key'
> C:/dev/ruby/lib/ruby/1.8/pp.rb:69:in `pp'
> sudoku_test.rb:53:in `test_next_cell'
>
> 6 tests, 23 assertions, 0 failures, 1 errors


Mariano Kamp

unread,
Nov 24, 2006, 6:50:24 AM11/24/06
to
Btw. The strange behaviour is not limited to stack overflows.

I also see now an interesting style of error reporting:

localhost:~//code/sudoku mkamp$ ruby sudoku_tests.rb
sudoku_tests.rb:231: warning: parenthesize argument(s) for future
version
sudoku_tests.rb:232: warning: parenthesize argument(s) for future
version
Loaded suite sudoku_tests
Started
.E..E...EEE.type: code total: 150, empty: 28, code: 103, comment: 19
type: test total: 286, empty: 59, code: 222, comment: 5

craf...@gmail.com

unread,
Nov 26, 2006, 7:48:25 PM11/26/06
to
Hi Mariano,

Interestingly, the program you've sent around works for me on my G4
Powerbook using Ruby 1.8.4 built using Fink (same stack size you quoted
as well) - however I see the same problems you've described when
running the script under Linux (Debian testing, Ruby 1.8.4) and on my
Intel iMac at home (same environment & compiler as the G4, just
different architecture).

Looks like it's a cross platform problem. Anyone have any ideas what
might be wrong or what other info we could send in to help diagnose it
with?

Cheers,

Marcus

0 new messages