[MDEV-3195] LP:439889 - Embedded server asserts on startup because of pbxt Created: 2009-10-01 Updated: 2012-10-04 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
Attempt to run any test with --embedded server will fail becasue of pbxt in the following way: ./mysql-test-run --embedded-server t/alias.test
============================================================================== TEST RESULT TIME (ms) worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009 CURRENT_TEST: main.alias
Failed 1/1 tests, 0.00% were successful. Failing test(s): main.alias |
| Comments |
| Comment by Sergei Petrunia [ 2009-10-01 ] |
|
Re: Embedded server asserts on startup because of pbxt 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. |
| Comment by Sergei Petrunia [ 2009-10-01 ] |
|
Re: Embedded server asserts on startup because of pbxt 1. Disable PBXT in embedded build (but how exactly can one do that?) 2. Let PBXT be indepdendent of sizeof(THD): let SQL layer provide a factory function for THD and accessor functions for whatever members PBXT needs. |
| Comment by Paul McCullagh (Inactive) [ 2009-10-01 ] |
|
Re: Embedded server asserts on startup because of pbxt According to your analysis, PBXT is being compiled with the wrong options. I am wondering, when MySQL is built, does it: 1) build 2 objects for each source file: one for mysqld and the other for the server embedded library? 2) or does it use the same object to link both mysqld and the embedded library? |
| Comment by Sergei Petrunia [ 2009-10-01 ] |
|
Re: Embedded server asserts on startup because of pbxt For SQL layer, #1 is true. It does build two objects for each source file. The regular server is compiled in sql/ while embedded server is in libmysqld/ (which is populated with symbolic links to sql/*.cc). For storage engines, #1 is used by default. There are storage engines that have some files that are dependent on server's internals and they've got a plug.in file directive named For example, storage/heap/plug.in has: MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(heap, [ha_heap.cc]) I've grepped for 'thd->' in PBXT source code, which hinted at the need to add: MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(pbxt, [src/ha_pbxt.cc]) The problem is that that doesn't work because it looks like at the moment each plugin can only have one MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS clause (see http://lists.mysql.com/internals/37339). Does PBXT really need to depend so much on server internals? (from three files. other storage engines, e.g. InnoDB all have one dependant file). |
| Comment by Paul McCullagh (Inactive) [ 2009-10-02 ] |
|
Re: [Bug 439889] Re: Embedded server asserts on startup because of pbxt Unfortunately PBXT does rely a lot on MySQL internals. It is a small thing which has wide consequences. PBXT uses the MySQL internal data dictionary. Not only for information So to avoid having to re-write or duplicate this code in the engine, This is normally no problem for an engine that only accesses tables in But there are 2 instances in which the is not the case for PBXT: 1. During recovery Both the recovery process, and the background threads require a TABLE If the table has not yet been opened then PBXT is required to open a This in turn means that the recovery process and the background So this, in turn, leads to some hacking, because there are no I suggest the following approach to this problem: 1. If possible, we should disable PBXT in the runtime context. Do you 2. Next we should prevent the PBXT recovery process and the background This used to be the case, but since the change to the "global 3. Either we need to fix MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(), or However, if by dependencies we mean all references to MySQL internal If it is just references to THD, then this is not quite so bad. Best regards, Paul On Oct 1, 2009, at 11:15 PM, Sergey Petrunia wrote: > Hi Paul, – |
| Comment by Hakan Küçükyılmaz (Inactive) [ 2009-11-26 ] |
|
Re: Embedded server asserts on startup because of pbxt Thanks |
| Comment by Vladimir Kolesnikov (Inactive) [ 2009-12-09 ] |
|
Re: Embedded server asserts on startup because of pbxt |
| Comment by Rasmus Johansson (Inactive) [ 2010-02-11 ] |
|
Launchpad bug id: 439889 |