Winamp may be using up too much of the available RAM on your system during the scan. Then crashing and corrupting the database files. Delete the Gracenote database files and rescan, but monitor your total system RAM usage. If the total RAM usage goes over 70%, stop the scan and close Winamp. Then restart Winamp and restart the scan. It will pick up where it was stopped. Continue to monitor RAM usage, if it again exceeds 70% then repeat the stop and restart process. Due to the excessive memory usage (bug? or design?), scanning in stages seems to be the only way to complete the initial scan of a very large collection.
Yes, it takes a long time to complete the initial Gracenote scan of a large collection and it's a pain to have to 'babysit' the process. Another alternative is to move all but about 10,000 files from your monitored folders and run the scan. Then move about 10,000 files back to the monitored folders and rescan. Repeat adding and rescanning until the whole collection is scanned. Again the intent is to kept Winamp from using too much RAM during the scan of each group of files. This approach will take even longer, but you don't have to sit and watch it. If your files contain embedded album art, it may be better to use smaller groups (6 - 7 thousand).
(Off Topic - This excessive RAM usage can also occur when rebuilding the Winamp media library database for a very large collection.)
You may be better off with a 3rd party alternative for generating playlists, such as MusicIP Mixer. It's no longer supported, but it still works. Read thread linked below.