[PD] memory leak problem with small patch

Jack jack at rybn.org
Thu Oct 20 11:19:07 CEST 2016


Hello,

I made a simple patch to control an Enttec DMXUSB Pro, causing memory
leak after a few hours (around 4-5 hours) of operation.

The patch is attached.
Configuration :
RaspberryPi 2
Raspbian GNU/Linux 7 (wheezy)
Pd-0.46.6

Someone to help me to solve this issue ?
++

Jack



Here the log from syslog (I can use gdb if needed ?) :

Oct 20 02:28:08 raspberrypi kernel: [20680.496233] pd invoked
oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
Oct 20 02:28:08 raspberrypi kernel: [20680.496266] CPU: 2 PID: 2251
Comm: pd Not tainted 3.18.11-v7+ #781
Oct 20 02:28:08 raspberrypi kernel: [20680.496319] [<800172bc>]
(unwind_backtrace) from [<80012f7c>] (show_stack+0x20/0x24)
Oct 20 02:28:08 raspberrypi kernel: [20680.496348] [<80012f7c>]
(show_stack) from [<80520970>] (dump_stack+0x98/0xd8)
Oct 20 02:28:08 raspberrypi kernel: [20680.496445] [<80520970>]
(dump_stack) from [<8051e3bc>] (dump_header.isra.12+0x80/0x1a8)
Oct 20 02:28:08 raspberrypi kernel: [20680.496489] [<8051e3bc>]
(dump_header.isra.12) from [<800ef2a8>] (oom_kill_process+0x340/0x3b8)
Oct 20 02:28:08 raspberrypi kernel: [20680.496527] [<800ef2a8>]
(oom_kill_process) from [<800ef808>] (out_of_memory+0x300/0x34c)
Oct 20 02:28:08 raspberrypi kernel: [20680.496553] [<800ef808>]
(out_of_memory) from [<800f3c64>] (__alloc_pages_nodemask+0x930/0x970)
Oct 20 02:28:08 raspberrypi kernel: [20680.496578] [<800f3c64>]
(__alloc_pages_nodemask) from [<800ede38>] (filemap_fault+0x220/0x4a8)
Oct 20 02:28:08 raspberrypi kernel: [20680.496604] [<800ede38>]
(filemap_fault) from [<80113104>] (__do_fault+0x44/0x98)
Oct 20 02:28:08 raspberrypi kernel: [20680.496628] [<80113104>]
(__do_fault) from [<80116068>] (do_read_fault.isra.91+0x1c4/0x274)
Oct 20 02:28:08 raspberrypi kernel: [20680.496652] [<80116068>]
(do_read_fault.isra.91) from [<8011683c>] (handle_mm_fault+0x3b8/0xa88)
Oct 20 02:28:08 raspberrypi kernel: [20680.496679] [<8011683c>]
(handle_mm_fault) from [<80528240>] (do_page_fault+0x2e4/0x458)
Oct 20 02:28:08 raspberrypi kernel: [20680.496706] [<80528240>]
(do_page_fault) from [<800084d4>] (do_PrefetchAbort+0x44/0xa8)
Oct 20 02:28:08 raspberrypi kernel: [20680.496731] [<800084d4>]
(do_PrefetchAbort) from [<80526864>] (ret_from_exception+0x0/0x1c)
Oct 20 02:28:08 raspberrypi kernel: [20680.496745] Exception
stack(0xb865ffb0 to 0xb865fff8)
Oct 20 02:28:08 raspberrypi kernel: [20680.496763] ffa0:
                    765c5000 00001000 00000003 76fe0dc8
