The Samba-Bugzilla – Bug 13679
python segfaults writing to a const array DEBUGLEVEL_CLASS
Last modified: 2018-11-20 11:26:59 UTC
We get a segfault with the following error:
==10142== Process terminating with default action of signal 11 (SIGSEGV)
==10142== Bad permissions for mapped region at address 0x6F00A20
==10142== at 0x6F1074B: py_set_debug_level (pyglue.c:165)
The code which segfaults is:
(DEBUGLEVEL) = level;
This is the following define:
#define DEBUGLEVEL DEBUGLEVEL_CLASS[DBGC_ALL]
which is an:
extern int DEBUGLEVEL_CLASS;
and initialized with:
int *DEBUGLEVEL_CLASS = discard_const_p(int, debug_class_list_initial);
So we are trying to write to a const pointer and fail!
FWIW, given that your toolchain appears to be tagging and protecting const memory, I expect you'll see many more issues than just this.
Only if we try to write to that memory. However I didn't do a full make test yet. As I tried to fix failing tests.
Created attachment 14639 [details]
patch for 4.9 and 4.8
Karolin, please add the patches to the relevant branches. Thanks!
Pushed to autobuild-v4-8-test.
Pushed to autobuild-v4-9-test.
Pushed to both branches.
Closing out bug report.