Re: wxLua crashes when mouse hover on the frame window :-(

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: wxLua crashes when mouse hover on the frame window :-(

Stefan Reich
This is an older question (from Nov 2010), but I think it might not
have been answered satisfyingly back then, and I just had the same
problem and found a simple solution that might be the one the OP was
looking for.

The trick seems to be in the file extension. If you call your script
something.lua and run it by doubleclick, it will crash (on the first
mouse hover event). If you call the script something.wlua (with a w),
it runs fine.

Alternatively, if you invoke the interpreter explicitly, it depends on
whether you run lua.exe or wlua.exe.

I'm not sure why lua.exe pretends to be wx-capable... but then it's
actually not and it just crashes. Shouldn't that be changed? Either
reject wx apps right away... or make them run properly I'd say.

I'd suggest this be improved in the next version... it would
definitely help newbies and, well, lua.exe crashing is a pretty ugly
sight. Don't you agree?

Cheers :)
Stefan


> the same dll file, and the same script, but my wxlua program crashes when the mouse hover on the *any* window that shows on screen :-(.
>
> but the script acts great on other guys computer.
>
> hope anybody knows how this happened...  I use Windows XP and Lua For WIndows 5.1..

Reply | Threaded
Open this post in threaded view
|

Re: wxLua crashes when mouse hover on the frame window :-(

John Labenski
On Tue, Aug 2, 2011 at 4:20 PM, Stefan Reich
<[hidden email]> wrote:
> The trick seems to be in the file extension. If you call your script
> something.lua and run it by doubleclick, it will crash (on the first
> mouse hover event). If you call the script something.wlua (with a w),
> it runs fine.

This is completely dependent on your OS's default action to take for
the two different file extensions. What exactly is being run for each?

> Alternatively, if you invoke the interpreter explicitly, it depends on
> whether you run lua.exe or wlua.exe.

What is wlua.exe? Where did you get them from or how did you build them?

> I'm not sure why lua.exe pretends to be wx-capable... but then it's
> actually not and it just crashes. Shouldn't that be changed? Either
> reject wx apps right away... or make them run properly I'd say.

A generic build of lua.exe is capable of running wxLua scripts if you
have wxLua's wx.dll in the path for require() to find.

> I'd suggest this be improved in the next version... it would
> definitely help newbies and, well, lua.exe crashing is a pretty ugly
> sight. Don't you agree?

There is nothing for anybody else to do, you simply do not have either
a valid or complete build of lua.exe or wxLua.

>> the same dll file, and the same script, but my wxlua program crashes when the mouse hover on the *any* window that shows on screen :-(.
>>
>> but the script acts great on other guys computer.
>>
>> hope anybody knows how this happened...  I use Windows XP and Lua For WIndows 5.1..

I recommend to you, as I probably did to the earlier poster, that you
try using wxLua from http://wxlua.sf.net

Regards,
    John

Reply | Threaded
Open this post in threaded view
|

Re: wxLua crashes when mouse hover on the frame window :-(

Miles Bader-2
John Labenski <[hidden email]> writes:
> I recommend to you, as I probably did to the earlier poster, that you
> try using wxLua from http://wxlua.sf.net

(but I recommend _not_ doing that on linux -- the wxlua linux installer
is insanely awful)

-Miles

--
Religion, n. A daughter of Hope and Fear, explaining to Ignorance the nature
of the Unknowable.

Reply | Threaded
Open this post in threaded view
|

Re: wxLua crashes when mouse hover on the frame window :-(

Stefan Reich
In reply to this post by John Labenski
John: thanks for answering.

I should clarify what version of Lua I'm using.

I'm running Vista, and I actually did not build anything Lua-related
myself. I just downloaded Lua_V5.1.4-45.exe from
http://code.google.com/p/luaforwindows/.

This comes with binaries (lua.exe and wlua.exe) and also registers the
extensions .lua (to lua.exe) and .wlua (to wlua.exe).

It also comes with wx, but with that problem I mentioned.

Is Lua for Windows maintained by someone else and I should inquire
over there? I don't know about that... I'm new to Lua :)

Best,
Stefan


On Wed, Aug 3, 2011 at 6:02 AM, John Labenski <[hidden email]> wrote:

> On Tue, Aug 2, 2011 at 4:20 PM, Stefan Reich
> <[hidden email]> wrote:
>> The trick seems to be in the file extension. If you call your script
>> something.lua and run it by doubleclick, it will crash (on the first
>> mouse hover event). If you call the script something.wlua (with a w),
>> it runs fine.
>
> This is completely dependent on your OS's default action to take for
> the two different file extensions. What exactly is being run for each?
>
>> Alternatively, if you invoke the interpreter explicitly, it depends on
>> whether you run lua.exe or wlua.exe.
>
> What is wlua.exe? Where did you get them from or how did you build them?
>
>> I'm not sure why lua.exe pretends to be wx-capable... but then it's
>> actually not and it just crashes. Shouldn't that be changed? Either
>> reject wx apps right away... or make them run properly I'd say.
>
> A generic build of lua.exe is capable of running wxLua scripts if you
> have wxLua's wx.dll in the path for require() to find.
>
>> I'd suggest this be improved in the next version... it would
>> definitely help newbies and, well, lua.exe crashing is a pretty ugly
>> sight. Don't you agree?
>
> There is nothing for anybody else to do, you simply do not have either
> a valid or complete build of lua.exe or wxLua.
>
>>> the same dll file, and the same script, but my wxlua program crashes when the mouse hover on the *any* window that shows on screen :-(.
>>>
>>> but the script acts great on other guys computer.
>>>
>>> hope anybody knows how this happened...  I use Windows XP and Lua For WIndows 5.1..
>
> I recommend to you, as I probably did to the earlier poster, that you
> try using wxLua from http://wxlua.sf.net
>
> Regards,
>    John
>
>

Reply | Threaded
Open this post in threaded view
|

Re: wxLua crashes when mouse hover on the frame window :-(

Ryan Pusztai
On Thu, Aug 4, 2011 at 9:50 AM, Stefan Reich <[hidden email]> wrote:
John: thanks for answering.

I should clarify what version of Lua I'm using.

I'm running Vista, and I actually did not build anything Lua-related
myself. I just downloaded Lua_V5.1.4-45.exe from
http://code.google.com/p/luaforwindows/.

This comes with binaries (lua.exe and wlua.exe) and also registers the
extensions .lua (to lua.exe) and .wlua (to wlua.exe).

wlua.exe is for Windows only and it makes it so that the console is not displayed when running a Lua script. Windows is funny how it ALWAYS displays a console unless you have an entry point to the app called WinMain() (and a linker settings change). This is just a convenience application.
 
It also comes with wx, but with that problem I mentioned.

Is Lua for Windows maintained by someone else and I should inquire
over there? I don't know about that... I'm new to Lua :)

I am a LfW maintainer and do not see any of these issues you are describing. In fact, I use it on at least 30+ Windows 7 and XP boxes. I can not reproduce this. Sorry. 
--
Regards,
Ryan


Reply | Threaded
Open this post in threaded view
|

Re: wxLua crashes when mouse hover on the frame window :-(

Stefan Reich
OK, I think it does seem to depend on the actual script. Here's what I
did, maybe it helps in finding the problem:

R:\coding\Lua\wxtest>type wxtest.lua
require "wx"

frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, "wxLua Minimal Demo",
                   wx.wxDefaultPosition, wx.wxSize(450, 450),
                   wx.wxDEFAULT_FRAME_STYLE)

frame:Show(true)

wx.wxGetApp():MainLoop()

R:\coding\Lua\wxtest>..\5.1\lua wxtest.lua
(crashes)

R:\coding\Lua\wxtest>..\5.1\wlua wxtest.lua
(works)

Stefan

On Thu, Aug 4, 2011 at 4:06 PM, Ryan Pusztai <[hidden email]> wrote:

> On Thu, Aug 4, 2011 at 9:50 AM, Stefan Reich
> <[hidden email]> wrote:
>>
>> John: thanks for answering.
>>
>> I should clarify what version of Lua I'm using.
>>
>> I'm running Vista, and I actually did not build anything Lua-related
>> myself. I just downloaded Lua_V5.1.4-45.exe from
>> http://code.google.com/p/luaforwindows/.
>>
>> This comes with binaries (lua.exe and wlua.exe) and also registers the
>> extensions .lua (to lua.exe) and .wlua (to wlua.exe).
>
> wlua.exe is for Windows only and it makes it so that the console is not
> displayed when running a Lua script. Windows is funny how it ALWAYS displays
> a console unless you have an entry point to the app called WinMain() (and a
> linker settings change). This is just a convenience application.
>
>>
>> It also comes with wx, but with that problem I mentioned.
>>
>> Is Lua for Windows maintained by someone else and I should inquire
>> over there? I don't know about that... I'm new to Lua :)
>
> I am a LfW maintainer and do not see any of these issues you are describing.
> In fact, I use it on at least 30+ Windows 7 and XP boxes. I can not
> reproduce this. Sorry.
> --
> Regards,
> Ryan
>
>

Reply | Threaded
Open this post in threaded view
|

Re: wxLua crashes when mouse hover on the frame window :-(

Thomas Lauer-3
In reply to this post by Ryan Pusztai
Ryan Pusztai <[hidden email]> wrote:
> wlua.exe is for Windows only and it makes it so that the console is not
> displayed when running a Lua script. Windows is funny how it ALWAYS displays
> a console unless you have an entry point to the app called WinMain() (and a
> linker settings change).

I think that's not entirely correct. WinMain() is not required, AFAIK.
It's the linker switch which does the trick and you can actually relink
an existing .exe file with a changed setting and so change the
behaviour. I've done that on occassion and though it has a slightly
"hackish" feel it has always worked.

--
cheers  thomasl


Reply | Threaded
Open this post in threaded view
|

Re: wxLua crashes when mouse hover on the frame window :-(

T T-2
On 4 August 2011 15:58, Thomas Lauer <[hidden email]> wrote:

> Ryan Pusztai <[hidden email]> wrote:
>> wlua.exe is for Windows only and it makes it so that the console is not
>> displayed when running a Lua script. Windows is funny how it ALWAYS displays
>> a console unless you have an entry point to the app called WinMain() (and a
>> linker settings change).
>
> I think that's not entirely correct. WinMain() is not required, AFAIK.
> It's the linker switch which does the trick and you can actually relink
> an existing .exe file with a changed setting and so change the
> behaviour. I've done that on occassion and though it has a slightly
> "hackish" feel it has always worked.

Or for even more hackish feel, just flip the right bit in the compiled
binary, because that's all it takes :)  You can use a tool like
stud_pe for that:

http://www.cgsoftlabs.ro/studpe.html

Cheers,

Tomek

Reply | Threaded
Open this post in threaded view
|

Re: wxLua crashes when mouse hover on the frame window :-(

Dimiter 'malkia' Stanev
Or something more standard, like Microsoft EDTIBIN.EXE which
sometimes is only available (e.g. no such executable) as part of their
linker: LINK.EXE /EDIT (the other tool DUMPBIN.EXE also as LINK /DUMP).

On 8/4/11 8:21 AM, T T wrote:

> On 4 August 2011 15:58, Thomas Lauer<[hidden email]>  wrote:
>> Ryan Pusztai<[hidden email]>  wrote:
>>> wlua.exe is for Windows only and it makes it so that the console is not
>>> displayed when running a Lua script. Windows is funny how it ALWAYS displays
>>> a console unless you have an entry point to the app called WinMain() (and a
>>> linker settings change).
>>
>> I think that's not entirely correct. WinMain() is not required, AFAIK.
>> It's the linker switch which does the trick and you can actually relink
>> an existing .exe file with a changed setting and so change the
>> behaviour. I've done that on occassion and though it has a slightly
>> "hackish" feel it has always worked.
>
> Or for even more hackish feel, just flip the right bit in the compiled
> binary, because that's all it takes :)  You can use a tool like
> stud_pe for that:
>
> http://www.cgsoftlabs.ro/studpe.html
>
> Cheers,
>
> Tomek
>
>


Reply | Threaded
Open this post in threaded view
|

Re: wxLua crashes when mouse hover on the frame window :-(

Ross Berteig
In reply to this post by Stefan Reich
 >At 07:15 AM 8/4/2011, Stephan Reich wrote:
 >OK, I think it does seem to depend on the actual script. Here's
 >what I did, maybe it helps in finding the problem: ....

Interesting. The test case provided by Stefan does indeed crash
for me on Windows 7 Pro 64-bit, using Lua For Windows Version
5.1.4-45. The crash happens immediately on mouse-over inside the
frame. If the mouse happens to be sitting where the window opens,
then the crash is immediate. Otherwise, I can grab and drag any
of the borders or title without a crash.

The crash description reported by Windows is:

 >Problem signature:
 >  Problem Event Name:  APPCRASH
 >  Application Name:    lua.exe
 >  Application Version: 5.1.4.0
 >  Application Timestamp:       49ca8e3c
 >  Fault Module Name:   comctl32.dll_unloaded
 >  Fault Module Version:        0.0.0.0
 >  Fault Module Timestamp:      4ce7b82c
 >  Exception Code:      c0000005
 >  Exception Offset:    732e58cc
 >  OS Version:  6.1.7601.2.1.0.256.48
 >  Locale ID:   1033
 >  Additional Information 1:    0a9e
 >  Additional Information 2:    0a9e372d3b4ad19135b953a78882e789
 >  Additional Information 3:    0a9e
 >  Additional Information 4:    0a9e372d3b4ad19135b953a78882e789

I notice with Dependency Walker against wx.dll that the only DLL
linked from a SxS assembly happens to be comctl32. I wonder if
there is some difference in the manifests provided for lua.exe
and wlua.exe that could relate.


Ross Berteig                               [hidden email]
Cheshire Engineering Corp.           http://www.CheshireEng.com/
+1 626 303 1602
+1 626 351 1590 FAX