Rafal,
The crashes are back on Windows. The problem is now on line#339 in
kernel.cc.
The memory dump of the m_catalog follows.
- m_catalog 0x01e88aa8 {data_size=30 m_snap=0x01e8a70c
m_table_count=1 ...} backup::Image_info *
+ st_bstream_image_header {version=1 server_version={...}
flags=0 ...} st_bstream_image_header
+ __vfptr 0x00ca28f8 const backup::Image_info::`vftable' *
data_size 30 unsigned int
+ m_snap 0x01e8a70c backup::Snapshot_info * [256]
m_table_count 1 unsigned int
+ mem_root {free=0x01e918d8 used=0x00000000
pre_alloc=0x00000000 ...} st_mem_root
+ m_dbs {...} Map<unsigned int,backup::Image_info::Db>
The error generated from the test are:
080312 15:38:40 - mysqld got exception 0xc0000005 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose
the problem, but since we have already crashed, something is definitely
wrong
and this may fail.
key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=1
max_threads=151
threads_connected=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 330558
K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 01E78F78=BACKUP DATABASE test_ob_error TO 'ob_err.bak'
thd->thread_id=1
thd->killed=NOT_KILLED
Chuck
> -----Original Message-----
> From: rsomla@stripped [mailto:rsomla@stripped]
> Sent: Tuesday, March 11, 2008 5:00 AM
> To: commits@stripped
> Subject: bk commit into 6.0 tree (rafal:1.2579) WL#4212
>
> Below is the list of changes that have just been committed
> into a local 6.0 repository of rafal. When rafal does a push
> these changes will be propagated to the main repository and,
> within 24 hours after the push, to the public repository.
> For information on how to access the public repository see
> http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
>
> ChangeSet@stripped, 2008-03-11 10:00:20+01:00, rafal@quant.(none) +3 -0
> WL#4212 (Online Backup : Kernel updates for object metadata changes)
>
> This patch fixes problem found in the Image_info
> destructor. This destructor was refering to Snapshot_info
> objects which are deleted earlier by the Backup_info destructor.
>
> The Snapshot_info destructor is changed to iterate over all
> objects in the catalogue using iterators
> Db_iterator and Dbobj_iterator, which are available at
> destruction time. Also, destructors are explicitly
> called for all catalogue objects to free allocated resources.
>
> sql/backup/backup_info.cc@stripped, 2008-03-11 10:00:16+01:00,
> rafal@quant.(none) +0 -1
> Remove inline declaration causing compile problems.
>
> sql/backup/image_info.cc@stripped, 2008-03-11 10:00:16+01:00,
> rafal@quant.(none) +16 -35
> Change Image_info destructor to explicitly call
> destructors for all items stored in the catalogue.
> Iterators are used to iterate over all databases and all
> objects in each of them.
>
> sql/backup/image_info.h@stripped, 2008-03-11 10:00:16+01:00,
> rafal@quant.(none) +7 -3
> Make destructor of Image_info::Obj to delete server
> object instance if present.
> Fix documentation.
>
> diff -Nrup a/sql/backup/backup_info.cc b/sql/backup/backup_info.cc
> --- a/sql/backup/backup_info.cc 2008-03-05 18:48:05 +01:00
> +++ b/sql/backup/backup_info.cc 2008-03-11 10:00:16 +01:00
> @@ -186,7 +186,6 @@ Backup_info::~Backup_info()
> After this call the @c Backup_info object is ready for use
> as a catalogue
> for backup stream functions such as @c bstream_wr_preamble().
> */
> -inline
> int Backup_info::close()
> {
> if (!is_valid())
> diff -Nrup a/sql/backup/image_info.cc b/sql/backup/image_info.cc
> --- a/sql/backup/image_info.cc 2008-03-05 18:48:05 +01:00
> +++ b/sql/backup/image_info.cc 2008-03-11 10:00:16 +01:00
> @@ -51,48 +51,29 @@ Image_info::Image_info()
>
> Image_info::~Image_info()
> {
> - // Delete server table objects
> + Db_iterator dbit(*this);
> + const Db *db;
> +
> + /*
> + We need to explicitly call destructors for all objects
> in the catalogue
> + since they are allocated using mem_root and thus
> destructors will not be
> + invoked when the mem_root is freed.
> + */
>
> - for (uint n=0; n<256; ++n)
> + while ((db= static_cast<const Db*>(dbit++)))
> {
> - Snapshot_info *snap= m_snap[n];
> -
> - if (!snap)
> - continue;
> -
> - for (ulong i=0; i < snap->table_count(); ++i)
> - {
> - Table *t= snap->get_table(i);
> -
> - if (!t)
> - continue;
> -
> - delete t->m_obj_ptr;
> - }
> - }
> + // iterate over objects in the database
>
> - // delete server database objects
> + Dbobj_iterator it(*this,*db);
> + const Obj *o;
>
> - for (uint i=0; i < db_count(); ++i)
> - {
> - Db *db= get_db(i);
> -
> - if (!db)
> - continue;
> -
> - delete db->m_obj_ptr;
> + while ((o= it++))
> + o->~Obj();
>
> - // delete all server objects belonging to that database
> (except tables)
> - for (ulong j=0; j < db->obj_count(); ++j)
> - {
> - Dbobj *o= db->get_obj(j);
> - if (o)
> - delete o->m_obj_ptr;
> - }
> -
> - // explicitly call destructor since this is mem_root
> allocated object
> db->~Db();
> }
> +
> + free_root(&mem_root, MYF(0));
> }
>
> /**
> diff -Nrup a/sql/backup/image_info.h b/sql/backup/image_info.h
> --- a/sql/backup/image_info.h 2008-03-05 18:48:05 +01:00
> +++ b/sql/backup/image_info.h 2008-03-11 10:00:16 +01:00
> @@ -60,7 +60,7 @@ public: // public interface
> class Iterator; ///< Base for all iterators.
> class Db_iterator; ///< Iterates over all databases.
> class Perdb_iterator; ///< Iterates over all
> per-database objects (except tables).
> - class Dbobj_iterator; ///< Iterates over tables in a database.
> + class Dbobj_iterator; ///< Iterates over objects in a database.
>
> virtual ~Image_info();
>
> @@ -300,7 +300,8 @@ Snapshot_info::~Snapshot_info()
> @c obs::Obj, to be used by server's objects services API.
> If @c m_obj_ptr is
> not NULL then it contains a pointer to the corresponding
> @c obs::Obj instance
> which was obtained earlier (either with @c materialize()
> or from server's
> - object iterators).
> + object iterators). The @c Obj instance owns the server
> object and is
> + responsible for deleting it.
> */
> class Image_info::Obj: public Sql_alloc { @@ -350,7 +351,10
> @@ Image_info::Obj::Obj() :m_obj_ptr(NULL)
>
> inline
> Image_info::Obj::~Obj()
> -{}
> +{
> + // Delete corresponding server object if present.
> + delete m_obj_ptr;
> +}
>
> /**
> Specialization of @c Image_info::Obj for storing info
> about a database.
>
> --
> MySQL Code Commits Mailing List
> For list archives: http://lists.mysql.com/commits
> To unsubscribe:
> http://lists.mysql.com/commits?unsub=1
>