This discussion is archived
3 Replies Latest reply: Dec 13, 2012 7:56 AM by userBDBDMS RSS

"BDB0058 page 0: illegal page type or format" error in MIPS environment.

976590 Newbie
Currently Being Moderated
Hi, I downloaded the latest Berkeley DB 11gR2 (11.2.5.3.21) and compiled successfully.
Test example was OK in Ubuntu 12.10 on PC. But it was not OK on embedded target(MIPS) board.

Test example is in the "examples/c/getting_started" directory.
(I just compiled and didn't modify any source in this directory.)

On Ubuntu 12.10, I executed "example_database_load" and got the good result as below.
(I also saw that the vendorDB.db file was generated successfully.)

odyssey@ubuntu$ ./example_database_load
databases opened successfully
databases closed.
Done loading databases.
odyssey@ubuntu$

But I met a problem on our target(MIPS) board as below and I could't see the vendorDB.db file.
(In order to execute I moved three files to our target board. 3 files are example_database_load,
inventory.txt and vendors.txt.

# ./example_database_load
databases opened successfully
example_database_load: BDB0058 page 0: illegal page type or format
example_database_load: BDB0061 PANIC: Invalid argument
example_database_load: BDB0060 PANIC: fatal region error detected; run recovery
example_database_load: BDB0060 PANIC: fatal region error detected; run recovery
example_database_load: BDB0060 PANIC: fatal region error detected; run recovery
example_database_load: BDB0060 PANIC: fatal region error detected; run recovery
example_database_load: BDB0060 PANIC: fatal region error detected; run recovery
example_database_load: BDB0058 page 0: illegal page type or format
example_database_load: BDB0061 PANIC: Invalid argument
example_database_load: BDB0060 PANIC: fatal region error detected; run recovery
example_database_load: BDB0060 PANIC: fatal region error detected; run recovery
:
:
example_database_load: BDB0060 PANIC: fatal region error detected; run recovery
example_database_load: BDB0060 PANIC: fatal region error detected; run recovery
Itemname database close failed: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
example_database_load: BDB0060 PANIC: fatal region error detected; run recovery
Vendor database close failed: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
databases closed.
Done loading databases.
#

I could find and refer the below link in this forum.
Re: Why get error: BDB0061 PANIC: Invalid argument

So I checked what function did make error.
I found that we met the error at the same point explained on the upper link (dbp->get, dbp->put).
But I don’t know how to use DB->set_errfile() for debugging.
What should I check firstly?


Thanks
Dohyun
  • 1. Re: "BDB0058 page 0: illegal page type or format" error in MIPS environment.
    userBDBDMS Guru Moderator
    Currently Being Moderated
    Hi Dohyun,

    This error indicates that there is an issue in the page header. Lets walk this through step by step. How did you get the BDB libraries, example code and db over to the MIPS machine? Please describe the MIPS machine you are using in a little more detail.

    thanks
    mike
  • 2. Re: "BDB0058 page 0: illegal page type or format" error in MIPS environment.
    976590 Newbie
    Currently Being Moderated
    Dear mike,

    I just downloaded BDB from oracle web site as below.
    http://www.oracle.com/technetwork/products/berkeleydb/downloads/index.html
    That file is "Berkeley DB 5.3.21.tar.gz".
    And then I just configured and compiled it as below. (in the "build_unix" directory.)
    1) env CC=/opt/buildroot-gcc342/bin/mipsel-linux-uclibc-gcc cross_compiling=yes enable_posixmutexes=yes enable-pthread_api=yes ../dist/configure with-mutex=MIPS/gcc-assembly host=mipsel
    (I did modify the "src/dbinc/mutex_int.h" file. I added ".set mips2" in the MUTEX_UNSET function.)
    2) make
    3) make example
    After doing these sequence, I could get the binary files(example_database_load and example_database_read).
    And you will be able to get two text files in the "/examples/c/getting_started" directory.
    That's all of what I did.

    About MIPS core, you will be able to refer to below link.
    http://www.ralinktech.com/en/02_products/product.php?sn=1006

    Thanks
    Dohyun
  • 3. Re: "BDB0058 page 0: illegal page type or format" error in MIPS environment.
    userBDBDMS Guru Moderator
    Currently Being Moderated
    Dohyun,

    It looks like there is an issue in the compile. Cross compiling can be very tricky. Also, why did you modify the code? What are you trying to achieve?

    What I am guessing is during the compile the incorrect offsets are being generated for our .H files and the page is not getting created correctly on disk, hence the illegal page type error. We have all sorts of #defines that turned on/off during compile.

    Lets take this off the OTN thread and discuss directly. Please email me at michael(dot)brey(at)oracle(dot)com {michael.brey@oracle.com}.

    thanks
    mike

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points