Open-Markets-Initiative / wireshark-lua

Source generated cross platform Wireshark dissectors
GNU General Public License v3.0
188 stars 63 forks source link

CME MDP 3.0 v13 Dissector error in Wireshark 4.4.0 #60

Closed rysto32 closed 2 months ago

rysto32 commented 2 months ago

I have both the MDP v9 and v13 dissectors installed in my Wireshark plugins directory, and no other plugins. As of the recent Wireshark 4.4.0 release, I receive the following error when starting Wireshark (even if I start it with no capture fire loaded):

Lua: Error during loading:

module 'Cme.Futures.Mdp3.Sbe.v1.13.Script.Dissector' not found:

no field package.preload['Cme.Futures.Mdp3.Sbe.v1.13.Script.Dissector']

no file 'C:\Users\rstone\AppData\Roaming\Wireshark\plugins\Cme\Futures\Mdp3\Sbe\v1\13\Script\Dissector.lua'

no file 'C:\Program Files\Wireshark\plugins\Cme\Futures\Mdp3\Sbe\v1\13\Script\Dissector.lua'

no file 'C:\Program Files\Wireshark\lua\Cme\Futures\Mdp3\Sbe\v1\13\Script\Dissector.lua'

no file 'C:\Program Files\Wireshark\lua\Cme\Futures\Mdp3\Sbe\v1\13\Script\Dissector\init.lua'

no file 'C:\Program Files\Wireshark\Cme\Futures\Mdp3\Sbe\v1\13\Script\Dissector.lua'

no file 'C:\Program Files\Wireshark\Cme\Futures\Mdp3\Sbe\v1\13\Script\Dissector\init.lua'

no file 'C:\Program Files\Wireshark\..\share\lua\5.4\Cme\Futures\Mdp3\Sbe\v1\13\Script\Dissector.lua'

no file 'C:\Program Files\Wireshark\..\share\lua\5.4\Cme\Futures\Mdp3\Sbe\v1\13\Script\Dissector\init.lua'

no file '.\Cme\Futures\Mdp3\Sbe\v1\13\Script\Dissector.lua'

no file '.\Cme\Futures\Mdp3\Sbe\v1\13\Script\Dissector\init.lua'

no file 'C:\Program Files\Wireshark\Cme\Futures\Mdp3\Sbe\v1\13\Script\Dissector.dll'

no file 'C:\Program Files\Wireshark\..\lib\lua\5.4\Cme\Futures\Mdp3\Sbe\v1\13\Script\Dissector.dll'

no file 'C:\Program Files\Wireshark\loadall.dll'

no file '.\Cme\Futures\Mdp3\Sbe\v1\13\Script\Dissector.dll'

no file 'C:\Program Files\Wireshark\Cme.dll'

no file 'C:\Program Files\Wireshark\..\lib\lua\5.4\Cme.dll'

no file 'C:\Program Files\Wireshark\loadall.dll'

no file '.\Cme.dll'

stack traceback:

[C]: in function 'require'

Lua: Error during loading:

module 'Cme.Futures.Mdp3.Sbe.v1.9.Script.Dissector' not found:

no field package.preload['Cme.Futures.Mdp3.Sbe.v1.9.Script.Dissector']

no file 'C:\Users\rstone\AppData\Roaming\Wireshark\plugins\Cme\Futures\Mdp3\Sbe\v1\9\Script\Dissector.lua'

no file 'C:\Program Files\Wireshark\plugins\Cme\Futures\Mdp3\Sbe\v1\9\Script\Dissector.lua'

no file 'C:\Program Files\Wireshark\lua\Cme\Futures\Mdp3\Sbe\v1\9\Script\Dissector.lua'

no file 'C:\Program Files\Wireshark\lua\Cme\Futures\Mdp3\Sbe\v1\9\Script\Dissector\init.lua'

no file 'C:\Program Files\Wireshark\Cme\Futures\Mdp3\Sbe\v1\9\Script\Dissector.lua'

no file 'C:\Program Files\Wireshark\Cme\Futures\Mdp3\Sbe\v1\9\Script\Dissector\init.lua'

no file 'C:\Program Files\Wireshark\..\share\lua\5.4\Cme\Futures\Mdp3\Sbe\v1\9\Script\Dissector.lua'

no file 'C:\Program Files\Wireshark\..\share\lua\5.4\Cme\Futures\Mdp3\Sbe\v1\9\Script\Dissector\init.lua'

no file '.\Cme\Futures\Mdp3\Sbe\v1\9\Script\Dissector.lua'

no file '.\Cme\Futures\Mdp3\Sbe\v1\9\Script\Dissector\init.lua'

no file 'C:\Program Files\Wireshark\Cme\Futures\Mdp3\Sbe\v1\9\Script\Dissector.dll'

no file 'C:\Program Files\Wireshark\..\lib\lua\5.4\Cme\Futures\Mdp3\Sbe\v1\9\Script\Dissector.dll'

no file 'C:\Program Files\Wireshark\loadall.dll'

no file '.\Cme\Futures\Mdp3\Sbe\v1\9\Script\Dissector.dll'

no file 'C:\Program Files\Wireshark\Cme.dll'

no file 'C:\Program Files\Wireshark\..\lib\lua\5.4\Cme.dll'

no file 'C:\Program Files\Wireshark\loadall.dll'

no file '.\Cme.dll'

stack traceback:

[C]: in function 'require'

Unsurprisingly, if I load a capture file containing MDP 3.0 v13 traffic, Wireshark is not able to dissect the packets anymore.

Open-Markets-Initiative commented 2 months ago

We believe Wireshark introduced some error in the latest version 4.4 and reported this to them:

https://gitlab.com/wireshark/wireshark/-/issues/20035

We are waiting to see if its some internal check (the error looks like a path issue) or if we need to update and regenerate.

Hello, thanks for reporting this. We will leave this issue open until its resolved.

Open-Markets-Initiative commented 2 months ago

In the meantime, version 4.2.7 still works:

https://2.na.dl.wireshark.org/

johnthacker commented 2 months ago

Hi. The underlying issue is that Wireshark now uses Lua require to load dissector modules instead of a hacky way that read in the file. This is better in the sense that files don't get loaded more than once and get placed in the table of already loaded modules, but Lua in general does not like files with extra periods in them. It assumes that a period in the name is used for a directory hierarchy, similar to imports in Python. The default package.searchpath function replaces periods with directory separators:

https://www.lua.org/manual/5.4/manual.html#pdf-require

The recommended solution for Lua in general is not to have extra dots in the filename; for example, renaming your dissector files like Cme_Futures_Mdp3_Sbe_v1_13_Script_Dissector.lua would work. It might be possible to write a custom package searcher and add it to the table so that Lua uses that as a fallback (checking the filename without period substitution if the other attempts fail), though I don't know how long that might take for someone to get around to writing.

https://stackoverflow.com/questions/59592169/require-module-from-folder-with-dot-in-name https://stackoverflow.com/questions/75490124/how-to-require-a-file-with-a-dot-in-the-name

Open-Markets-Initiative commented 2 months ago

Thanks, I agree that we should follow convention. Repository regenerated with your suggestions. Thanks for your efforts (and quick response).