From: "zarawesome@..." Date: 2004-11-30T12:22:48+09:00 Subject: Re: multiple rb_require()s causing segmentation fault leon breedt wrote: > On Tue, 30 Nov 2004 11:17:49 +0900, zarawesome@gmail.com > wrote: > > On the face of it, I can't immediately see the cause of the segfault, > though I suspect you may have memory corruption somewhere else, which > is just being exposed by ScriptLoadFile. I do not see where such a memory corruption would happen, though, given all the Ruby initialization is at the very start of the code. > > There are some problems with the code you gave, though: > > > char *filename_safe_require; > ^^^ not a good idea, thread-unsafe, so you'll run into problems when > Ruby starts supporting native OS threads, and you're exporting the > symbol "filename_safe_require", which may not strictly be necessary. > it will be safer to use stack-allocated storage for the parameter > passing from ScriptLoadFile. Altering it does not affect the problem in any way. > > void ScriptLoadFile(char *filename) > this does not match up with the way you are calling ScriptLoadFile > (you are passing a second parameter in your invocations). You have probably noticed the code has been edited down. The second parameter has no function at the moment.