Comment 1 for bug 439889

Revision history for this message
Sergey Petrunia (sergefp) wrote :

My analysis shows that PBXT (myxt_create_thread() in storage/pbxt/src/myxt_xt.cc in particular) thinks that sizeof(THD) is 7092,
while the SQL layer (THD::store_globals() in particular) thinks that sizeof(THD) is 6880).

When myxt_create_thread() will make this assignment:

  new_thd->thread_stack = (char *) &new_thd;

it will "miss" the thread_stack variable and set value of something else. THD::store_globals(), which is called immediately after, will still see thread_stack==0 and fail an assertion.

The reason for sizeof difference seems to be that THD has different sizes depending on whether it is an embedded server or not. PBXT has sizeof(THD) from non-embedded server and hence fails in embedded server.