summaryrefslogtreecommitdiff
path: root/error.c
AgeCommit message (Collapse)Author
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
2012-11-11hash.c: refine error messagesnobu
* hash.c (rb_hash_s_create): refine error messages. * error.c (rb_builtin_class_name): share for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-02* error.c (exc_to_s, name_err_to_s, name_err_mesg_to_str): do notshugo
taint messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18fix typonobu
* error.c (rb_builtin_type_name): fix typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18error.c: map by indexnobu
* error.c (rb_builtin_type_name): map by index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-29rb_builtin_type_namenobu
* error.c (rb_builtin_type_name): extract from rb_check_type() for debug purpose. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-22error.c: rb_check_copyablenobu
* error.c (rb_check_copyable): new function, to ensure the target is not frozen and the source is not tainted nor untrusted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-20* error.c (err_append): rename err_append() to compile_err_append()ko1
and move definition body. err_append() is used only by compiling. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-29* error.c (exc_set_backtrace): Updated documentation to indicatedrbrain
set_backtrace allows a string as well as an array of strings. [ruby-trunk - Bug #6501] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-24sprintf.c: inspect by plusnobu
* sprintf.c (ruby__sfvextra): [EXPERIMENTAL] use inspect instead of to_s if plus flag is given. * vsnprintf.c (BSD_vfprintf): pass sign flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-24Feature #5896nobu
* vsnprintf.c (BSD_vfprintf): [EXPERIMENTAL] object representation in rb_enc_vsprintf(). [Feature #5896] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-24* vm_method.c (rb_method_defined_by): removed.ko1
nobu pointed out that rb_method_basic_definition_p() is enough for last commit. * error.c, eval_error.c: change for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-24* vm.c: add RubyVM::Backtrace object (btobj).ko1
Backtrace information contains an array consists of location information for each frames by string. RubyVM::Backtrace object is lightweight backtrace information, which contains complete information to generate traditional style backtrace (an array of strings) with faster generation. If someone accesses to backtrace information via Exception#backtrace, then convert a RubyVM::Backtrace object to traditonal style backtrace. This change causes incompatibility on marshal dumpped binary of Exception. If you have any trouble on it, please tell us before Ruby 2.0 release. Note that RubyVM::Backtrace object should not expose Ruby level. * error.c, eval.c, vm_eval.c: ditto. * internal.h: ditto. * eval_error.c: fix to skip "set_backtrace" method invocation in creating an exception object if it call a normal set_backtrace method (defined by core). * test/ruby/test_settracefunc.rb: fix for above change. * vm_method.c (rb_method_defined_by): added. This function checks that the given object responds with the given method by the given cfunc. * benchmark/bm_vm2_raise1.rb, benchmark/bm_vm2_raise2.rb: add to measure exception creation speed. raise1 create exception objects from shallow stack frame. raise2 create exception objects from deep stack frame. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23use RB_TYPE_P() instead of comparison of TYPE()nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-16* configure.in (RUBY_MSVCRT_VERSION): define on mingw too.nobu
* win32/Makefile.sub (config.h): prefix RT_VER with RUBY and make more descriptive to get rid of potential conflict. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13* eval_error.c (error_print): use RB_TYPE_P instead of TYPE.nobu
* error.c (rb_check_backtrace): ditto. * error.c (name_err_mesg_to_str): compare immediate values directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10* error.c (rb_enc_raise): new function to raise an exception withnobu
the message in the given encoding. patched by now (Nikolai Weibull) at [ruby-core:41160]. [Feature #5650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-07* error.c (rb_load_fail): should honor encoding.nobu
* load.c (load_failed): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-07rb_load_failnobu
* error.c (rb_load_fail): use path as a string, not char*. * internal.h: (rb_load_fail): moved from ruby/intern.h. * ruby.c (load_file_internal): fname cannot be NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e