Bug #47190 [Corner case] Proxy crashes on windows if proxy-lua-script is a folder
Submitted: 8 Sep 2009 14:47 Modified: 8 Sep 2009 15:03
Reporter: Diego Medina Email Updates:
Status: Verified Impact on me:
Category:MySQL Proxy: Core Severity:S3 (Non-critical)
Version:0.8.0 OS:Windows
Assigned to: Assigned Account CPU Architecture:Any

[8 Sep 2009 14:47] Diego Medina
Windows only.

If you specify a folder, instead of a lua script to --proxy-lua-script= , as soon as you connect through the proxy port, it will crash.

This also happens if you add a /  to the name of your lua script (like a typo)

The error you get is:
..\src\lua-load-factory.c:86:???: assertion failed (NULL != factoruy->data.file.f)

How to repeat:
1- Start the proxy on windows like this:

c:\mysql-proxy\bin\mysql-proxy.exe --proxy-lua-sctip=c:\boot.ini\

2- on a new terminal, connect to the proxy port and notice the error message on the terminal that started the proxy.

Note, the file has to exist. if you specify a non-existing file or folder, the proxy will not crash.

Note2: boot.ini if of course not a lua script, so if you want, just replace that for a lua script :)

Suggested fix:
Log an error instead of crashing.
[14 Sep 2009 14:11] Enterprise Tools JIRA Robot
Kay Roepke writes: 
The code probably only needs some path cleansing and additional error checking.