[SERVER-31834] Server assert failed when using $where Created: 06/Nov/17 Updated: 07/Dec/17 Resolved: 14/Nov/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | JavaScript |
| Affects Version/s: | 3.4.9, 3.4.10 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | wener | Assignee: | Mark Agarunov |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Steps To Reproduce: | db.col.find({$where:'true'}) |
| Participants: |
| Description |
|
Server running in docker on alpine host.
|
| Comments |
| Comment by wener [ 16/Nov/17 ] | |||
|
I also create a issues for nodejs https://github.com/nodejs/docker-node/issues/588 if they fixed this, I hope mongo fix this too. | |||
| Comment by wener [ 16/Nov/17 ] | |||
|
I use official mongo docker image, I suppose this is maintained by official team. It's not related to alpine, if other os enabled grsec, enabled MPROTECT, this will happen too. | |||
| Comment by Mark Agarunov [ 10/Nov/17 ] | |||
|
Hello wener, Thank you for the additional information and I'm glad you've found a solution to this problem. Unfortunately at this time neither Alpine Linux nor the grsec patches are officially supported configurations for MongoDB, so there is no established build official process for them. While I am not too familiar with Alpine linux, they appear to maintain their own package repositories, and likely build the packages for Alpine Linux. I would recommend trying to contact the maintainers of the MongoDB package for Alpine Linux with the information you've found. As I do not see anything that would indicate a bug in the MongoDB Server, I've closed this ticket. Thanks, | |||
| Comment by wener [ 08/Nov/17 ] | |||
|
It's caused by gresec, mongo use jit for js, need exec for mmap, by default, this is not allowed, need add a pax header to disable MPROTECT. This step should added in mongo's build line.
| |||
| Comment by wener [ 08/Nov/17 ] | |||
|
I think this is the same problem as Kelsey T Schubert (JIRA) <jira@mongodb.org>于2017年11月8日周三 上午12:15写道: | |||
| Comment by Andrew Morrow (Inactive) [ 07/Nov/17 ] | |||
|
wener - I suspect that Apline linux is prohibiting some memory management operation that the JIT requires. Can you try running under strace and see if you see any syscalls coming back with EPERM or similar immediately before the crash? | |||
| Comment by wener [ 07/Nov/17 ] | |||
|
After `db.adminCommand( { setParameter: 1, disableJavaScriptJIT: true })`, no more assert failed. | |||
| Comment by Andrew Morrow (Inactive) [ 06/Nov/17 ] | |||
|
Could you try 3.4.10 with the --disableJavaScriptJIT (https://docs.mongodb.com/v3.4/reference/parameters/#param.disableJavaScriptJIT) flag and see if it still crashes? | |||
| Comment by wener [ 06/Nov/17 ] | |||
|
I also tried 3.4.10, still failed. |