Skip to content

Update build deps#551

Merged
sodabrew merged 13 commits intoeventmachine:masterfrom
sodabrew:update_build_deps
Jan 27, 2015
Merged

Update build deps#551
sodabrew merged 13 commits intoeventmachine:masterfrom
sodabrew:update_build_deps

Conversation

@sodabrew
Copy link
Copy Markdown
Member

@sodabrew sodabrew commented Dec 1, 2014

Working through Travis failures seen in 3349891

@sodabrew
Copy link
Copy Markdown
Member Author

sodabrew commented Dec 1, 2014

Huh. Tests are consistently hanging and getting timed out after 10 minutes on Travis. Verbose isn't pointing to the problem just yet.

@sodabrew sodabrew force-pushed the update_build_deps branch 2 times, most recently from 2ee6110 to 65ed80f Compare December 12, 2014 23:51
@sodabrew
Copy link
Copy Markdown
Member Author

I updated to test-unit 3.0 and set it to verbose. Now I know that the tests are hanging here:

TestFileWatch: 
  test_events:                      

@sodabrew sodabrew force-pushed the update_build_deps branch 3 times, most recently from 10ab669 to af99792 Compare December 13, 2014 01:07
@sodabrew
Copy link
Copy Markdown
Member Author

Bunch of unit test fixes, this is looking better now! However #457 is absolutely still broken, both on my Mac (Ruby 2.0.0-p481) and on Travis Ubuntu 12.04 (Ruby 2.0.0-p598)

/home/travis/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/thread.rb:188:in `synchronize': Attempt to unlock a mutex which is not locked (ThreadError)
    from /home/travis/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/thread.rb:188:in `block in pop'
    from /home/travis/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/thread.rb:187:in `handle_interrupt'
    from /home/travis/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/2.0.0/thread.rb:187:in `pop'
    from /home/travis/build/eventmachine/eventmachine/lib/eventmachine.rb:1045:in `block in spawn_threadpool'

@sodabrew sodabrew force-pushed the update_build_deps branch 2 times, most recently from a4a2aa7 to 19f4c0b Compare December 13, 2014 01:25
@sodabrew
Copy link
Copy Markdown
Member Author

I think the hanging file watcher test is due to this Travis CI issue, wherein the OpenVZ simfs filesystem isn't sending inotify file deletion events: travis-ci/travis-ci#2342

@sodabrew sodabrew force-pushed the update_build_deps branch 6 times, most recently from cc3f270 to 4d87ea3 Compare December 13, 2014 18:13
@sodabrew
Copy link
Copy Markdown
Member Author

Only Rubinius and JRuby are failing now. I could mark them as allowed_failures to get the build green, which would help a lot for testing future pull requests.

I am testing JRuby in C extension mode. Should I try it in Pure Ruby mode, instead?

I can reproduce the Rbx failure locally; the tests that have some form of cpid = fork { sleep } the child is crashing.

@sodabrew
Copy link
Copy Markdown
Member Author

sodabrew commented Jan 3, 2015

Ping to @rubinius peeps - @brixen @yorickpeterse - Could you take a look at the Rbx failures in Travis and help me out? I'm trying to figure out why the forked process child explodes in some of these unit tests. Any advise or pointer in the right direction for debugging much appreciated!

@yorickpeterse
Copy link
Copy Markdown

I tried running the tests locally but some of them seem to hang as well. I'll take closer look (in particular using gdb) this Saturday to see what's going on.

@sodabrew sodabrew force-pushed the update_build_deps branch 3 times, most recently from 4c31190 to 394df85 Compare January 3, 2015 06:41
@sodabrew
Copy link
Copy Markdown
Member Author

sodabrew commented Jan 3, 2015

Open issues:

Ruby 2.0: thread.rb:188:insynchronize': Attempt to unlock a mutex which is not locked (ThreadError)` is a problem in Ruby.

Ruby 2.1, 2.2: I'm seeing test_dispatch_completion hang on Ruby 2.1 and 2.2 about 50% of the time. I don't know what's up yet, but I suspect this is a real problem.

I omitted a few more tests from JRuby that aren't implemented for that platform, but the remaining failures looks real. @tmm1 could you advise on what to do with JRuby?

Thanks @yorickpeterse for looking into the Rubinius fork failures!

@yorickpeterse
Copy link
Copy Markdown

Attached GDB to the most inner child process of the fork test that hangs, the backtrace output is as following: https://gist.github.com/YorickPeterse/e70846827ad9d9ef2f62. The list of threads and what they are doing is as following (in order of the GDB output):

  • Thread 8: Finalizer thread
  • Thread 7: Signal handler thread
  • Thread 6: JIT thread
  • Thread 5: Console requests
  • Thread 4: Console responses
  • Thread 3: Rbx metrics
  • Thread 2: Immix GC
  • Thread 1: Main thread

The main thread appears to be stuck in the following:

#0  0x00007fc830a91193 in select () from /usr/lib/libc.so.6
#1  0x00007fc83058e8e6 in _SelectDataSelect (v=0x7fff9999ea88) at ../../../../ext/em.cpp:824
#2  0x000000000088a1e1 in rb_thread_call_without_gvl (func=0x7fc83058e8c0 <_SelectDataSelect(void*)>, 
    data1=0x7fff9999ea88, ubf=<optimized out>, ubf_data=<optimized out>) at vm/capi/thread.cpp:179
