Re: [Wxlua-users] wxLua win98 memory allocation error..
On 6/9/06, Steve Kieu [EMAIL PROTECTED] wrote: All right, I fixed this but not understand why ; You may have the answer though lol What I did is; after comapring liles by lines with wxLua.cpp then add extern bool wxLuaBinding_wxstc_init(); and init it of course wxLuaBinding_wxstc_init(); as I saw that is the only main difference between wxlua and my exe file. Result: No longer the f*** message wxLua: Memory allocation error in any script it runs. Why I need stc where I did not use any of them in lua script. And why this error only happen in win98? It is mysterious. That is so bizarre! If you don't want the stc lib then just don't link to it and remove the init function call. I can't for the life of me think why there would be a problem if you link to it, but don't actually use it. Thank you for your replies now I can sleep well tonight :-) :) If you ever figure out what the problem is please tell us! Thanks, John Labenski ___ Wxlua-users mailing list Wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users
Re: [Wxlua-users] wxLua win98 memory allocation error..
Thanks, just a sound - silly question :-) , If I add my custom binding to wxLua (in my application code, basically I have my own .i files, and genwxlua.sh etc..to generate my own set of bindings in different lua namespace, such as cl. similar like wx. ) does it in anyway to change the way that wxLua allocate memory? It seems that the heap for wxLua runs out in win98, even phisical memory is still available. Still the combination: my exe ; a sqlite3 module loaded, and a relatively big table with strings or similar will gives wxLua Memory allocation error.But use the origin wxlua.exe, things are fine. Iwill try to remove the custom binding now to see if it helps. cheersS.KIEU Send instant messages to your online friends http://au.messenger.yahoo.com ___ Wxlua-users mailing list Wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users
Re: [Wxlua-users] wxLua win98 memory allocation error..
On 6/8/06, Steve Kieu [EMAIL PROTECTED] wrote: Still the combination: my exe ; a sqlite3 module loaded, and a relatively big table with strings or similar will gives wxLua Memory allocation error. Hummm, you mean a lua table created and used in lua? No ideas... Yeah the lua table, created and used in lua. Very strange indeed, it gives error even before running it; Lets say: 1 Load sqlite3 and init stuff 2. wx.wxMessageDialod(Check to see if it reaches here) 3. local sql_strs={} 4. many table.insert(sql_strs, sql string here) 6. even not do anything with table here, just end script Run the file, got error, line 2. not reached. What is the error exactly? The memory allocation something or other? If comment out 4 no error. If not load the sqlite3 modules no error. of course the solution is easy, just put a text file each line has a sql command and iterate io.lines() on it ; it works. But you know it is one example of correct usage Try using wxLuaFreeze and require for the sqlite3 module and your code. Does this fail? Another case that it gives error is the following simple echo server local socket=requiresocket local copas=requirecopas local host = host or localhost local port = port or 8080 if arg then host = arg[1] or host port = arg[2] or port end local function handle_server(skt) skt=copas.wrap(skt) table.foreach (skt,print) -- If client do not send quit command it will loop forever :-) while true do -- local line, err = copas.receive(skt) local line, err=skt:receive() print(line, err) if line==quit then break end end end print(Binding to host ' ..host.. ' and port ..port.. ...\n) local server = assert(socket.bind(host, port)) local i, p = server:getsockname() assert(i, p) print(i, p,\n) copas.addserver(server, handle_server) copas.loop() Last night I have removed all custom bindings but in the exe one still have two wxLuaState one in main thread, the other is in a another thread to run a log.lua to process log that wxLuaEvent sends (I like that way); this time the simpler server works but the script using sqlite3 still failled. I'm guessing the sqlite3 module has problems then. About the picker, I just add a quick code to use it so it is not concrete yet at least I think, it does not check conditions wxLuaUseXXX etc.. Ok, I'll probably wait until I get a new wxWidgets checkout and add them all then. -John Labenski ___ Wxlua-users mailing list Wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users
Re: [Wxlua-users] wxLua win98 memory allocation error..
All right, I fixed this but not understand why ; You may have the answer though lolWhat I did is; after comapring liles by lines with wxLua.cpp then add extern bool wxLuaBinding_wxstc_init();and init it of coursewxLuaBinding_wxstc_init();as I saw that is the only main difference between wxlua and my exe file. Result: No longer the f*** message wxLua: Memory allocation error in any script it runs.Why I need stc where I did not use any of them in lua script. And why this error only happen in win98? It is mysterious.Thank you for your replies now I can sleep well tonight :-)Cheers,S.KIEU Send instant messages to your online friends http://au.messenger.yahoo.com ___ Wxlua-users mailing list Wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users
Re: [Wxlua-users] wxLua win98 memory allocation error..
On 6/4/06, Steve Kieu [EMAIL PROTECTED] wrote: I have repeatedly got the message when running the app in win98. With window 2000 and above, no problem. The app is like: at wxWidget app, at OnInit I start a wxLuaState and call run a file which is an command line argument. I have a wxThread class in c++ which just very simple thread to spawn another wxLuaState and run a file.lua . This class is accessible in lua script. Basically the first arg is the main window to open the GUI, and there is a menu to allow the thread to run another lua file in a different thread ; a server process. Everything works as expected in win2k . XP, but not win98. Even I do not have thread at all; just use wxLua and run the server script, which is a non GUI apps it gives the memory allocation error as well. However if I use the lua50.exe interprepter it works just fine so at the moment I have to wrap it using os.execute() call and use lua50.exe. Is there any GUI conflict if we use wxLua to run a Non GUI script in win98? Not that I know of. It sounds like you know that you cannot call GUI functions from a thread, so if you're not doing any GUI stuff in the thread wxLuaState there shouldn't be a problem. Can you debug this? It would be nice to fix, but I regularly use multiple wxLuaStates without any problems. I just ran valgrind in Linux and I get the usual X windows and GDK errors, which is a shame, but nothing from wxLua. Perhaps you could just make this simple test and see if it works? wxApp::OnInit() { wxLuaState l1(true); wxLuaState l2(true); Regards, John Labenski ___ Wxlua-users mailing list Wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users
Re: [Wxlua-users] wxLua win98 memory allocation error..
<[EMAIL PROTECTED]>Not that I know of. It sounds like you know that you cannot call GUIfunctions from a thread, so if you're not doing any GUI stuff in thethread wxLuaState there shouldn't be a problem.Yes, the server process is non gui stuff. Even when there is only one thread, that is I ran the server process alone or any non GUI script, with wxlua.exe it failled. very simple thing like print"" or io.write("smt")<[EMAIL PROTECTED]>But runs lua50.exe (download from luabinaries) is fine, of course now I can not run wxLua code :-)<[EMAIL PROTECTED]><[EMAIL PROTECTED]>wxApp::OnInit(){ wxLuaState l1(true); wxLuaState l2(true);I will and let you know later. One thing might be the problem, the win98 I tested is running from vmware ; any chances that vmmon (the memory allocation modules of vmware) is buggy? Unfortunately I do not have a phisical win98 box to test furthur.The winXP and 2k I tested are real ones though.catch u later,S.KIEU Send instant messages to your online friends http://au.messenger.yahoo.com ___ Wxlua-users mailing list Wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users
Re: [Wxlua-users] wxLua win98 memory allocation error..
Okay It might be a compiled problem with sqlite3 module; in the script if I comment out the line to load it, it runs. But in another script, it load sqlite3 just fine.so for now I assume it is that library problem. Or sqlite3 problem in win98.CheersS.KIEU Send instant messages to your online friends http://au.messenger.yahoo.com ___ Wxlua-users mailing list Wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users
Re: [Wxlua-users] wxLua win98 memory allocation error..
Ok, thanks for the info. The compilation and linking problems are very tough to sort out. I remember a long time ago when wxWidgets changed their compilation flags, a program of mine would crash with absolutely no backtrace and nothing seemed wrong at all. It was just lucky that I thought of the flags and after comparing all the different ones for the libraries I was using and making them the same did things work normally again. Good luck, John Labenski On 6/7/06, Steve Kieu [EMAIL PROTECTED] wrote: Okay It might be a compiled problem with sqlite3 module; in the script if I comment out the line to load it, it runs. But in another script, it load sqlite3 just fine. so for now I assume it is that library problem. Or sqlite3 problem in win98. Cheers S.KIEU Send instant messages to your online friends http://au.messenger.yahoo.com ___ Wxlua-users mailing list Wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users ___ Wxlua-users mailing list Wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users