I wanted to post this as a bug, but I don't even have a clue to whom should I report it. Here it is.
I have installed Odoo 9.0 on a standard Alpine 3.5, with both the packaged Python 2.7.13 and I have also tried with the same version of python compiled from the sources, but the result is identical:
When I navigate from any view in the Odoo application to the Accounting dashboard python segfaults. The odd thing is that if I copy the URL of the Accounting dashboard and paste into the navigation bar – this way forcing a load of the entire page – it all works ok. I tried gdb on the python interpreter to see what happens. The error seems to be mostly consistent, but unfortunately the information I got is not that helpful:
Thread 34 "python2" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 13754]
0x00007ffff7dc52f5 in sem_timedwait () from /lib/ld-musl-x86_64.so.1
(gdb) bt
#0 0x00007ffff7dc52f5 in sem_timedwait () from /lib/ld-musl-x86_64.so.1
#1 0x0000000000000000 in ?? ()
On very rare occasions the error is different, I managed to catch it once in the debugger:
Thread 47 "python2" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 4096]
0x00007ffff7a58b00 in _PyType_Lookup (type=type@entry=0x555555888280, name=name@entry=0x7ffff7e3fb90) at Objects/typeobject.c:2527
2527 Objects/typeobject.c: Permission denied.
(gdb) bt
#0 0x00007ffff7a58b00 in _PyType_Lookup (type=type@entry=0x555555888280, name=name@entry=0x7ffff7e3fb90) at Objects/typeobject.c:2527
#1 0x00007ffff7a4372c in _PyObject_GenericGetAttrWithDict (obj=0x7fffec6b66d0, name=0x7ffff7e3fb90, dict=0x0) at Objects/object.c:1389
#2 0x00007ffff7a8adb5 in PyEval_EvalFrameEx (f=f@entry=0x7fffedd8eb90, throwflag=throwflag@entry=0) at Python/ceval.c:2543
#3 0x00007ffff7a8e3c7 in PyEval_EvalCodeEx (co=0x7ffff7e3abb0, globals=<optimized out>, locals=locals@entry=0x0, args=<optimized out>, argcount=<optimized out>, kws=<optimized out>, kwcount=0, defs=0x7ffff7e60568, defcount=1, closure=0x0) at Python/ceval.c:3584
#4 0x00007ffff7a8c671 in fast_function (nk=0, na=<optimized out>, n=1, pp_stack=0x7fffebada318, func=0x7ffff7e53b18) at Python/ceval.c:4447
...
The stack trace in this case is quite long, this is just a fragment. Just to get that out of the way I did try with both the grsec kernel and a vanilla one, same result.
I'm rather new with python so any ideas on how to debug further, or workaround this issue would be greatly appreciated.