New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with pdb files after updating #312
Comments
|
Other libs are just fine, so checking out what's different about this one. |
what weavers? |
But I believe the other projects used these as well. |
can u incrementally remove the weavers and see if we can isolate? |
Once this happens, an msbuild instance keeps a lock on the pdb file and needs to be killed in order to release it. |
on it |
It's Catel causing this one. Weird, it works fine on other ones. But it looks like I have some fixing to do ;-) |
let me have a look at catel |
No, I found it. Whenever I disasble the WeaveProperties feature, the issue goes away. Probably a wrong import. |
Found the causing VM, checking what's broken on this one. |
ok. let me know if u need help |
Found it, it's caused when a combination of this is used:
|
Definitely something in the Catel weaver, Fody is all good! |
but how does that lock files? |
Probably because mono.cecil fails to generate the pdb or assembly. |
ping @jbevain thoughts? |
Building cecil locally so I have access to all PDB files. |
@GeertvanHorrik do you have a small C# file that reproduces the Cecil exception? |
Trying to repro. It seems to happen only to a single property (same stuff on the same class works fine). Trying to break it down to a single repro for you (or fix it if it's something on my side). |
It goes wrong in WriteResolvedMethodBody. Checking out why it fails so hard. In the past, it would just result in invalid IL, but now it doesn't even output an assembly / pdb (both 0 bytes). |
@jbevain how can I easily export List so you can take a look at it? |
@SimonCropp one thing I can think of: the weaver modifies the IL to the extent that the info in the debug scope goes bonkers. @GeertvanHorrik I don't understand the question :) |
I have triple checked all generated IL, it looks good and works fine in other tests. The only thing that could be broken are the operands, but again, I would expect it to generate invalid IL, not crash. Unfortunately I cannot easily disable pdb's because Fody doesn't seem to like that. Will create a custom build without it for now. |
@jbevain I mean: is there a simple "to string" for the list so you can see that it's valid IL. Even if the IL scope goes totally broken, can't it be rebuild from scratch or is that my ignorance speaking here? |
Without symbols:
I verified the IL & C# code automatically (PEVerify) and manually by hand, that looks good. This gives me the idea that this is a symbols issue in Mono.Cecil. What info do you need? A repro is very hard since I tried to reproduce this in the unit tests for Catel.Fody and there it worked just fine. I've tried to analyze several things, such as:
The weird thing is that it only happens to a single property. Whenever I disable this property conversion, it all works fine. |
@GeertvanHorrik we have a few primitives in our test suite you could reuse to dump a method as a string representation, but nothing built-in. If something is modifying the collection of instructions, it's also responsible for making sure the model in the DebugInformation of the method makes sense. I don't know if this issue is related to that, it might be that the scope gets completely out of sync the modified IL and the pdb writer doesn't know what to make of it. Or it could be a simple bug in the pdb writer. I'm afraid I need a way to reproduce the issue to fix it :) |
@GeertvanHorrik perhaps remove fody from the picture and replicate your il manipulation code in a console app? |
I wasn't aware that I was responsible for updating the debug info as well. Does that mean that whenever I add / remove a field / property / method, I need to update the debug info? |
Only methods have debug information. You can add all you want (new stuff just won't have debug information). If you modify an existing method body, you need to make sure its .DebugInformation still makes sense (including scopes and sequence points). |
Thanks for the info. I will take a look at how I can fix this. Maybe I can write an extension method for this that might benefit others as well. |
Looks like we are having a bit of success:
This is the extension method I use after modifying a method:
I will investigate whether I can strip it down. |
It looks like this is sufficient:
|
Using the extended method is recommended since it does check (and update) all the still relevant sequence points and will remove the ones no longer valid. Thanks for all the help @SimonCropp & @jbevain , let's close this one. |
Glad to hear this is fixed! |
The text was updated successfully, but these errors were encountered: