hh_server sharedmem_hash_table_pow useful error message
- Dominant language
- C++
- Stars
- 18.7k
- Forks
- 3.1k
- Avg merge
- 1h 47m
- Merged PRs (30d)
- 2
Description
### HHVM Version
HHVM 3.15.3 and current master (537f8d8683fb3b4), running on Ubuntu 12.04.
### Standalone code, or other way to reproduce the problem
```
$ hh_server --check .
```
### Expected result
`hh_server` reports errors.
### Actual result
```
$ hh_server --check .
[2016-12-06 14:11:24] Could not load config at /etc/hh.conf, using defaults
[2016-12-06 14:11:24] Version: 965cd8d30670726d88720412c3384225a2da011d Sat Nov 19 08:54:55 2016
[2016-12-06 14:11:24] Could not load config at /etc/hh.conf, using defaults
[2016-12-06 14:11:24] Could not load config at /etc/hh.conf, using defaults
[2016-12-06 14:11:24] Indexing: 0.000224
[2016-12-06 14:11:28] Heap size: 105277568
[2016-12-06 14:11:28] Parsing: 3.922567
[2016-12-06 14:11:28] Loading mini-state: 0.000369
[2016-12-06 14:11:28] Heap size: 108058112
[2016-12-06 14:11:28] Naming: 0.084536
[2016-12-06 14:11:30] Heap size: 133866176
[2016-12-06 14:11:30] Type-decl: 2.364956
[2016-12-06 14:11:30] Finding changed files: 0.000370
[2016-12-06 14:11:43] Heap size: 133988416
[2016-12-06 14:11:43] Type-check: 12.491089
[2016-12-06 14:11:43] Dependency table load factor: 0 / 262144 (0.00)
Bus error (core dumped)
```
#### Backtrace for 3.15.3 ([failing line](https://github.com/facebook/hhvm/blob/HHVM-3.15.3/hphp/hack/src/heap/hh_shared.c#L410))
```
Core was generated by `hh_server --check .'.
Program terminated with signal 7, Bus error.
#0 hh_hash_used_slots () at heap/hh_shared.c:410
410 count++;
(gdb) bt
#0 hh_hash_used_slots () at heap/hh_shared.c:410
#1 0x000000000055f638 in camlSharedMem__hash_stats_1186 () at heap/sharedMem.ml:202
#2 0x0000000000463de5 in camlServerInit__print_hash_stats_1976 () at server/serverInit.ml:345
#3 0x000000000046433e in camlServerInit__init_1986 () at server/serverInit.ml:437
#4 0x0000000000460ea4 in camlServerMain__program_init_1675 () at server/serverMain.ml:345
#5 0x00000000004611fa in camlServerMain__run_once_1851 () at server/serverMain.ml:394
#6 0x000000000045f595 in camlHhServerMonitor__start_1210 () at server/hhServerMonitor.ml:151
#7 0x000000000045ede0 in camlHh_server__entry () at hh_server.ml:52
#8 0x000000000045c409 in caml_program ()
#9 0x00000000005fae2e in caml_start_program ()
#10 0x00000000005fafa0 in caml_system__code_end ()
#11 0x0000000000000000 in ?? ()
(gdb) quit
```
I'm not sure if it's the `count++` that's really failing or the `hashtbl[i].addr` of the previous line.
#### Backtrace for master (537f8d8683fb3b4) ([failing line](https://github.com/facebook/hhvm/blob/537f8d8683fb3b4/hphp/hack/src/heap/hh_shared.c#L456))
```
Core was generated by `hh_server --check .'.
Program terminated with signal 7, Bus error.
#0 hh_hash_used_slots () at heap/hh_shared.c:456
456 filled_slots++;
(gdb) bt
#0 hh_hash_used_slots () at heap/hh_shared.c:456
#1 0x00000000005c0977 in camlSharedMem__hash_stats_1192 () at heap/sharedMem.ml:217
#2 0x000000000047ed86 in camlServerInit__print_hash_stats_2122 () at server/serverInit.ml:657
#3 0x000000000047f0f8 in camlServerInit__init_2143 () at server/serverInit.ml:704
#4 0x000000000047ad54 in camlServerMain__program_init_1848 () at server/serverMain.ml:374
#5 0x000000000047b0dd in camlServerMain__run_once_1875 () at server/serverMain.ml:438
#6 0x0000000000479325 in camlHhServerMonitor__start_1237 () at server/hhServerMonitor.ml:168
#7 0x0000000000478a40 in camlHh_server__entry () at hh_server.ml:52
#8 0x0000000000475f89 in caml_program ()
#9 0x000000000073cdee in caml_start_program ()
#10 0x000000000073cf60 in caml_system__code_end ()
#11 0x0000000000000000 in ?? ()
(gdb) quit
```
Contributor guide
Assessment
This issue has not been assessed yet.