Coder Social home page Coder Social logo

brentr / matzruby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tmm1/matzruby

46.0 46.0 5.0 62.92 MB

The "MBARI" patches to the Matz Ruby Interpreter. See the Wiki for latest usage info.

Home Page: http://sites.google.com/site/brentsrubypatches

License: Other

Makefile 0.48% Ruby 60.06% Shell 0.07% C 35.09% Batchfile 0.08% sed 0.02% Roff 0.20% Assembly 0.01% HTML 2.09% Tcl 0.34% R 0.24% Emacs Lisp 0.47% Yacc 0.84% Perl 0.02%

matzruby's People

Contributors

akr avatar brentr avatar drbrain avatar eban avatar knu avatar kou avatar libc avatar mame avatar marcandre avatar matzbot avatar nobu avatar nurse avatar shugo avatar shyouhei avatar suketa avatar unak avatar znz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

matzruby's Issues

Segfault when forked Queue is being finalized by GC

The following code will cause an error when executed on the command line w/ MBARI api enabled:

ruby  -rthread -e 'q = Queue.new; Thread.new { q.pop }; pid = fork;  if pid.nil?; q = nil; GC.start; else; Process.wait(pid); end'

The error looks like

-e:1:in `start': wrong argument type Object (expected Thread) (TypeError)

In an active Ruby script / webapp, a segfault is likely to occur instead. The segfault occurs in rb_thread_check() in the forked child process, which is checking the validity of a pointer to a thread from the parent process before it kills the thread. (For full background, rb_thread_check() is being called by rb_thread_kill(), which is in turn being called by the Queue's object finalizer ext/thread/thread.c#free_queue() as the GC evicts the object) In the one liner example above, the pointer ends up pointing to another RVALUE, while in more complex cases the pointer's value is unknown.

Tested on branch v1_8_7_352-mbari, w/

./configure --enable-mbari-api CFLAGS="-O2 -fno-stack-protector"

and

./configure --with-wipe-sites=0x0000 --enable-mbari-api CFLAGS="-O2 -fno-stack-protector"

to ensure that stack wiping was not creating the problem.

Iterating through the commit list on v1_8_7_352-mbari has shown that the bug first appears after commit 32e862 . Testing on stock 1.8.7 does not show the bug, nor does testing on the 1.9 series.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.