#3  0x00007fc83058e099 in _Select (this=0x800) at ../../../../ext/em.cpp:836
#4  EventMachine_t::_RunSelectOnce (this=0x3d30050) at ../../../../ext/em.cpp:913
#5  0x00007fc83058d4f3 in _RunOnce (this=0x3d30050) at ../../../../ext/em.cpp:515
#6  EventMachine_t::Run (this=0x3d30050) at ../../../../ext/em.cpp:497
#7  0x00007fc830594e66 in t_run_machine_without_threads (self=12) at ../../../../ext/rubymain.cpp:223
#8  0x00000000008424a7 in invoke (state=<optimized out>, env=<optimized out>, nm=<optimized out>, args=...)
    at vm/builtin/native_method.cpp:223
#9  rubinius::NativeMethod::executor_implementation<rubinius::ZeroArguments> (state=0x3493660, 
    previous=<optimized out>, exec=0x7fc82d6a24d0, mod=<optimized out>, args=...)
    at vm/builtin/native_method.cpp:710

If I kill the process using GDB the test suite continues running and doesn't get stuck anywhere else by the looks of it. The final test output in this case is as following:

Run options: 

# Running tests:

[151/226] TestProcesses#test_em_system = 0.02 s                                                            
  1) Failure:
TestProcesses#test_em_system [/home/yorickpeterse/Private/Projects/ruby/eventmachine/tests/test_processes.rb:40]:
<nil> expected but was
<0>.

[153/226] TestProcesses#test_em_system_pid = 0.01 s                  
  2) Failure:
TestProcesses#test_em_system_pid [/home/yorickpeterse/Private/Projects/ruby/eventmachine/tests/test_processes.rb:51]:
<13470> expected but was
<nil>.

[155/226] TestProcesses#test_em_system_with_proc = 0.01 s               
  3) Failure:
TestProcesses#test_em_system_with_proc [/home/yorickpeterse/Private/Projects/ruby/eventmachine/tests/test_processes.rb:60]:
<nil> expected but was
<0>.

[169/226] TestResolver#test_localhost = 0.28 s                                
  4) Failure:
TestResolver#test_localhost [/home/yorickpeterse/Private/Projects/ruby/eventmachine/lib/em/resolver.rb:174]:
Failed assertion, no message given.

[208/226] TestSystem#test_system = 0.01 s                                  
  5) Failure:
TestSystem#test_system [/home/yorickpeterse/Private/Projects/ruby/eventmachine/tests/test_system.rb:21]:
<0> expected but was
<nil>.

[209/226] TestSystem#test_system_with_string = 0.01 s
  6) Failure:
TestSystem#test_system_with_string [/home/yorickpeterse/Private/Projects/ruby/eventmachine/tests/test_system.rb:35]:
<0> expected but was
<nil>.

Finished tests in 495.321605s, 0.4563 tests/s, 0.7248 assertions/s.     
226 tests, 359 assertions, 6 failures, 0 errors, 0 skips

ruby -v: rubinius 2.4.1.n349 (2.1.0 402d7259 2014-12-15 3.5.0 JI) [x86_64-linux-gnu]
rake aborted!
Command failed with status (6): [ruby -w -I"lib:tests:lib" -I"/home/yorickpeterse/.rubies/rbx-git/gems/gems/rake-10.4.2/lib" "/home/yorickpeterse/.rubies/rbx-git/gems/gems/rake-10.4.2/lib/rake/rake_test_loader.rb" "tests/**/test_*.rb" ]
kernel/bootstrap/proc.rb:20:in `call'
kernel/bootstrap/proc.rb:20:in `call'
kernel/bootstrap/array.rb:76:in `each'
/home/yorickpeterse/.rubies/rbx-git/gems/gems/rubysl-monitor-2.0.0/lib/rubysl/monitor/monitor.rb:211:in `synchronize (mon_synchronize)'
kernel/bootstrap/array.rb:76:in `each'
kernel/common/kernel.rb:497:in `load'
kernel/delta/code_loader.rb:66:in `load_script'
kernel/delta/code_loader.rb:152:in `load_script'
kernel/loader.rb:645:in `script'
kernel/loader.rb:799:in `main'
Tasks: TOP => test
(See full trace by running task with --trace)

@yorickpeterse
Copy link
Copy Markdown

Looking at the offending code (

sd->nSockets = select (sd->maxsocket+1, &(sd->fdreads), &(sd->fdwrites), &(sd->fderrors), &(sd->tv));
) I'm not really sure how this would get stuck other than the handles used for select() not being available.

@yorickpeterse
Copy link
Copy Markdown

@sodabrew To recap, the fork tests do work on MRI, or do they also hang at random times?

@sodabrew
Copy link
Copy Markdown
Member Author

sodabrew commented Jan 3, 2015

Thanks for digging in! Yes, the fork tests work on MRI.

@sodabrew
Copy link
Copy Markdown
Member Author

I've rebased this branch to remove the Rubinius popen work. That will be a separate PR.

Ruby 2.0 may fail at Queue.pop, so rescue and complain to $stderr

The message is "Attempt to unlock a mutex which is not locked (ThreadError)" and it is caused by a bug in Ruby 2.0. Annoying people with $stderr is arguably better than crashing their app. That said, it might not be worth the loud error because the Queue does not appear to drop any tasks even when this occurs.

@sodabrew sodabrew self-assigned this Jan 21, 2015
sodabrew added a commit that referenced this pull request Jan 27, 2015
Update test-unit dependency and make various test fixes
@sodabrew sodabrew merged commit a87f440 into eventmachine:master Jan 27, 2015
@sodabrew sodabrew deleted the update_build_deps branch January 27, 2015 20:48
@sodabrew sodabrew added this to the v1.0.5 milestone Feb 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants