Bt_compare_fcn_type: Second DBT corrupted?

Folks-
I have a BTree db, opened as part of an env:
cEnvFlags = DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG |DB_INIT_MPOOL|DB_INIT_TXN;
m_pDbEnv = new DbEnv(0);
m_pDbEnv->open("Env_Home", cEnvFlags, 0);
// db
m_pdb = new Db(m_pDbEnv, 0);
m_pdbWK->set_bt_compare(bt_compare_fcn_type_wk);
m_pdbWK->open(NULL, "MY_DB" NULL, DB_BTREE, DB_CREATE|DB_AUTO_COMMIT, 0);
I insert a new record with the key set to Windows GetTickCount() function (to get a unique number since the start of 'this' session)
DWORD dw = GetTickCount();
Dbt key;
key.set_data(&dw);
key.set_ulen(sizeof(DWORD));
Dbt data(pData, dataLen);
try
m_pdbWK->put(NULL, &key, &data, 0);
catch(DbException &e)
in my compare function I do the following:
int bt_compare_fcn_type_wk(DB db, const DBT dbt1, const DBT *dbt2)
DWORD dw1, dw2;
memcpy(&dw1, dbt1->data, sizeof(DWORD));
memcpy(&dw2, dbt2->data, sizeof(DWORD));
if (dw1 == dw2)
return 0;
else
return dw1 > dw2;
However dbt2 does not appear to point to any valid data. The size and ulen members are always 0 and the *(data) memory location does not have valid data.
I was expecting dbt2 to be the key from the 'last' insert. What am I doing wrong here?
I'm using MS VC++ 6.0 on XP Prof.
Any help is greatly appreciated.

The dbts passed to your callback are either the one passed in by the application, or a record that is in the database. So I suspect you have somehow inserted an empty key into the database (which Berkeley DB supports without complaining), and you're now seeing that record in the callback when Berkeley DB is finding the correct location for the newly-inserted key.
Take a look at the data in the database (the easiest way is to run the "db_dump" utility against your database and check for blank lines).
If you don't see an empty key in the db_dump output, can you please post a stack dump for when the callback hits this?
Regards,
Michael Cahill, Oracle.

