summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-12 03:12:37 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-12 03:12:37 +0000
commit34fb7d783045dd4bb7b6dd49e6a1e922b7b947ff (patch)
tree0cd24c8bc3e97479cba4b92fd21bf3037f9c61e7 /vm_dump.c
parenta52c63e420c6e30688f00790d39bb1f720b7be80 (diff)
Specify rlimits_core to prevent making core file
Stable fix for r38041. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/vm_dump.c b/vm_dump.c
index 6e4450c..c2fa33f 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -675,22 +675,21 @@ rb_vm_bugreport(void)
if (vm) {
int i;
VALUE name;
+ long len;
+ const int max_name_length = 1024;
+# define LIMITED_NAME_LENGTH(s) \
+ (((len = RSTRING_LEN(s)) > max_name_length) ? max_name_length : (int)len)
name = vm->progname;
- if (RB_TYPE_P(name, T_STRING)) {
- fprintf(stderr, "* Loaded script: %s\n", RSTRING_PTR(name));
- }
- else {
- fprintf(stderr, "* Loaded script: #<%s:%p>\n",
- rb_class2name(CLASS_OF(name)), (void *)name);
- }
+ fprintf(stderr, "* Loaded script: %.*s\n",
+ LIMITED_NAME_LENGTH(name), RSTRING_PTR(name));
fprintf(stderr, "\n");
fprintf(stderr, "* Loaded features:\n\n");
for (i=0; i<RARRAY_LEN(vm->loaded_features); i++) {
name = RARRAY_PTR(vm->loaded_features)[i];
if (RB_TYPE_P(name, T_STRING)) {
- fprintf(stderr, " %4d %s\n", i,
- RSTRING_PTR(name));
+ fprintf(stderr, " %4d %.*s\n", i,
+ LIMITED_NAME_LENGTH(name), RSTRING_PTR(name));
}
else {
fprintf(stderr, " %4d #<%s:%p>\n", i,