Hi Steve On Tue, Mar 20, 2018 at 02:10:52PM -0700, Steve Langasek wrote: > Considering debian/rules also hardcodes -O2 for the package itself, it > doesn't seem inappropriate to also build the test shim with the same > options? > Yes, this is working around a toolchain issue. Feel free to reassign this > bug to the toolchain, if you prefer.
I digged deeper and the arguments do not matter. The whole problem is not a toolchain issue, it's actually triggered by a small different in the used prototypes. > FWIW I was able to identify a symbol reference that drops out of the .so > when built with -O3 but is present when built with -O2; this may be the > cause of the crash: > -0000000000000000 DF *UND* 0000000000000000 GLIBC_2.17 0x60 > __stack_chk_fail > And perhaps that points to an explanation of the toolchain bug. In my own tests this different does not show up. Also it's a undefined symbol, so it is for a call into something else. > It's annoyingly difficult to debug this crash, as gdb doesn't appear to let > me DTRT with 'set env LD_PRELOAD' and instead manages to crash itself before > handing control over to the process under test. Yes, it is. And adding debugging output makes it disappear. Anyway, the cause is: | static int (*orig_open)(const char *pathname, int flags, int mode); This does not match the public prototype for the open function. Regards, Bastian -- Insufficient facts always invite danger. -- Spock, "Space Seed", stardate 3141.9