Hi Felix,

On 21/04/11, Felix Franz <fr...@ergosign.de> wrote:

I have a strange bug in my CoreData-Application (sql store). I
received bug reports where the program throws an exception "Could not
fulfill a fault". This happens while loading the document.

I've been seeing that issue for a few years, but in a non-document-based app.

The only way I can reproduce this problem is using the "Time Profiler"
in Instruments while loading a big document.

That's useful - I've never been able to reproduce it.

It throws the aforementioned exception while accessing a relationship
or property (the objects differ for each load).

Yes, the objects are random.

Strangely if I open the same document and retrieve the object
mentioned in the exception: the object is there all
properties/relationships are ok, no problem at all.

That's right, the database is fine.

SQLite error code:11, 'database disk image is malformed'

I see it with and without the "... malformed" message.

$ sqlite3 /Users/felix/Desktop/foo.atype "pragma integrity_check"
ok

I confirm and, fortunately, saving still works after the issue has occurred.

Is it possible to check the file in other ways?

I don't think so. However, I've noticed that SQLiteManager seems to do a multi-step check - not sure what its doing.

That aside, maybe its a timeout type bug - sqlite can sometimes be slower than its usually lightning-fast self, with no apparent reason.

Maybe a Memory management bug (I don't use GC)?

I saw the issue without GC and I still see it with GC.

If someone has a pointer or experienced a similar error: speak up :)

I try to catch the exception at as low a point as possible and handle it gracefully (it often occurs when I'm doing arithmetic involving several relationships e.g. a Sale balance). But because of the difficulty catching exceptions in other threads (discussed recently on this list) that's not always possible.

When I can catch it, I put up an alert, after the second incident, which offers to relaunch the app, since it usually continues to occur after the first incident. I'm experimenting with just resetting the MOC instead.

I've made slow progress with the issue because, until your time profiler trick, it was hard to reproduce.

Note that my application shares the database (on an NAS) with other Macs. I originally thought the issue occurred because of that unsupported architecture and so kept mum about it. However, I haven't seen any indication that that's the case and, like you, I've seen it once or twice in a more benign environment.

If you can reproduce it reliably, its worth raising a bug report. Better you than me since you are using a supported architecture. Feel free to contact me if you would like a hand with the bug report. For example, I have years of saved exception traces.

Cheers,

Steve


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to