{"action":"opened","issue":{"url":"https://api.github.com/repos/PX4/Firmware/issues/2568","labels_url":"https://api.github.com/repos/PX4/Firmware/issues/2568/labels{/name}","comments_url":"https://api.github.com/repos/PX4/Firmware/issues/2568/comments","events_url":"https://api.github.com/repos/PX4/Firmware/issues/2568/events","html_url":"https://github.com/PX4/Firmware/issues/2568","id":95295204,"number":2568,"title":"px4cannode-v1: libuavcan pool should be enlarged","user":{"login":"pavel-kirienko","id":3298404,"avatar_url":"https://avatars.githubusercontent.com/u/3298404?v=3","gravatar_id":"","url":"https://api.github.com/users/pavel-kirienko","html_url":"https://github.com/pavel-kirienko","followers_url":"https://api.github.com/users/pavel-kirienko/followers","following_url":"https://api.github.com/users/pavel-kirienko/following{/other_user}","gists_url":"https://api.github.com/users/pavel-kirienko/gists{/gist_id}","starred_url":"https://api.github.com/users/pavel-kirienko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pavel-kirienko/subscriptions","organizations_url":"https://api.github.com/users/pavel-kirienko/orgs","repos_url":"https://api.github.com/users/pavel-kirienko/repos","events_url":"https://api.github.com/users/pavel-kirienko/events{/privacy}","received_events_url":"https://api.github.com/users/pavel-kirienko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-15T21:30:41Z","updated_at":"2015-07-15T21:30:41Z","closed_at":null,"body":"@davids5 Pool size in `px4cannode-v1` is insufficient. When the node receives concurrent GetNodeInfo requests, it fails to properly enqueue the responses due to insufficient pool memory available. The issue manifests itself on the bus as outgoing transfers that lack frames in the middle, here's an annotated dump of CAN traffic:\r\n\r\n```\r\n(1436992770.657995)  can0  1E3081FD   [8]  23 0D 00 7B 01 00 00 9B   '#..{....' LAST FILE READ REQUEST\r\n(1436992770.657997)  can0  1E3081FD   [8]  2F 66 73 2F 6D 69 63 3B   '/fs/mic;'\r\n(1436992770.657999)  can0  1E3081FD   [8]  72 6F 73 64 2F 66 77 1B   'rosd/fw.'\r\n(1436992770.658000)  can0  1E3081FD   [8]  2F 63 2F 62 33 34 32 3B   '/c/b342;'\r\n(1436992770.658001)  can0  1E3081FD   [8]  31 63 31 34 2E 62 69 1B   '1c14.bi.'\r\n(1436992770.658002)  can0  1E3081FD   [8]  6E 2E 76 61 6C 69 64 7B   'n.valid{'\r\n\r\n(1436992770.668997)  can0  1E307D81   [8]  A4 03 00 00 00 00 00 9B   '........' LAST FILE READ RESPONSE\r\n(1436992770.669994)  can0  1E307D81   [8]  00 00 00 00 00 03 1E 3B   '.......;'\r\n(1436992770.669997)  can0  1E307D81   [8]  00 00 00 00 00 00 00 1B   '........'\r\n(1436992770.669998)  can0  1E307D81   [8]  00 00 00 3C 00 02 40 3B   '...<..@;'\r\n(1436992770.680991)  can0  1E307D81   [8]  00 00 00 00 00 00 00 1B   '........'\r\n(1436992770.680994)  can0  1E307D81   [8]  00 04 1F 00 00 00 00 3B   '.......;'\r\n(1436992770.680995)  can0  1E307D81   [8]  00 00 00 00 00 00 50 1B   '......P.'\r\n(1436992770.680997)  can0  1E307D81   [8]  00 02 40 00 00 00 00 3B   '..@....;'\r\n(1436992770.692995)  can0  1E307D81   [8]  00 00 00 00 05 20 00 1B   '..... ..'\r\n(1436992770.692998)  can0  1E307D81   [8]  00 00 00 00 00 00 00 3B   '.......;'\r\n(1436992770.692999)  can0  1E307D81   [8]  00 00 64 00 02 40 00 1B   '..d..@..'\r\n(1436992770.693000)  can0  1E307D81   [8]  00 00 00 00 00 00 00 3B   '.......;'\r\n(1436992770.693987)  can0  1E307D81   [8]  06 21 00 00 00 00 00 1B   '.!......'\r\n(1436992770.693989)  can0  1E307D81   [8]  00 00 00 00 00 78 00 3B   '.....x.;'\r\n(1436992770.693991)  can0  1E307D81   [8]  02 40 00 00 00 00 00 1B   '.@......'\r\n(1436992770.704996)  can0  1E307D81   [4]  00 00 00 7B               '...{'\r\n\r\n(1436992770.801993)  can0  10015564   [8]  29 01 00 00 00 00 00 C9   ').......'\r\n\r\n(1436992771.182994)  can0  1001557D   [8]  00 00 00 00 08 00 00 C0   '........' FIRST NODE STATUS AFTER UPDATE\r\n\r\n(1436992771.223994)  can0  1E01FDE4   [1]  C1                        '.'        GNI REQUEST  100 -> 125\r\n(1436992771.236993)  can0  1E0164FD   [8]  DF 3A 00 00 00 00 00 81   '.:......' GNI RESPONSE 125 -> 100\r\n(1436992771.236995)  can0  1E0164FD   [8]  00 00 00 01 01 7A 80 21   '.....z.!' ...\r\n(1436992771.238006)  can0  1E01FD81   [1]  C1                        '.'        GNI REQUEST  1   -> 125\r\n(1436992771.238009)  can0  1E0164FD   [8]  4B E5 E1 F8 D0 43 BC 01   'K....C..' GNI RESPONSE 125 -> 100\r\n(1436992771.238010)  can0  1E0101FD   [8]  DF 3A 00 00 00 00 00 81   '.:......' GNI RESPONSE 125 -> 1\r\n(1436992771.238011)  can0  1E0101FD   [8]  00 00 00 01 01 7A 80 21   '.....z.!' ...\r\n(1436992771.296997)  can0  1E0101FD   [8]  4B E5 E1 F8 D0 43 BC 01   'K....C..' ...\r\n(1436992771.297000)  can0  1E0101FD   [8]  C6 DF 8E 01 00 06 6C 21   '......l!' ...\r\n(1436992771.297001)  can0  1E0101FD   [8]  FF 54 53 49 89 48 87 01   '.TSI.H..' ...\r\n(1436992771.297996)  can0  1E0101FD   [8]  07 46 22 00 00 00 00 21   '.F\"....!' ...\r\n(1436992771.297999)  can0  1E0101FD   [8]  00 6F 72 67 2E 70 69 01   '.org.pi.' ...\r\n(1436992771.298000)  can0  1E0101FD   [8]  78 68 61 77 6B 2E 70 21   'xhawk.p!' ...\r\n(1436992771.298001)  can0  1E0101FD   [8]  78 34 63 61 6E 6E 6F 01   'x4canno.' ...\r\n(1436992771.298002)  can0  1E0101FD   [6]  64 65 2D 76 31 61         'de-v1a'   ...\r\n(1436992771.298004)  can0  1E0164FD   [8]  78 68 61 77 6B 2E 70 21   'xhawk.p!' GNI RESPONSE 125 -> 100\r\n(missing 4 frames)\r\n(1436992771.298997)  can0  1E0164FD   [8]  78 34 63 61 6E 6E 6F 01   'x4canno.' ...\r\n(1436992771.299000)  can0  1E0164FD   [6]  64 65 2D 76 31 61         'de-v1a'   ...\r\n\r\n(1436992771.356964)  can0  10040A7D   [8]  B2 2E 00 00 00 00 9A 80   '........' APPLICATION STARTS HERE\r\n(1436992771.356967)  can0  10040A7D   [8]  42 19 14 00 4E 00 00 20   'B...N.. '\r\n(1436992771.357964)  can0  10040A7D   [3]  19 00 40                  '..@'\r\n(1436992771.476975)  can0  10040A7D   [8]  B2 2E 00 00 00 00 9A 81   '........'\r\n(1436992771.476978)  can0  10040A7D   [8]  42 19 14 00 4E 00 00 21   'B...N..!'\r\n(1436992771.476982)  can0  10040A7D   [3]  19 00 41                  '..A'\r\n(1436992771.537010)  can0  10040A7D   [8]  B2 2E 00 00 00 00 9A 82   '........'\r\n(1436992771.537013)  can0  10040A7D   [8]  42 19 14 00 4E 00 00 22   'B...N..\"'\r\n(1436992771.537014)  can0  10040A7D   [3]  19 00 42                  '..B'\r\n(1436992771.639000)  can0  10015501   [8]  23 01 00 00 00 00 00 C3   '#.......'\r\n(1436992771.639003)  can0  10040A7D   [8]  B2 2E 00 00 00 00 9A 83   '........'\r\n(1436992771.639004)  can0  10040A7D   [8]  42 19 14 00 4E 00 00 23   'B...N..#'\r\n(1436992771.639005)  can0  10040A7D   [3]  19 00 43                  '..C'\r\n(1436992771.756994)  can0  10040A7D   [8]  B2 2E 00 00 00 00 9A 84   '........'\r\n(1436992771.756997)  can0  10040A7D   [8]  42 19 14 00 4E 00 00 24   'B...N..$'\r\n(1436992771.756999)  can0  10040A7D   [3]  19 00 44                  '..D'\r\n(1436992771.801995)  can0  10015564   [8]  2A 01 00 00 00 00 00 CA   '*.......'\r\n(1436992771.857028)  can0  10040A7D   [8]  B2 2E 00 00 00 00 9A 85   '........'\r\n(1436992771.857031)  can0  10040A7D   [8]  42 19 14 00 4E 00 00 25   'B...N..%'\r\n(1436992771.857032)  can0  10040A7D   [3]  19 00 45                  '..E'\r\n(1436992771.976997)  can0  10040A7D   [8]  B2 2E 00 00 00 00 9A 86   '........'\r\n(1436992771.976999)  can0  10040A7D   [8]  42 19 14 00 4E 00 00 26   'B...N..&'\r\n(1436992771.977001)  can0  10040A7D   [3]  19 00 46                  '..F'\r\n(1436992772.037000)  can0  10040A7D   [8]  B2 2E 00 00 00 00 9A 87   '........'\r\n(1436992772.037003)  can0  10040A7D   [8]  42 19 14 00 4E 00 00 27   'B...N..''\r\n(1436992772.037004)  can0  10040A7D   [3]  19 00 47                  '..G'\r\n(1436992772.157001)  can0  10040A7D   [8]  B2 2E 00 00 00 00 9A 88   '........'\r\n(1436992772.157004)  can0  10040A7D   [8]  42 19 14 00 4E 00 00 28   'B...N..('\r\n(1436992772.157005)  can0  10040A7D   [3]  19 00 48                  '..H'\r\n(1436992772.216999)  can0  1001557D   [8]  01 00 00 00 00 00 00 C1   '........'\r\n\r\n(1436992772.224082)  can0  1E01FDE4   [1]  C2                        '.'        GNI REQUEST  100 -> 125\r\n(1436992772.224353)  can0  1E0164FD   [8]  40 76 01 00 00 00 00 82   '@v......' GNI RESPONSE 125 -> 100\r\n(1436992772.224356)  can0  1E0164FD   [8]  00 00 00 01 01 7A 80 22   '.....z.\"'\r\n(1436992772.276950)  can0  1E0164FD   [8]  4B E5 E1 F8 D0 43 BC 02   'K....C..'\r\n(1436992772.276953)  can0  10040A7D   [8]  B2 2E 00 00 00 00 9A 89   '........'\r\n(1436992772.386960)  can0  1E0164FD   [8]  C6 DF 8E 01 00 06 6C 22   '......l\"'\r\n(1436992772.386963)  can0  10040A7D   [8]  B2 2E 00 00 00 00 9A 8A   '........'\r\n(1436992772.386964)  can0  10040A7D   [8]  42 19 14 00 4E 00 00 2A   'B...N..*'\r\n(1436992772.387964)  can0  10040A7D   [3]  19 00 4A                  '..J'\r\n(1436992772.387965)  can0  1E0164FD   [8]  FF 54 53 49 89 48 87 02   '.TSI.H..'\r\n(1436992772.387966)  can0  1E0164FD   [8]  07 46 22 00 00 00 00 22   '.F\"....\"'\r\n(1436992772.387967)  can0  1E0164FD   [8]  00 6F 72 67 2E 70 69 02   '.org.pi.'\r\n(1436992772.387968)  can0  1E0164FD   [8]  78 68 61 77 6B 2E 70 22   'xhawk.p\"'\r\n(1436992772.388945)  can0  1E0164FD   [8]  78 34 63 61 6E 6E 6F 02   'x4canno.'\r\n(1436992772.388947)  can0  1E0164FD   [6]  64 65 2D 76 31 62         'de-v1b'\r\n```\r\n\r\nIncreasing the pool size to 4K fixes the issue:\r\n\r\n```\r\n Udate:\r\nUAVCAN  getNumFreeBlocks in bytes 3984\r\n              total       used       free    largest\r\nData:         16000      12600       3400       1808\r\nProg:        132096     107520      24576      24576\r\n   2 uavcan            532  2044/ 2084 240 (240)  RUN   \r\n```\r\n\r\nAlso, there's now a better way to monitor pool usage than `getNumFreeBlocks()` - consider [`getPeakNumUsedBlocks()`](https://github.com/UAVCAN/libuavcan/blob/master/libuavcan/include/uavcan/dynamic_memory.hpp#L75)."}}