Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NC21: Memleak when do "occ db:add-missing-indices" #26154

Closed
TheRaven500 opened this issue Mar 16, 2021 · 7 comments
Closed

NC21: Memleak when do "occ db:add-missing-indices" #26154

TheRaven500 opened this issue Mar 16, 2021 · 7 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@TheRaven500
Copy link

Steps to reproduce

  1. sudo -u www-data ./occ db:add-missing-indices

Expected behaviour

Database should be fixed

Actual behaviour

Memory grow up and up until it crashes

Server configuration

Operating system:
Debian 10
Web server:
Abache2
Database:
Mariadb
PHP version:
7.4
Nextcloud version: (see Nextcloud admin page)
21.0.0.18
Updated from an older Nextcloud/ownCloud or fresh install:
Updated from 20.0.0.8

Never had problems before. I think it is a problem with NC21.

peng
peng2

@TheRaven500 TheRaven500 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Mar 16, 2021
@kesselb
Copy link
Contributor

kesselb commented Mar 16, 2021

Logs?

@TheRaven500
Copy link
Author

What for logs are needed?
I don't think that you see a "memleak" in the "normal" logs. Maybe in a debug log?

@TheRaven500
Copy link
Author

TheRaven500 commented Apr 7, 2021

The bug is still present in NC21.0.1 RC1.
What logs are needed?
In dmesg i see:

[660693.440580] php-fpm7.4 invoked oom-killer: gfp_mask=0x6200ca(GFP_HIGHUSER_MOVABLE), nodemask=(null), order=0, oom_score_adj=0
[660693.440582] php-fpm7.4 cpuset=/ mems_allowed=0
[660693.440586] CPU: 0 PID: 574 Comm: php-fpm7.4 Not tainted 4.19.0-11-amd64 #1 Debian 4.19.146-1
[660693.440588] Call Trace:
[660693.440595]  dump_stack+0x66/0x90
[660693.440599]  dump_header+0x6b/0x283
[660693.440601]  oom_kill_process.cold.30+0xb/0x1cf
[660693.440603]  ? oom_badness+0x23/0x140
[660693.440604]  out_of_memory+0x1a5/0x450
[660693.440606]  __alloc_pages_slowpath+0xbd8/0xcb0
[660693.440608]  __alloc_pages_nodemask+0x28b/0x2b0
[660693.440610]  filemap_fault+0x333/0x780
[660693.440612]  ? alloc_set_pte+0x49e/0x560
[660693.440614]  ? __schedule+0x2a7/0x840
[660693.440615]  ? filemap_map_pages+0x139/0x3a0
[660693.440640]  ext4_filemap_fault+0x2c/0x40 [ext4]
[660693.440642]  __do_fault+0x36/0x130
[660693.440644]  __handle_mm_fault+0xe6c/0x1270
[660693.440646]  handle_mm_fault+0xd6/0x200
[660693.440648]  __do_page_fault+0x249/0x4f0
[660693.440650]  ? page_fault+0x8/0x30
[660693.440652]  page_fault+0x1e/0x30
[660693.440654] RIP: 0033:0x7fa0190fe7b7
[660693.440657] Code: Bad RIP value.
[660693.440658] RSP: 002b:00007ffc0c066288 EFLAGS: 00010246
[660693.440660] RAX: 0000000000000000 RBX: 0000000000000001 RCX: 00007fa0190fe7b7
[660693.440660] RDX: 0000000000000001 RSI: 000055605966d320 RDI: 0000000000000008
[660693.440661] RBP: 0000000000000064 R08: 000055605966d320 R09: 00000000000a57f5
[660693.440662] R10: 0000000000000064 R11: 0000000000000246 R12: 00007ffc0c0662c0
[660693.440663] R13: 0000556057617a60 R14: 20c49ba5e353f7cf R15: 0000000000000000

And:

[660693.440865] Out of memory: Kill process 13170 (php) score 892 or sacrifice child
[660693.440874] Killed process 13170 (php) total-vm:9204764kB, anon-rss:7308052kB, file-rss:0kB, shmem-rss:0kB
[660693.914196] oom_reaper: reaped process 13170 (php), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB

@kesselb kesselb removed the needs info label Apr 7, 2021
@vorlon
Copy link

vorlon commented Apr 8, 2021

I stumbled upon the same issue after a fresh upgrade to 21.0.1 from 20.x. Then I noticed that even just calling occ without arguments leads to an OOM situation.
This might be the same as described in #26184 . In my case commenting out
'memcache.local' => '\\OC\\Memcache\\APCu' in config.php helped to succesfully run occ again.

@TheRaven500
Copy link
Author

Ha! Thx! Has also worked for me. Job completet in few seconds after commenting out the cache option in config.php!

@caugner
Copy link
Contributor

caugner commented Apr 9, 2021

ping @rullzer and @MorrisJobke as top committers in the Memcache namespace. Do you have any guess what might cause memory leaks when running occ with enabled APCu cache?

@kesselb
Copy link
Contributor

kesselb commented Apr 9, 2021

Closing in favour of #26184 #25742

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

4 participants