Near-infinite loop and crash in Network Browser

Issue #689 resolved
prl created an issue

If the Beyonwiz doesn't have its Internet enabled and configured, running MENU>Setup>Network>Network browser runs into a near-infinite loop that consumes all available menu and eventually causes a UI crash because it is starved of memory.

If the network isn't set up, when the Network browser runs, it scans the network by running:

nmap -oX - 0.0.0.0/0 -sP 2>/dev/null

and collecting the standard output in a Console instance's result buffer.

When nmap is run with that IP address/mask combination, it scans the whole 4 billion or so addresses in the IPv4 address range, and produces one line of output for each IP address scanned:

<target specification="0.0.0.1" status="skipped" reason="invalid"/>
<target specification="0.0.0.2" status="skipped" reason="invalid"/>
<target specification="0.0.0.3" status="skipped" reason="invalid"/>
<target specification="0.0.0.4" status="skipped" reason="invalid"/>
<target specification="0.0.0.5" status="skipped" reason="invalid"/>

That accumulates in the Console's result buffer until all available memory is consumed. Eventually (generally after some hours) that causes the UI to crash. In the two crash logs I have for this bug, the crash is caused by a SIGSEGV, possibly due to malloc() returning NULL, and the NULL return not being checked.

Replication steps

In MENU>Setup>Network>Network interface, disable all network interfaces. Reboot to make sure that the interfaces are completely disabled.

Remove any cached browser results using:

init 4
rm /etc/enigma2/networkbrowser.cache
init 3

Then MENU>Setup>Network>Network browser to start a network scan. Wait... The "busy" spinner will appear after a while, and may start to run slowly. Eventually the system will crash due to memory starvation and the GUI will restart.

Re-enable the network interfaces and examine the debug log file from the scan for the nmap command and verify that it has the form described above.

Comments (4)

  1. Log in to comment