From: Daniel Berger Date: 2006-05-28T14:05:44+09:00 Subject: String segfault with wide character function, Windows Ruby 1.8.4 (one click) Windows XP Check this out segfault: # strtest.rb require 'Win32API' GetFullPathNameW = Win32API.new('kernel32','GetFullPathNameW','PLPP', 'L') path = "C:\\test" buf = 0.chr * 260 if GetFullPathNameW.call(path, buf.size, buf, 0) == 0 puts "Failed" end #p buf p buf.split("\0\0").first # boom! # Result strtest.rb:13: [BUG] Segmentation fault ruby 1.8.4 (2005-12-24) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. I noticed that if I dropped the 'buf' to 245 or fewer characters, it works ok. Also, it segfaults on just about any op that modifies buf, not just String#split. Any ideas? Thanks, Dan