Oct 20 02:28:08 raspberrypi kernel: [20680.496785] ffc0: 76a00010
00000438 76a00040 765c4f78 00000088 000c6000 00000448 76500000
Oct 20 02:28:08 raspberrypi kernel: [20680.496804] ffe0: 000c5000
7ea259f0 76d524f4 76daa0c0 20000010 ffffffff
Oct 20 02:28:08 raspberrypi kernel: [20680.506406] Mem-info:
Oct 20 02:28:08 raspberrypi kernel: [20680.506426] Normal per-cpu:
Oct 20 02:28:08 raspberrypi kernel: [20680.506441] CPU    0: hi:  186,
btch:  31 usd: 160
Oct 20 02:28:08 raspberrypi kernel: [20680.506455] CPU    1: hi:  186,
btch:  31 usd: 166
Oct 20 02:28:08 raspberrypi kernel: [20680.506468] CPU    2: hi:  186,
btch:  31 usd: 168
Oct 20 02:28:08 raspberrypi kernel: [20680.506481] CPU    3: hi:  186,
btch:  31 usd: 153
Oct 20 02:28:08 raspberrypi kernel: [20680.506510] active_anon:114781
inactive_anon:114792 isolated_anon:0
Oct 20 02:28:08 raspberrypi kernel: [20680.506510]  active_file:15
inactive_file:14 isolated_file:0
Oct 20 02:28:08 raspberrypi kernel: [20680.506510]  unevictable:0
dirty:0 writeback:0 unstable:0
Oct 20 02:28:08 raspberrypi kernel: [20680.506510]  free:2208
slab_reclaimable:929 slab_unreclaimable:1352
Oct 20 02:28:08 raspberrypi kernel: [20680.506510]  mapped:3 shmem:2
pagetables:623 bounce:0
Oct 20 02:28:08 raspberrypi kernel: [20680.506510]  free_cma:18
Oct 20 02:28:08 raspberrypi kernel: [20680.506574] Normal free:8832kB
min:8192kB low:10240kB high:12288kB active_anon:459124kB
inactive_anon:459168kB active_file:60kB inactive_file:56kB
unevictable:0kB isolated(anon):0kB isolated(file):0kB present:966656kB
managed:949408kB mlocked:0kB dirty:0kB writeback:0kB mapped:12kB
shmem:8kB slab_reclaimable:3716kB slab_unreclaimable:5408kB
kernel_stack:680kB pagetables:2492kB unstable:0kB bounce:0kB
free_cma:72kB writeback_tmp:0kB pages_scanned:324 all_unreclaimable? no
Oct 20 02:28:08 raspberrypi kernel: [20680.506589] lowmem_reserve[]: 0 0
Oct 20 02:28:08 raspberrypi kernel: [20680.506611] Normal: 178*4kB
(UEMC) 4*8kB (E) 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB
0*2048kB 2*4096kB (R) = 8936kB
Oct 20 02:28:08 raspberrypi kernel: [20680.506692] 105 total pagecache pages
Oct 20 02:28:08 raspberrypi kernel: [20680.506706] 42 pages in swap cache
Oct 20 02:28:08 raspberrypi kernel: [20680.506719] Swap cache stats: add
25782, delete 25740, find 90/164
Oct 20 02:28:08 raspberrypi kernel: [20680.506729] Free swap  = 0kB
Oct 20 02:28:08 raspberrypi kernel: [20680.506738] Total swap = 102396kB
Oct 20 02:28:08 raspberrypi kernel: [20680.524406] 241664 pages of RAM
Oct 20 02:28:08 raspberrypi kernel: [20680.524434] 3030 free pages
Oct 20 02:28:08 raspberrypi kernel: [20680.524445] 4312 reserved pages
Oct 20 02:28:08 raspberrypi kernel: [20680.524455] 1403 slab pages
Oct 20 02:28:08 raspberrypi kernel: [20680.524465] 262185 pages shared
Oct 20 02:28:08 raspberrypi kernel: [20680.524475] 44 pages swap cached
Oct 20 02:28:08 raspberrypi kernel: [20680.524487] [ pid ]   uid  tgid
total_vm      rss nr_ptes swapents oom_score_adj name
Oct 20 02:28:08 raspberrypi kernel: [20680.524532] [  175]     0   175
   723        0       5      134         -1000 udevd