Similar Messages

  • CD audio Data copying = 5 seconds of corrupt data at top of file...

    Hi,
    I have the following problem with reading audio CDs:
    When copying an audio track onto my internal SATA drive, or my external FW400 drive, almost always I am getting this symptom.
    The first few seconds of data are corrupted. Each time the amount of data corrupted is different, and usually is about 2 to 5 secornds in length.
    This is the machine I have:
    Hardware Overview:
    Machine Name: Power Mac G5
    Machine Model: PowerMac11,2
    CPU Type: PowerPC G5 (1.1)
    Number Of CPUs: 2
    CPU Speed: 2 GHz
    L2 Cache (per CPU): 1 MB
    Memory: 2 GB
    Bus Speed: 1 GHz
    Boot ROM Version: 5.2.7f1
    Serial Number: XXXXXXXXXXX
    And I use the following external USB CD burner / player to copy CDs with:
    LaCie DVD Drive USB2:
    Version: 0.00
    Bus Power (mA): 500
    Speed: Up to 480 Mb/sec
    Manufacturer: LaCie
    Product ID: 0x0623
    Serial Number: 10000XXXXXXXXX
    Vendor ID: 0x059f
    Is anyone experiencing this issue? Is there a fix?
    I work with audio 24/7 and this is starting to slow down my workflow, and is very inconvenient.
    Thanks.

    No one actually answered this question.
    Bummer.

  • Strange corruption problem with AVCHD

    This problem is so weird I can't even figure out how to explain it, but here goes:
    I have video taken in the AVCHD file structure (puts clip into a nesting of folders, the MTS files are playable by Windows Media Player/VLC). The problem I'm having is that one of the clips has a couple seconds of corruption in the 8th minute (of an 78 min clip). Playing the clip in Windows Media Player/VLC, the clip recovers and plays just fine immediately after that point, however, in Premiere Pro CS 5.5, the audio goes into a loop for the next hour or so of footage, but then finally recovers and plays fine for the last 15 min.
    Why is Premiere handling the corruption so differently than the media players? Naturally, I would really like to have Premiere recognize all of the intact audio!
    Thanks for any suggestions/help.
    Kristofor

    Your original file is obviously way too big to provide for download.
    > I didn't think it would be possible to take a section of an MTS file directly
    It's not straighforward. There may be a utility somewhere that allows you to mark in and out points, and then cuts the original MTS file into exact copies of the marked sections - but I don't know of one offhand.
    As I said earlier, you can use a hex editor to trim sections of the file before and after the section of interest, but finding the "section of interest" will be guesswork and may require a few attempts. Frankly it may not be worth the effort for you if you aren't familiar with using a hex editor.

  • Files get corrupted in Lightroom 4, through 4.4

    So I was going to comment on one of the other posts about the corrupted files but it was soooo long I decided to start a new one.
    This should give me a hint that it is not HARDWARE....
    To start with I am shooting a Canon 5d mkIII and RAW(.CR2) files
    A slight kink in everyones generic answer that it is a hardware issue; I reproduced this on two computers using the same .cr2 files copied from the same original downloaded files.  Lightroom corrupted files on import on both computers.
    Also to test the answer it was corrupt before it went into Lightroom.  I always copy the raw .cr2 file to my laptop and then to a external drive from the laptop directory, not from the compact flash.  I looked at a .cr2 file with Photoshop and it was fine.  Then I imported that same file with all of the other .cr2 files in the directory into Lightroom 4 and it was corrupt along with many others. 
    My disappointment is that when I tried to open the same .CR2 file, that was fine a moment earlier with Photoshop, it too was corrupted.  I thought Lightroom was non-destructive to the original file.
    I deleted that .cr2 file and restored the backed up file that was a copy of the original and imported that single file into Lightroom and it was now fine.
    Sorry but not acceptable.

    Replying to myself:
    I digged into some reverse-engineered CR2 specifications on the net and found 5 things:
    Canon uses a lossless compression in their CR2 files. So that suspicion was confirmed.
    The algorithm does not seem to have changed substantially in later models. So that suspicion was not confirmed.
    Before doing the compression, the raw photo is divided into vertical slices. Usually 2 or 3 slices, it seems, though I am not sure). This seems to explain why we sometimes see a corrupt lower quadrant of a Canon photo.
    According to one source, the image is "interlaced" before compression, so all lines with RG information are kept together, as are all lines with GB information. Based on that, I would expect to see photos with every second line corrupted, if we could see the photo prior to demosaicing. But since we only see the photos after demosaicing (which involves combining information from several lines), that is not really relevant.
    The compression algorithm used is Lossless JPG which uses Huffmann encoding for compression. This seems to me like a method which has good corruption potential.
    The long version of my reasoning for the corruption potential of Lossless JPEG + Huffman encoding (just skip it if it is too boring):
    I have heard about Huffman encoding many times before, but I have never bothered to find out how it works. This thread was a good reason to bother, so I finally did it.
    Lossless JPEG works by predicting the value of each pixel based on the pixels above it and to the left of it. The difference between the actual pixel value and the prediction is then stored as a prediction error. The original pixel values can then be thrown away because the raw decoder can precisely reconstruct them from the prediction errors and knowledge of the prediction method used.
    This means that it is only necessary to store the prediction errors in the file. Even though the original pixel values will be very different, a lot of pixels will have the same prediction error (close to zero). This makes it easier to compress the prediction errors than the original pixel values.
    The prediction errors are compressed using Huffman encoding which works sort of the same way as international dialing prefixes (this is a comparison I have come up with myself):
    There are more than 100 countries in the world, so we sometimes have to use a 3 digit prefix. But we don't use 3 digit prefixes all the time. For example, USA is +1 and Denmark is +45. So when you punch for example '+4512345678', how does the phone system know that the international prefix part of the number is exactly +45 and not +4 or +451?
    The answer is that one international prefix is never used as the first digits in another international prefix. So +10, +11 ... +19 and +100, +101 ... +199 are never used as international prefixes because USA already have used +1, and +451, +452 ... +459 are never used because Denmark have already used +45.
    Huffman encoding works in the same way. Instead of having a lookup table with dialing prefixes of different length and their corresponding countries, it has a lookup table of bit codes of different length and their corresponding prediction error. Each bit code can never be used again as the beginning of a longer bit code so the encoder will always know where one bit code ends and the next begins, even though they are of different length.
    This means that the well predicted pixels can be stored with just a few bits instead of storing them as a full 14 bit value. Just like USA can be dialed with +1 instead of using full 3 digit code of +001.
    But it also means that decoding will fail miserably if just one bit is switched. Switching one bit in a bit code will usually mean that the length of that bit code will be misinterpreted, and that means that the decoder will look for the start of the next bit code in the wrong place. So from that point in the bit sequence, we can expect everything to go wrong.
    (Sorry to be so long winded. But reading about Huffmann is like getting a new tool - I just have to use this knowledge for something.)

  • Can more than 1 ver of FF be installed at the same? If so, How?

    Can more than 1 ver of FF be installed at the same time? I currently have FF 3.x installed, and want to migrate to the newest FF, but before I do, I need to see which of my add-ons are no longer needed due to new intrinsic FF features, and if other add-ons are compatible. I simply need to have the features of certain add-ons, and if the new FF does not have the features I need, and the add-ons that give me those features are not compatible with the new version, then I simply can't upgrade. At some point I will write a detailed document stating features that I believe should be built into FF, but until then, perhaps a new Mozilla Migration Wizard program should be created. It would be able to scan a person's current installation, add-ons and all, and provide a report on which add-ons are compatible with the version the person wishes to upgrade to, and which are not, and check online to see if updates for the incompatible add-ons are available. The Mozilla Migration Wizard should also tell the user which add-ons are obsolete because their functions are built into the newer version of FF. But back to the question at hand: Can more than 1 ver of FF be installed at the same time? If so, is there a special procedure to follow? Will trying to install a second version corrupt my currently installed version? I hope a dual installation is possible because it will help me to transition to the newest FF as smoothly as possible, and it may also provide me with insight to suggest new features, procedures, functionality, utility type programs, and such.
    Thank you for your time.
    I hope to hear from you soon.
    Gunther

    See also:
    *http://www.mozilla.com/firefox/features.html
    *https://support.mozilla.com/kb/common-questions-after-updating-firefox

  • Can't delete defunct domain controller

    I'm the admin of a software test lab.  I had an Active Directory (Windows 2008 r2) domain set up mainly for DNS use on two Hyper-V VMs on separate hosts.  I have had issues in the past after power outages (I don't have the budget for a UPS for
    these hosts) where one or the other domain controller would become corrupt, and restoring from backup simply wouldn't work.  So, I got used to rebuilding whichever one failed.  I've had to do it about a dozen or so times, but when we had a power
    outage last Thursday, circumstances changed.  
    The first DNS server came back up just fine, but the second got corrupted, again.  (Pretty typical issue.  It would only boot to the recovery console.  Trying to use chkdsk /f would result in it telling me there were only 44 files on the C:
    drive and nothing to fix.)  I tried to restore it from backup, but, as usual, the host claimed it couldn't read the restore, so I deleted the VM and started over.  I created a new VM and got the OS installed and updated, but I can't delete the old
    DC account from the users and computer console or the config from the sites and services console.  Everything tells me "directory object not found."  I wound up renaming the VM and rejoining it that way, but I still can't get that old account
    deleted.  
    What's worse is that this VM that failed was the global catalog, and AD won't let me reassign the GC role to another DC.  It just doesn't do the role assignment, no error message or event log entry at all.  
    Anyone else run into this?  Is there a fix?

    Is this the link?
    http://msmvps.com/blogs/acefekay/archive/2010/10/05/complete-step-by-step-to-remove-an-orphaned-domain-controller.aspx
    When you try with the GUI (possible since Windows 2008), is there an error message?
    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.

  • Dreamweaver will not load after adding too big a site

    So i wanted to load my entire projects folder into one giant
    project, i thought this would help in keep track of items using
    common includes. well, dreamweaver crashed on building cache, and
    now i can't re-open it.
    i thought if i could remove the sites list that will allow
    dreamweaver to re-start. can anyone help me to do that?

    > *BUMP*
    you didn't give an OS or dw version.
    as a guess, on cs3 and windows xp it would be around here:
    C:\Documents and Settings\USERNAME\Application
    Data\Adobe\Dreamweaver
    9\Configuration\SiteCache
    delete the xxx.dws file with that site's name.
    note- when you restart dw- it will then try to rebuild the
    site cache.
    If there is a corrupt file IN this local site folder that's
    causing the
    folder- it will bung up again.
    so- suggestion: rename the local site folder on the hard
    drive before doing
    this. dw will give an error message that it can't find the
    site folder. but
    it will start up.
    second suggestion:
    corrupt site cache files can result from having the large
    original files
    like .psd and .png and .fla files in the site folder.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • Powercore 6000 problems, unstable and generally annoying

    Hello
    I just got a powercore 6000 and am trying to get it to work with Logic 8 on a macbookpro. Most of the x8 plugins work ok but as soon as i try and use the 6000 ones ( MD3 / Vss3 etc ) after a second it corrupts the audio and then won't play back properly. It makes a kind of distotored sound, similar to dropping the bit rate really low. Once it goes I have to restart logic and powercore.
    Soundcard i'm using is Focusrite Saphire Pro 8. It still happens when I go direct to laptop and miss out the Saphire/
    Buffer in logic is set to 1024 and I've tried pretty much everything I can think of, TC haven;t got back to me. And after reading around it seems they are pretty useless.
    I'm running 10.5.4 on a macbookpro. Powercore 3.2 software.
    Anyone else had problems and managed to fix it ?
    Cheers
    Dan

    just an update on this, incase anyone is having or has similar grief
    the update on OS X fixed the problem when only the PoCo is running. As soon as I try and chain up the soundcard it freaks out after a while.. same low bitrate sound issues...
    Express card comes on monday so i think that should sort the problem.
    cheers
    Dan
    ps.
    TC got back they said so will try that this too to see if i can run a couple of things through one port :
    "Try a reset in the POCO Control Panel.
    If you have any other firewire devices on the same firewire port, please disconnect and keep only the POCO connected for testing.
    Follow the description below and reinstall the software:
    Run the two PowerCore un-install scripts located in your Home folder. If you have a PowerCore Compact, FireWire, X8 or 6000 power it off.
    Restart your system.
    Go to ./Library/Audio/Plug-ins/Components and verify that all PowerCore plug-ins are un-installed. If they are not, delete them manually.
    Go to ./Library/Audio/Plug-ins/VST/PowerCore/ and verify that all PowerCore plug-ins are un-installed. If they are not, delete them manually.
    Go to Applications>Utility>Disk Utility
    Repair permissions
    Download and install PowerCore 3.2
    Restart your system. If you have a PowerCore Compact, FireWire, X8 or 6000 power it back on.
    Latest Software:
    http://www.tcelectronic.com/Default.asp?Id=12699 "

  • Broken/damaged song

    On the Album "Strike Up the Band: Marches from Around the World" track 9 is damaged - the first few seconds are corrupted. I have reported this to iTunes Store and they said they will look into it but just under two weeks have passed and when I downloaded it again it is still busted. How long does this take to reload a 'song'? I am sure Naxos will not be pleased...
    Peter

    On the Album "Strike Up the Band: Marches from Around
    the World" track 9 is damaged - the first few seconds
    are corrupted. I have reported this to iTunes Store
    and they said they will look into it but just under
    two weeks have passed and when I downloaded it again
    it is still busted. How long does this take to reload
    a 'song'? I am sure Naxos will not be pleased...
    Peter
    The store have now corrected the track but it took longer than I thought - a credit was issued. Just discovered that the previos track is also damaged.

  • Some pictures in I-Photo seem to be corrupted. When I click on them, the photo comes up for a second, then the picture turns black with a white fuzzy circle inside it and what looks like an explanation mark. Some older, some newer,  no common thread.

    Some pictures in I-Photo seem to be corrupted. When I click on them, they come up for a second, then turn black with a white circle in the middle and what looks like an explanation mark. There does not seem to be any rhyme or reason to the photos that are a problem, some older ones, some newer, some albums have none, some albums have a lot.
    Thanks,
    Mark

    time to time (when I have a chance), I will go to Finder, bring up ALL Images and start going through them to label them (before I put a label on them, they are simply listed as 123 jpg, 124 jpg etc.).
    You're damaging the Library doing that, and that's the cause of your problem.
    Never, ever, ever use the  All Images search and work on items in yoyr iPhoto Library. They must only be accessed via the iPhoto window.
    Restroe from abck up or try rebuild the Library:
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
    Next: You need to learn how to use iPhoto. There's no need to be dragging things to the desktop:
    For help accessing your photos in iPhoto see this user tip:
    https://discussions.apple.com/docs/DOC-4491

  • Numbers does not open with the main user after installing mountain lion. It works flawlessly when I use the second account on my mac. What got corrupted in the admin-account, something in the user-library? How can I fix it? I´m kinda desperate...

    Numbers does not open with the main user after installing mountain lion. It works flawlessly when I use the second account on my mac. What got corrupted in the admin-account, something in the user-library? How can I fix it? I´m kinda desperate... (the same happens with the other iWork-Apps!)
    Looking forward to hearing from somebody with a littlemore expertise than me, Chris

    you can remove preferences files by navigating to the Preferences folder for your user as follows:
    0) Quit ALL iWork apps (Keynote, Pages and Numbers)
    1) from the Finder select the menu item "Go > Go To Folder…".  This will bring up a dialog:
    2) enter the path "~/Library/Preferences" (no double quotes)
    3) find the files:
    com.apple.iWork.Keynote.plist
    com.apple.iWork.Numbers.plist
    com.apple.iWork.Pages.plist
    and move these to the trash.  I would NOT empty until later.
    4) restart Numbers

  • Second Printed Page of a Report Is Corrupted As Well the Report View When Focus Is Returned To It

    I am having a problem with a report in Access 2010. The report detail has a linked subreport in it. I build a query dynamically for both the report and subreport. There is a form that builds the queries and then displays the report in Report View. Everything
    is displayed correctly. In this view I have a command button that will print the report using “DoCmd.RunCommand acCmdPrint.”The printed report’s first page is correct. The second page has #error for all the fields for next record detail and that is it. At
    this point, there are still multiple records to print. When focus is returned to the Print View, it is corrupted and usually freezes.
    If after the Report View is displayed, I right click on the header and choose to display the Print Preview, all pages are displayed correctly. If I right click again, and select print, all pages are printed correctly, and the Report View is not corrupted.
    To see if I had corrupted the database, I imported everything into an empty database. After compiling the code, the behavior did not change at all.
    Once I place the database into production, everything will be driven by command buttons on the forms and reports so the left-click drop-down menus or any ribbons will not be available.
    Does anyone know what is happening?
    Thanks, in advance.

    Hi Ray,
    I failed to reproduce this issue in my test environment (Access 2013).
    Steps:
    #1 Create a table with the attachment field, add multiple records
    #2 Create a report with the table
    #3 Click Print Preview of the report, it worked correctly
    Can you also reproduce this issue in a newly created database, if no, I will suspect that issue is related to the specific database file (data issue or database is corrupted). You could use the link below to compact and repair the database.
    Compact and repair a database
    If the methods above do not work, it would be helpful if you could share us a simple demo to reproduce this issue. Due to privacy issues, I will also suggest you submitting a professional support incident to get the 1-1 support service so that Microsoft
    engineers can work closely with you to resolve this issue.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • HT201272 I downloaded an album but one of the songs is corrupted, it only plays for about 4 seconds. When I try to re-download using the iTunes Store and "Purchased", it won't give me the option to download it again. How can I get the song I PAID for!!??

    I downloaded an album but one of the songs is corrupted, it only plays for about 4 seconds. When I try to re-download using the iTunes Store and "Purchased", it won't give me the option to download it again. How can I get the song I PAID for!!??

    Depending upon what country that you are in (music can't be re-downloaded in all countries) then try deleting that track from your iTunes library and redownload it via the Purchased link under Quicklinks on the right-hand side of the iTunes store home page on your computer's iTunes.
    If you aren't in a country where you can re-download music or if it re-downloads in the same state then try the 'report a problem' page to contact iTunes Support : http://reportaproblem.apple.com
    If the 'report a problem' link doesn't work then you can try contacting iTunes Support via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • The song I downloaded is corrupted-help! It plays for 30 seconds then stops it's a 3:45 song!

    the song I downloaded is corrupted-help! It plays for 30 seconds then stops it's a 3:45 song!

    If your country's iTunes Store allows you to redownload purchased tracks, I'd delete your current copy of the track and try redownloading a fresh one. See the following document for instructions:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Otherwise, I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the item that is not playing properly. If you can't see "Report a Problem" next to the item, click the "Report a problem" button. Now click the "Report a Problem" link next to the item.

  • Every time I open iPhoto (as of today) after a few seconds the coloured wheel appears and the program become unresponsive. I have tried closing my computer. I assume I have a corrupt file but at the moment I cannot access anything in the program?

    Every time I try to open Iphoto '11 (as of today) the coloured wheel appears after a few seconds and the program becomes unresponsive. I assume I have a corrupt file but I cant do anything including accessing help. I have tried closing down and restarting but it dosnt help. Any ideas please?

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

Maybe you are looking for