syslog_ident is allocated by malloc in strdup, so this should be wrong
funny-falcon
added a note
strdup is overwritten by #include "ruby/util.h" on top of syslog.c
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
I think data->name is not allocated anything, isn't it?
funny-falcon
added a note
Well, yes. This line is a my mistake, which is not exposed cause data->name is not allocated at this point. By the way: we could call #initialize on a live object, so that
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
I watched to r3428cfunc.c
and syslog.c
should be also fixed, cause they produce SIGSEGV while make check
.
I don't merge ruby_mimmalloc because I can't understand why it is needed, and temporally fix with free(3).
Your "temporary fix" is not workable: make test
fails on test_class.rb
(SIGSEGV).ruby_mimmalloc
is unavoidable because only main thread is allocated with malloc
, all other are allocated with ruby_xmalloc
.
Updated pull request #79
|
nurse |
* gc.c (rb_objspace_free): global_List is allocated with xmalloc.
…
patched by Sokolov Yura. ruby#78 * dln_find.c: remove useless replacement of free. * ext/readline/readline.c (readline_attempted_completion_function): strings for readline must allocated with malloc. * process.c (run_exec_dup2): use free; see also r20950. * re.c (onig_new_with_source): use malloc for oniguruma. * vm.c (ruby_vm_destruct): use free for VMs. * vm.c (thread_free): use free for threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
88b16ce
|
|
nurse |
* gc.c (rb_objspace_free): global_List is allocated with xmalloc.
…
patched by Sokolov Yura. ruby#78 * dln_find.c: remove useless replacement of free. * ext/readline/readline.c (readline_attempted_completion_function): strings for readline must allocated with malloc. * process.c (run_exec_dup2): use free; see also r20950. * re.c (onig_new_with_source): use malloc for oniguruma. * vm.c (ruby_vm_destruct): use free for VMs. * vm.c (thread_free): use free for threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e |
5e58aef
|
@@ -49,7 +49,7 @@ static VALUE mSyslog_close(VALUE self) | ||
closelog(); | ||
- free((void *)syslog_ident); | ||
+ xfree((void *)syslog_ident); | ||
syslog_ident is allocated by malloc in strdup, so this should be wrong
funny-falcon
added a note
strdup is overwritten by #include "ruby/util.h" on top of syslog.c
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
||
syslog_ident = NULL; | ||
syslog_options = syslog_facility = syslog_mask = -1; | ||
syslog_opened = 0; | ||
Fix inconsistent usage of xmalloc/xfree and malloc/free in ruby-trunk.
Errors founded with CALC_EXACT_MALLOC_SIZE set to 1.
make check
now works on Ubuntu 11.04 without crashes and has exactly same failures as ruby-trunk.Didn't test Windows related libraries.
Patch reverts Oniguruma to use ruby_xmalloc and ruby_xfree. I did not test how it affects performance.