Percona Data Recovery Tool for InnoDB

Memory leak in constraints_parser

Reported by Łukasz Czuja on 2012-01-27
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona Data Recovery Tool for InnoDB
Critical
Aleksandr Kuzminsky

Bug Description

Using latest r39.

I've created table_defs.h, plit up innodb tablespace and run constraints_parser:

./constraints_parser -5 -U -f pages-1327560628/FIL_PAGE_INDEX/0-16 -b pages-1327560628/FIL_PAGE_TYPE_BLOB > recovered.tsv

The problem here is that data is very large and running constraints_parser exhausts 4gb memory after 0,5-1h after started and the application is killed when memory runs out. I can see constant memory grow of constraints_parser process.

The table I'm trying to recover contains to fields, unsigned int pk, and longblob.

I also have recently migrated from mysql 5.1 to 5.5.19 but the innodb data should be in 5.1 format.

*page pointer is never released:

void process_ibfile(int fn) {
        int read_bytes;
        page_t *page = malloc(UNIV_PAGE_SIZE);

Changed in percona-data-recovery-tool-for-innodb:
status: New → Confirmed
importance: Undecided → Critical
milestone: none → release-0.6
Łukasz Czuja (lukasz-czuja) wrote :

You mean page_parser.c:214 @ r43 ?

Since this is a local variable and this method is called only once I sincerely doubt this is it.

The *page pointer is also never used!

Łukasz Czuja (lukasz-czuja) wrote :

Whoops, its constraints_parser.c:536 @ r43, you're right. However in page_parser.c is a memleak too since *page is never used and freed.

Both memory leaks are fixed.
The memleak in page_parser wasn't harmful because *oage was allocated once

Changed in percona-data-recovery-tool-for-innodb:
status: Confirmed → Fix Committed
assignee: nobody → Aleksandr Kuzminsky (akuzminsky)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers