From: Steve K. <ha...@ya...> - 2006-06-06 01:46:01
|
Hi, 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? Cheers, S.KIEU Send instant messages to your online friends http://au.messenger.yahoo.com |
From: John L. <jla...@gm...> - 2006-06-07 21:13:43
|
On 6/4/06, Steve Kieu <ha...@ya...> 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 |
From: Steve K. <ha...@ya...> - 2006-06-07 21:32:10
|
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. 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") But runs lua50.exe (download from luabinaries) is fine, of course now I can not run wxLua code :-) 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 |
From: John L. <jla...@gm...> - 2006-06-07 23:22:48
|
resending since I got a rejection message from SF saying they're blocking gmail accounts.... On 6/5/06, John Labenski <jla...@gm...> wrote: > On 6/4/06, Steve Kieu <ha...@ya...> 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 > |
From: Steve K. <ha...@ya...> - 2006-06-07 23:54:38
|
I think there is something wrong with compilers (VC7) in this case. I have recompiled wxlua; and now wxlua is ok. But my program still refuses to work. What the strange thing is, yestaerday I add wxDatePickerCtrl bind to my wxLua (in my application name space, so nothing related to wxLua origin) and my app stop working even in GUI script; but still work in another GUI script, so the rule is non GUI script gives error is not correct anymore. The error message is the same: memory allocation error. The difference between my app and wxLua is I add another lua namespace and bind some widgets , custom class to lua in that namespace. Again, everything works stable and flawlessly in w2k above . Compiled under winXP using VC7 (Visual Studio .NET 2003) ; optimization /O2 ; blended. wxWidgets Unicode built; and in w98 using unicows.lib link (could it be the problem? to answer this I probably have to recompile the whole tools without unicode support which is ..... ) yes the strange thing is now wxLua works as normal after recompile it. I will have to get bottom of this but it may take a while. ANy idea of best way to debug this will be very helpful. Cheers S.KIEU Send instant messages to your online friends http://au.messenger.yahoo.com |
From: Steve K. <ha...@ya...> - 2006-06-08 00:43:19
|
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 |
From: John L. <jla...@gm...> - 2006-06-08 02:28:14
|
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 <ha...@ya...> 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 > Wxl...@li... > https://lists.sourceforge.net/lists/listinfo/wxlua-users > > > |
From: Steve K. <ha...@ya...> - 2006-06-08 11:20:33
|
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. cheers S.KIEU Send instant messages to your online friends http://au.messenger.yahoo.com |
From: John L. <jla...@gm...> - 2006-06-08 16:01:45
|
On 6/8/06, Steve Kieu <ha...@ya...> wrote: > > 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. Not really. The wxLuaState just iterates through the binding list that was created by calling the wxLuaBinding_XXX_init() functions and runs the binding class function to push them into the lua_State. Very little, if any, memory is used for this binding process as all the C++ structures are already created in the wxLuaState so only new structures in the lua_State are allocated using the lua C API. > 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... > But use the origin wxlua.exe, things are fine. Iwill try to remove the > custom binding now to see if it helps. Yeah, that would be a good idea. The apps/wxlua program uses 3 bindings, wxwidgets, wxstc, and the wxluasocket bindings so if there was a problem with multiple bindings that program should show it too. Regards, John Labenski ps. Do you have the complete bindings to the picker controls? If so, could you post them and I'll add them. In fact if anything else is missing from wxWidgets itself we'd just assume add it rather than make you write your own. |
From: Steve K. <ha...@ya...> - 2006-06-09 03:35:46
|
> 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. 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 Another case that it gives error is the following simple echo server local socket=require"socket" local copas=require"copas" 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. 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.. I have tested it, it display ; can GetValue() can DynamicCast when using XRC; but not tested all other functions, as I am still busy with the win98 errors...; Just simply add %include "wx/datectrl.h" %enum wxDP_DEFAULT wxDP_SPIN wxDP_DROPDOWN wxDP_SHOWCENTURY wxDP_ALLOWNONE %endenum %class wxDatePickerCtrl, wxControl %constructor wxDatePickerCtrl(wxWindow *parent,wxWindowID id, const wxDateTime& date = wxDefaultDateTime, const wxPoint& pos = wxDefaultPosition,const wxSize& size = wxDefaultSize,long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,const wxValidator& validator = wxDefaultValidator, const wxString& name = wxDatePickerCtrlNameStr) bool GetRange(wxDateTime *dt1, wxDateTime *dt2) wxDateTime GetValue() void SetRange(const wxDateTime& dt1, const wxDateTime& dt2) void SetValue(const wxDateTime& dt) wxDateTime GetValue() %endclass into my custom .i file is all I have done. Will go to winXP now and continue to compile without the loging thread and see .... Cheers S.KIEU Send instant messages to your online friends http://au.messenger.yahoo.com |
From: John L. <jla...@gm...> - 2006-06-09 03:59:06
|
On 6/8/06, Steve Kieu <ha...@ya...> 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=require"socket" local copas=require"copas" 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 |
From: Steve K. <ha...@ya...> - 2006-06-09 05:16:29
|
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. 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 |
From: John L. <jla...@gm...> - 2006-06-09 15:06:52
|
On 6/9/06, Steve Kieu <ha...@ya...> 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 |