Oct 20 02:28:08 raspberrypi kernel: [20680.524553] [  318]     0   318
   722        0       5      136         -1000 udevd
Oct 20 02:28:08 raspberrypi kernel: [20680.524574] [ 1516]     0  1516
   439        5       4       19         -1000 ifplugd
Oct 20 02:28:08 raspberrypi kernel: [20680.524595] [ 1546]     0  1546
   439        5       4       17         -1000 ifplugd
Oct 20 02:28:08 raspberrypi kernel: [20680.524615] [ 1908] 65534  1908
   506        4       5       27             0 thd
Oct 20 02:28:08 raspberrypi kernel: [20680.524635] [ 1922]     0  1922
   722        0       5      135         -1000 udevd
Oct 20 02:28:08 raspberrypi kernel: [20680.524656] [ 1949]     0  1949
  6995        1       7       83             0 rsyslogd
Oct 20 02:28:08 raspberrypi kernel: [20680.524677] [ 2071]   104  2071
  1401       18       6       95             0 ntpd
Oct 20 02:28:08 raspberrypi kernel: [20680.524697] [ 2075]     0  2075
   950       10       5       32             0 cron
Oct 20 02:28:08 raspberrypi kernel: [20680.524717] [ 2098]   102  2098
   796        0       5       57             0 dbus-daemon
Oct 20 02:28:08 raspberrypi kernel: [20680.524738] [ 2135]     0  2135
  1556        0       6      107         -1000 sshd
Oct 20 02:28:08 raspberrypi kernel: [20680.524759] [ 2167]   103  2167
   846        0       5       64             0 avahi-daemon
Oct 20 02:28:08 raspberrypi kernel: [20680.524779] [ 2168]   103  2168
   846        0       5       56             0 avahi-daemon
Oct 20 02:28:08 raspberrypi kernel: [20680.524800] [ 2239]     0  2239
   526        0       5       47             0 dhcpcd
Oct 20 02:28:08 raspberrypi kernel: [20680.524820] [ 2251]  1000  2251
255309   229419     501    24495             0 pd
Oct 20 02:28:08 raspberrypi kernel: [20680.524841] [ 2252]     0  2252
   425        4       5       19             0 startpar
Oct 20 02:28:08 raspberrypi kernel: [20680.524861] [ 2253]     0  2253
   938        0       5       33             0 getty
Oct 20 02:28:08 raspberrypi kernel: [20680.524882] [ 2254]     0  2254
   938        0       6       33             0 getty
Oct 20 02:28:08 raspberrypi kernel: [20680.524902] [ 2255]     0  2255
   938        0       5       33             0 getty
Oct 20 02:28:08 raspberrypi kernel: [20680.524922] [ 2256]     0  2256
   938        0       5       33             0 getty
Oct 20 02:28:08 raspberrypi kernel: [20680.524942] [ 2257]     0  2257
   938        0       5       33             0 getty
Oct 20 02:28:08 raspberrypi kernel: [20680.524962] [ 2258]     0  2258
   938        0       5       33             0 getty
Oct 20 02:28:08 raspberrypi kernel: [20680.524983] [ 2259]     0  2259
   518        0       5       32             0 getty
Oct 20 02:28:08 raspberrypi kernel: [20680.525005] [ 2261]  1000  2261
   428       15       4        6             0 pd-watchdog
Oct 20 02:28:08 raspberrypi kernel: [20680.525022] Out of memory: Kill
process 2251 (pd) score 967 or sacrifice child
Oct 20 02:28:08 raspberrypi kernel: [20680.525041] Killed process 2251
(pd) total-vm:1021236kB, anon-rss:917676kB, file-rss:0kB


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.pd
Type: application/puredata
Size: 1491 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20161020/0132034c/attachment.bin>


More information about the Pd-list mailing list