summaryrefslogtreecommitdiff
path: root/error.c
AgeCommit message (Collapse)Author
2015-02-03error.c: fix r49479nobu
* error.c (rb_mod_sys_fail_str): copy the given format. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-03remove duplication in warningnobu
* dir.c (sys_warning_1): remove duplication in the message. * error.c (rb_mod_sys_fail_str): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-24ruby.h: parent in rb_data_type_tnobu
* ruby.h (rb_data_type_t): revert r48647 and revise parent member. [ruby-core:66969] [Bug #10621] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-01use 0 for reservednobu
use 0 for rb_data_type_t::reserved instead of NULL, since its type may be changed in the future and possibly not a pointer type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-29ruby.h: no parent in rb_data_type_tnobu
* error.c (rb_typeddata_is_kind_of, rb_check_typeddata): ditto. * error.c (rb_typeddata_inherited_p): deprecate. still keep for potential binary compatibility. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-29error.c: simplify message buildingnobu
* error.c (syserr_initialize): simplify message building and get rid of potential invalid byte sequence. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-25rb_id2str over rb_id2namenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-16id.def: move IDs for exceptionnobu
* defs/id.def: add :mesg and :exception and move from other sources. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* internal.h: Include ruby.h and ruby/encoding.h to beakr
includable without prior inclusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15vm_eval.c: UncaughtThrowErrornobu
* vm_eval.c (rb_throw_obj): throw UncaughtThrowError instead of ArgumentError. [Feature #10480] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-20error.c: check if EWOULDBLOCK is definednobu
* error.c (set_syserr): EWOULDBLOCK may not be defined, check if defined first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-14* error.c: [DOC] Fix case of type in exception message by @tricknoteszzak
[Fixes GH-740] https://github.com/ruby/ruby/pull/740 * object.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-06* error.c: update exception tree. [DOC]usa
reported by @hemge via twitter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-19error.c: preserve encodingnobu
* error.c (rb_error_frozen_object): preserve encoding of class name in error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-03Init functions don't need ID cachesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-02encoding.h: constify rb_encodingnobu
* include/ruby/encoding.h: constify `rb_encoding` itself, not only arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-01constify rb_encoding and OnigEncodingnobu
* include/ruby/encoding.h: constify `rb_encoding` arguments. * include/ruby/oniguruma.h: constify `OnigEncoding` arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-25report bug with machine regisitersnobu
* error.c (rb_bug_context): new function to report bug with context. * vm_dump.c (rb_vm_bugreport): accepts `ucontext_t` argument to dump machine regisiters. based on [GH-584]. * signal.c (sigbus, sigsegv): dump machine regisiters if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-12error.c: Crash Report lognobu
* error.c (REPORTBUG_MSG): mention about Crash Report log file on MacOS X. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-03* error.c: [DOC] Exception#cause may return nil. [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-31* error.c: [DOC] Document Exception#cause by @jasonrclark [ci skip]zzak
[Fixes GH-519] https://github.com/ruby/ruby/pull/519 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13* error.c: add Exception#backtrace_locations.ko1
Now, there are no setter and independent from Exception#backtrace. [Feature #8960] * eval.c (setup_exception): set backtrace locations for `bt_location' special attribute. * vm_backtrace.c (rb_backtrace_to_location_ary): added. * internal.h: ditto. * test/ruby/test_backtrace.rb: add a test for Exception#backtrace_locations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-10error.c: Exception#causenobu
* error.c (exc_cause): captured previous exception. * eval.c (make_exception): capture previous exception automagically. [Feature #8257] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29* add RUBY_TYPED_FREE_IMMEDIATELY to data types which only useko1
safe functions during garbage collection such as xfree(). On default, T_DATA objects are freed at same points as fianlizers. This approach protects issues such as reported by [ruby-dev:35578]. However, freeing T_DATA objects immediately helps heap usage. Most of T_DATA (in other words, most of dfree functions) are safe. However, we turned off RUBY_TYPED_FREE_IMMEDIATELY by default for safety. * cont.c: ditto. * dir.c: ditto. * encoding.c: ditto. * enumerator.c: ditto. * error.c: ditto. * file.c: ditto. * gc.c: ditto. * io.c: ditto. * iseq.c: ditto. * marshal.c: ditto. * parse.y: ditto. * proc.c: ditto. * process.c: ditto. * random.c: ditto. * thread.c: ditto. * time.c: ditto. * transcode.c: ditto. * variable.c: ditto. * vm.c: ditto. * vm_backtrace.c: ditto. * vm_trace.c: ditto. * ext/bigdecimal/bigdecimal.c: ditto. * ext/objspace/objspace.c: ditto. * ext/stringio/stringio.c: ditto. * ext/strscan/strscan.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28error.c: remove NameError#to_snobu
* error.c (name_err_to_s): remove no longer needed overriding, since r30455 which made exc_to_s almost same. Fixes [GH-413]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-20internal.h: rb_syserr_fail_pathnobu
* error.c (rb_syserr_fail_path_in): new function split from rb_sys_fail_path_in to raise SystemCallError without errno. * internal.h (rb_syserr_fail_path): like rb_sys_fail_path but without errno. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16* error.c (rb_bug_reporter_add): return simply 0 if failed.ko1
Please check return value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16* error.c, internal.h (rb_bug_reporter_add): add a new C-API.ko1
rb_bug_reporter_add() allows to register a function which is called at rb_bug() called. * ext/-test-/bug_reporter/bug_reporter.c: add a test for this C-API. * ext/-test-/bug_reporter/extconf.rb: ditto. * test/-ext-/bug_reporter/test_bug_reporter.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03Revert r42800 "* error.c: [DOC] Update bug tracker url by @ScotterC [Fixes ↵naruse
GH-390]" It should be fixed on www.ruby-lang.org side. * [Bug #8854] * ruby/www.ruby-lang.org#288 https://github.com/ruby/www.ruby-lang.org/issues/288 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-03* error.c: [DOC] Update bug tracker url by @ScotterC [Fixes GH-390]zzak
https://github.com/ruby/ruby/pull/390 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-18* error.c, object.c, ext/readline/README.ja: [DOC] $SAFE=4 is obsolete.ktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-18* error.c, file.c, gc.c, hash.c, thread.c, variable.c, vm_eval.c, bin/erb:ktsj
$SAFE=4 is obsolete. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-20error.c: evaluate RARRAY_AREF oncenobu
* error.c (rb_check_backtrace): evaluate RARRAY_AREF only once. the first argument of RB_TYPE_P is expanded twice for non-immediate types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07* internal.h (numberof): Gathered from various files.akr
* array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c, load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c, error.c, ruby.c: Remove the definitions of numberof. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02fill rdocsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-01error.c: better names for rb_exc_new familynobu
* error.c (rb_exc_new_cstr): rename from rb_exc_new2. * error.c (rb_exc_new_str): rename from rb_exc_new3. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* include/ruby/ruby.h: constify RBasic::klass and addko1
RBASIC_CLASS(obj) macro which returns a class of `obj'. This change is a part of RGENGC branch [ruby-trunk - Feature #8339]. * object.c: add new function rb_obj_reveal(). This function reveal interal (hidden) object by rb_obj_hide(). Note that do not change class before and after hiding. Only permitted example is: klass = RBASIC_CLASS(obj); rb_obj_hide(obj); .... rb_obj_reveal(obj, klass); TODO: API design. rb_obj_reveal() should be replaced with others. TODO: modify constified variables using cast may be harmful for compiler's analysis and optimizaton. Any idea to prohibt inserting RBasic::klass directly? If rename RBasic::klass and force to use RBASIC_CLASS(obj), then all codes such as `RBASIC(obj)->klass' will be compilation error. Is it acceptable? (We have similar experience at Ruby 1.9, for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)". * internal.h: add some macros. * RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal object. * RBASIC_SET_CLASS(obj, cls) set RBasic::klass. * RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS without write barrier (planned). * RCLASS_SET_SUPER(a, b) set super class of a. * array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c, file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c, parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c, string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c: Use above macros and functions to access RBasic::klass. * ext/coverage/coverage.c, ext/readline/readline.c, ext/socket/ancdata.c, ext/socket/init.c, * ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* *.c, parse.y, insns.def: use RARRAY_AREF/ASET macroko1
instead of using RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-08* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-08Fix #6154 by introducing new EAGAIN/EWOULDBLOCK/EINPROGRESSheadius
subclasses that include WaitReadable or WaitWritable rather than extending them into the exception object each time. * error.c: Capture EGAIN, EWOULDBLOCK, EINPROGRESS exceptions and export them for use in WaitReadable/Writable exceptions. * io.c: Create versions of EAGAIN, EWOULDBLOCK, EINPROGRESS that include WaitReadable and WaitWritable. Add rb_readwrite_sys_fail for nonblocking failures using those exceptions. Use that function in io_getpartial and io_write_nonblock instead of rb_mod_sys_fail * ext/openssl/ossl_ssl.c: Add new SSLError subclasses that include WaitReadable and WaitWritable. Use those classes for write_would_block and read_would_block instead of rb_mod_sys_fail. * ext/socket/ancdata.c: Use rb_readwrite_sys_fail instead of rb_mod_sys_fail in bsock_sendmsg_internal and bsock_recvmsg_internal. * ext/socket/init.c: Use rb_readwrite_sys_fail instead of rb_mod_sys_fail in rsock_s_recvfrom_nonblock and rsock_s_connect_nonblock. * ext/socket/socket.c: Use rb_readwrite_sys_fail instead of rb_mod_sys_fail in sock_connect_nonblock. * include/ruby/ruby.h: Export rb_readwrite_sys_fail for use instead of rb_mod_sys_fail. Introduce new constants RB_IO_WAIT_READABLE and RB_IO_WAIT_WRITABLE for first arg to rb_readwrite_sys_fail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-15error.c: rb_sys_fail_path_innobu
* error.c (syserr_initialize): add optional function name. * error.c (rb_sys_fail_path_in): rename and move from file.c, and pass func_name to SystemCallError#initialize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-25* error.c: clarify reason for sleep in SignalException examplezzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-25* error.c: clarify a document of SignalException. Process.kill()kosaki
doesn't have any guarantee when signal will be delivered. [Bug #7951] [ruby-core:52864] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-29* object.c: Improve error for failed implicit conversions [Bug #7539]marcandre
* error.c: Adapt rdoc * test/ruby/test_object.rb: Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-25error.c: rb_write_error_strnobu
* error.c (compile_err_append, compile_warn_print, warn_print): use rb_write_error_str() instead of writing to rb_stderr directly. * io.c (rb_write_error_str): a stopgap measure not to unblock GVL. warning from require seems to still have race condition errors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-24error.c: NameError::message _dumpnobu
* error.c (name_err_mesg_dump): adapt argument number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-24error.c: VALUE to messagesnobu
* error.c (name_err_mesg_to_str, syserr_initialize): use VALUE to format messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-23* error.c (rb_compile_error_append): fix typo.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-22error.c: PRIsVALUEnobu
* error.c (rb_compile_error, rb_compile_warn, rb_compile_warning), (rb_warn, rb_warning): support PRIsVALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e