bmx-routing / bmx6

BMX6 Mesh Networking Protocol
http://bmx6.net
56 stars 26 forks source link

"bmx6 -c --jshow tunnels" makes BMX6 crash when too many nodes/tunnels are available #20

Open rogerpueyo opened 6 years ago

rogerpueyo commented 6 years ago

Hi,

I am running BMX6 in qMp with 85 other network routers:

root@qMp-98d4:/# bmx6 -c --version
BMX6-0.1-alpha comPatibility=16 revision=0312168aaa384379ccbefd4b2d936fc698664d5b

and I've noticed that asking the JSON-formatted BMX6 tunnels list crashes the daemon (while the raw/plaintext list doesn't). For instance:

root@qMp-98d4:/# bmx6 -c tunnels | wc
      184      2563     27825 <==== a nice number of tunnels

and

root@qMp-98d4:/# bmx6 -c --jshow tunnels; ps | grep bmx
10434 root      3088 S    grep bmx <==== BMX6 crashed :(

The daemon does not crash when a small number of nodes is present (e.g. 4), but I don't know exactly what number of nodes/tunnels or which output message size makes the daemon crash.

axn commented 6 years ago

and I've noticed that asking the JSON-formatted BMX6 tunnels list crashes the daemon (while the /raw/plaintext/ list doesn't). For instance:

|root@qMp-98d4:/# bmx6 -c tunnels | wc 184 2563 27825 <==== a nice number

holy shit. I guess json-c just runs out of memory and I don't think such a huge json object can be processed and dumped in chunks. But I'll have a look...

aparcar commented 6 years ago

If it's json-c should we report that upstream? Seems like an dangerous issue?

rogerpueyo commented 6 years ago

I guess json-c just runs out of memory and But... this is good! Llorenç wanted to find where the limit of the mesh was, and he has achieved it! :)

aparcar commented 6 years ago

But isn't that rather a limit of the bmx-json plugin than of bmx routing capabilities as a protocol?

rogerpueyo commented 6 years ago

Most likely...