"attempt to index global 'base' (a nil value)" - Wireshark 3.6.2-2
Hi!
I am using a custom dissector in conjunction with Nordic's nRF BLE Sniffer tooling. In my installation scripts, I have pinned the Wireshark version to 3.6.2-2 because of some of the differences between how Nordic's tooling operates and some differences between Lua 5.2 and 5.4. On Ubuntu 22.04 I keep getting the error "attempt to index global 'base' (a nil value)" when using base.DEC, base.HEX in my dissector code.
To successfully install this version, I install the following packages from apt:
- wireshark=3.6.2-2
- wireshark-qt=3.6.2-2
- wireshark-dev=3.6.2-2
- wireshark-common=3.6.2-2
Any ideas why the definition for "base" is missing from my installation?
Thanks!
Do you have a small piece of code that shows the issue?
Hi Chuck,
This code throws the error on my installation of 3.6.2-2:
Here is the error:
The same code does not have any issues loading in the latest apt version 4.4.0.
Thanks!
(sample capture attached to 18267: Assertion due to incorrect mask for btatt.battery_power_state.)
Works on Windows:
Version 3.6.2 (v3.6.2-0-g626020d9b3c3)
Will need to build on Ubuntu to see if I can recreate issue.
I believe that 3.6 needs an init.lua file to load some of the globals, it was before this commit: https://gitlab.com/wireshark/wireshar...
If the difference between Lua 5.2 and 5.4 is the issue, can you use Wireshark 4.0 or 4.2, both of which use Lua 5.2. Wireshark 3.6 is no longer supported, but 4.2 is.
btatt
fails on 3.6.2 but the dissector works withregister_postdissector(my_proto)
From
init.lua
:Perhaps
init.lua
is not being loaded on your system per @johnthacker comment above?