Can't load pbxt plugin

Bug #572029 reported by Lee Bieber
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
Critical
Paul McCullagh
Cherry
Fix Released
Critical
Paul McCullagh

Bug Description

I'm hoping this is a pilot error on my part. I've tried this on both Ubuntu and OSX, this is build 1513 which is the latest in trunk

% ./configure --with-pbxt-plugin && make && make install

Then starting drizzled:
% drizzled --no-defaults --mysql-protocol-port=9306 --drizzle-protocol-port=9307 --user=root --datadir=/tmp --plugin_add=pbxt
.........
100429 21:08:51 InnoDB Plugin 1.0.4 started; log sequence number 0
Can't open shared library '/home/lbieber/repos/install/lib/drizzle/libpbxt_plugin.so' (errn
o: 0 /home/lbieber/repos/install/lib/drizzle/libpbxt_plugin.so: undefined symbol: _ZN8drizz
led36session_mark_transaction_to_rollbackE)Couldn't load plugin library named 'pbxt'.
Failed to initialize plugins.Aborting
/home/lbieber/repos/install/sbin/drizzled: Shutdown complete
Error in my_thread_global_end(): 1 threads didn't exit

Related branches

Changed in drizzle:
status: New → Confirmed
assignee: nobody → Monty Taylor (mordred)
importance: Undecided → Critical
milestone: none → 2010-05-10
Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

I think the problem is that the session_mark_transaction_to_rollback() "callback" is declared in PBXT this as ::drizzled::session_mark_transaction_to_rollback.

This used to work.

But I see that InnoDB declares session_mark_transaction_to_rollback() as global. Unfortunately the prototype of session_mark_transaction_to_rollback() is not in any header file, so we do not notice this problem until will try to load the PBXT dynamic lib.

I will correct this and test...

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Oops, my mistake. It is defined as it should be:

./drizzled/plugin.h:426: void drizzled::session_mark_transaction_to_rollback(drizzled::Session*, bool)

So maybe fails because of the call types...

Revision history for this message
Monty Taylor (mordred) wrote : Re: [Bug 572029] Re: Can't load pbxt plugin

On 04/30/2010 09:04 AM, Paul McCullagh wrote:
> Oops, my mistake. It is defined as it should be:
>
> ./drizzled/plugin.h:426: void
> drizzled::session_mark_transaction_to_rollback(drizzled::Session*, bool)
>
> So maybe fails because of the call types...
>

Good chance this has to do with extern "C" and non extern "C"...

I believe I have this fixed in a branch - testing.

(FWIW, virtually nothing in the core should be marked at extern "C" -
only callback functions that are passed to c-based system libraries like
pthread.)

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Just figured out that drizzled::session_mark_transaction_to_rollback() does indeed not exist anymore.

So I guess Drizzle no longer needs to be told to do a rollback on error. Cool! :)

Revision history for this message
Monty Taylor (mordred) wrote :

On 04/30/2010 10:15 AM, Monty Taylor wrote:
> On 04/30/2010 09:04 AM, Paul McCullagh wrote:
>> Oops, my mistake. It is defined as it should be:
>>
>> ./drizzled/plugin.h:426: void
>> drizzled::session_mark_transaction_to_rollback(drizzled::Session*, bool)
>>
>> So maybe fails because of the call types...
>>
>
> Good chance this has to do with extern "C" and non extern "C"...
>
> I believe I have this fixed in a branch - testing.
>
> (FWIW, virtually nothing in the core should be marked at extern "C" -
> only callback functions that are passed to c-based system libraries like
> pthread.)
>

Ah - nope. Even better.

session_mark_transaction_to_rollback in plugin.h doesn't exist. There is
no implementation of it. It has been moved to be a member methods of
Session ... so Session::mark_transactio_to_rollback. The signature in
plugin.h is just there to tease you. :)

Revision history for this message
Monty Taylor (mordred) wrote :

On 04/30/2010 10:44 AM, Paul McCullagh wrote:
> Just figured out that drizzled::session_mark_transaction_to_rollback()
> does indeed not exist anymore.
>
> So I guess Drizzle no longer needs to be told to do a rollback on error.
> Cool! :)
>

:)

It seems to have been renamed to mark_transaction_to_rollback. My last
mail about being a session method is wrong. :)

This fixed it:

== modified file 'plugin/pbxt/src/xt_defs.h'
--- plugin/pbxt/src/xt_defs.h 2010-04-19 20:57:43 +0000
+++ plugin/pbxt/src/xt_defs.h 2010-04-30 17:53:57 +0000
@@ -887,7 +887,7 @@
  #define thd_charset session_charset
  #define thd_slave_thread session_slave_thread
  #define thd_binlog_format session_binlog_format
-#define thd_mark_transaction_to_rollback
::drizzled::session_mark_transaction_to_rollback
+#define thd_mark_transaction_to_rollback
::drizzled::mark_transaction_to_rollback
  #define thd_ha_data session_ha_data
  #define current_thd current_session
  #define thd_sql_command session_sql_command

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Yup, thanks. Sometimes it is just so simple....

Changed in drizzle:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.