libclang crashes when using TU with PCH

I'm generating a TU using a PCH file and libclang asserts and causes access
violation when I get cursor instantiation locations from that TU, if files
from which the PCH file was generated no longer exist or have been modified.

If I pass the unsaved buffer of file "header.h", which has been used with
the saved state to compile the PCH file, I also get wrong cursor location
information if I use these to generate a TU.

Does somebody know why is the PCH file so tied to the files on disk? Is
there a workaround for this issue?

Thank you!

I'm generating a TU using a PCH file and libclang asserts and causes access
violation when I get cursor instantiation locations from that TU, if files
from which the PCH file was generated no longer exist or have been modified.

Are these files modified after the TU is created ? If the PCH file is stale I'd expect it would fail to give you a TU in the first place.

If I pass the unsaved buffer of file "header.h", which has been used with
the saved state to compile the PCH file, I also get wrong cursor location
information if I use these to generate a TU.

Does somebody know why is the PCH file so tied to the files on disk? Is
there a workaround for this issue?

PCHs are not independent, the parser may refer back to the file on disk for diagnostic rendering, parsing of numeric literals in macro definitions, etc.
We try to recover when a header file was modified, however; it would be helpful if you could provide some minimal test case that reproduces your problem and file a bugzilla report about it.

The files are modified (or do no longer exist), after the PCH is created, but
before the TU is generated.
The TU is generated successfully, but libclang performs checks on the
directory when I'm trying to retrieve location information from the TU,
using clang_getInstantiationLocation or clang_getCursorExtent.
I'm using clang 2.9.

Thank you!

The files are modified (or do no longer exist), after the PCH is created, but
before the TU is generated.
The TU is generated successfully, but libclang performs checks on the
directory when I'm trying to retrieve location information from the TU,
using clang_getInstantiationLocation or clang_getCursorExtent.
I'm using clang 2.9.

This is rather old, I'd suggest you move to libclang from trunk.
If you are still seeing issues, please post code with a reduced test case.

Thank you for your replies.