> - How big is that "existing stack usage" in the thread by the time it's
> calculated?
About 4K.
(gdb) p (stack_addr + stack_size) - &error
$24 = 4825
(gdb) bt
#0 my_thread_init () at 5.6/mysys/my_thr_init.c:313
#1 0x0000000000aa8b6b in timer_notify_thread (arg=0x7fffffffd1c0)
at 5.6/mysys/posix_timers.c:64
#2 0x00007ffff737d182 in start_thread (arg=0x7fffdd584700) at pthread_create.c:312
#3 0x00007ffff6889fbd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
> -
> [ 12%] Building C object mysys/CMakeFiles/mysys.dir/my_thr_init.c.o
> /Users/laurynas/percona/lp-mysql-
> server/5.5-bug-1351148/mysys/my_thr_init.c:363:38: error: invalid operands to
> binary expression ('char *' and 'int')
> tmp->stack_ends_here= (char *)&tmp & (~(my_getpagesize() - 1)) +
> ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixed.
> - How big is that "existing stack usage" in the thread by the time it's
> calculated?
About 4K.
(gdb) p (stack_addr + stack_size) - &error my_thr_ init.c: 313 d1c0) posix_timers. c:64 4700) at pthread_ create. c:312 unix/sysv/ linux/x86_ 64/clone. S:111
$24 = 4825
(gdb) bt
#0 my_thread_init () at 5.6/mysys/
#1 0x0000000000aa8b6b in timer_notify_thread (arg=0x7fffffff
at 5.6/mysys/
#2 0x00007ffff737d182 in start_thread (arg=0x7fffdd58
#3 0x00007ffff6889fbd in clone () at ../sysdeps/
> - s/mysys. dir/my_ thr_init. c.o laurynas/ percona/ lp-mysql- my_thr_ init.c: 363:38: error: invalid operands to ends_here= (char *)&tmp & (~(my_getpagesize() - 1)) + ~~~~~~~ ~~~~~~~ ~~~~~~
> [ 12%] Building C object mysys/CMakeFile
> /Users/
> server/5.5-bug-1351148/mysys/
> binary expression ('char *' and 'int')
> tmp->stack_
> ~~~~~~~~~~~~ ^ ~~~~~~~
Fixed.