In some cases, __mbrtowc can enter in an infinite loop
|Reported by:||oco||Owned by:||axeld|
When compiling current ruby source tree, miniruby (a reduced version of ruby used in the build process) eat all the CPU when initializing his regex engine.
The kernel debugger show this call stack :
mbrtowc mblen ruby_re_mbcinit ruby_incpush init_load_path ruby_process_options ruby_options main
I will investigate more to identify in which special case this infinite loop occur.
Here is the current steps needed to reproduce the problem :
- get latest ruby source tree : svn co http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8
- apply the patch ruby_on_haiku_06_04_2008.diff (see attached files)
- run autoconf
The second file is an evil "workaround" based on the previous "dummy" implementation. This enable a complete build of ruby under haiku. If you are not sure about the "evilness", look at the file size...