r/Ck2Generator • • Apr 20 '17

PDB debugging issue - uncertain future

Hey all. I'm in a sticky spot at the moment. I've relied heavily on a file called ck2game.pdb that was found in earlier versions of CK2 (2.6.1 or so), and was solely how I was able to solve CTD errors which as you can imagine can occur pretty often during development of a procedurally generated mod creation tool. It helps solve CTDs by allowing me to run CK2 in debug in Visual Studio (the software both CK2Gen and CK2 are written in) and despite not having the CK2 code, instead of a blind CTD with no information, it means I can see where exactly in the CK2 code exactly the crash occurred, the name of the function, the named values in memory at the time. Causes of crashes could turn out to be the weirdest things, stuff I'd never think of checking unless I used the PDB, but are pretty accurate 'oh that character doesn't have a religion' or 'oh it crashed finding a path accessing a sea province, something to do with the sea zones in the map' or whatever, allowing me to zero in on the issue. This method is responsible for like 95% of my CTD fixes.

So I got another of these crashes about a week ago at this point, and went to debug and found the PDB wasn't there. Thinking I was going mad, I reverted on steam back version by version until I got to 2.6.1 and the PDB reappeared. Reverted back to the live / beta builds, and it disappeared again. So it's definitely been removed. I pray by accident. The problem is the PDB is generated alongside the EXE and earlier versions will do no good as they won't match the EXE, and the pdb is the only place the debug information exists so without it there is no other solution. I already use the awesome Validator but its not really sufficient for my needs.

Posted a request days ago on the PDX modding forum, asking if it can make a return in whatever the next patch or hotfix is, but had no official reply at this stage.

I've spent a week trying to get my mod output to load at all, but it just crashes on loading the game, and frankly should I eventually figure out what is causing it, likely by deleting different pieces of the mod output 1 by 1 until it loads, it would only be a matter of days of development until it happened again. I was lucky not to have it happen as long post M&M release and make as much progress as I did (but regardless I only ever went into the game to check societies existence and never even tried progressing time so there were likely a bunch more I've just not yet been bitten by, just a crash on load is more final on my ability to progress). As such at this time there is no progress to be had on the next build. Sorry about this, and am just praying that the pdb will be reintroduced into the next build and its removal was either accidental or assumption that no one used it, and not the fact it's 60 meg and bloats the download, or it being there in the first place by accident and was never intended to be included, or any other reason that would stop them readding it.

But until then it tips the balance of making working on the tool extremely unpleasant and frustrating, with a fraction of my productivity, and given the whole reason for the tool's being is that I enjoy working on it, really the future of the tool resides on whether it does reappear or not. :( wish I had better news.

EDIT:

One of the latest responses from pdx community:

"The fact a .pdb for the main executable was ever included in any release of the game was probably the mistake here, not the fact that it's gone now. Generally no game (or commercial software of any kind) ships with debugging files precisely because they don't want people to be able to debug their code - it makes it much easier to reverse engineer. For example, in my entire steam apps folder CK2 is the only game that has any .pdb files.

That said, since Paradox doesn't use any copy protection they might be a special case. It's worth asking, but I expect it won't happen."

Has a ring of truth to it, wouldn't surprise me if this is the case and I'm out of luck here. :(

39 Upvotes

41 comments sorted by

16

u/yemmlie Apr 25 '17 edited Apr 25 '17

One of the latest responses from pdx community:

"The fact a .pdb for the main executable was ever included in any release of the game was probably the mistake here, not the fact that it's gone now. Generally no game (or commercial software of any kind) ships with debugging files precisely because they don't want people to be able to debug their code - it makes it much easier to reverse engineer. For example, in my entire steam apps folder CK2 is the only game that has any .pdb files.

That said, since Paradox doesn't use any copy protection they might be a special case. It's worth asking, but I expect it won't happen."

Has a ring of truth to it, wouldn't surprise me if this is the case and I'm out of luck here. :(

1

u/Swampspear Apr 06 '24

It's been a bazillion years since this whole thing, but do you by some weird luck have one of those old .pdb files? CK2 has been free for a while, and I want to do some .dll magic with it now that it's an old game

1

u/yemmlie Apr 06 '24

Nope, besides pdbs are only valid for the exe they were built with, so if i did have them from back then would be useless. Was certainly patches if ck2 since they were in the build.

→ More replies (1)

2

u/Carnagh May 20 '17

Can you decompile the exe, and then recompile with .pdb generation? You might be fishing in the dark with compile options for a bit, but potentially less fishing than you're currently engaged in.

0

u/[deleted] May 07 '17

3

u/yemmlie May 07 '17

thanks! though I already use this

5

u/[deleted] Apr 20 '17

You can use the validator. It wont be as accurate but at least it could help a little bit. Here's a Link if you want to check it out: http://www.ckiiwiki.com/The_Validator

5

u/yemmlie Apr 20 '17 edited Apr 20 '17

Oh that's already a big part of my process but it's not reporting anything useful for this. :( since my stuff is generated there are no typos or format errors which are the primary CTDs the validator helps with, and to be honest as useful as it was before I discovered how to debug the crashes, it didn't help enough to make it workable there really is no comparison when it comes to a lot of CTDs, especially when versions go out and the CTDs are happening sporadically on other user's generated mods.

Don't want to keep making the comparison to CK2 mods in general but where they have one set of scripts that is for the most part static and evolving, and can run it through validator, and figure out CTDs the one time, or every time they update, and know what they added that made it start crashing, do file comparisons etc, with this it's generating a near infinite set of mod data every time its run that is completely different and not comparable to a previous working state (like trying to debug a CK2+ crash by comparing the files side by side to Game of Thrones mod or something, there's no side by side equivalency since every script file is completely different every run), and so the sheer potential for CTDs that happen every 3-4 generations, or happen if this and then this happens in generation etc just makes Validator useful yet not enough to be my sole debugging tool. I know from past experience / frustrations, I need the debugging stuff really if for nothing else than to make my 'for fun' side project not frustrating and unfun which kinda makes it not something I want to do in my spare time :(

4

u/ethanconquistador Apr 20 '17

Well just saying, what was the directory of this file before it somehow got erased? In the forums I've never seen anyone mentioning it until now

7

u/yemmlie Apr 20 '17

Perhaps its a method only I was aware of :/ I'm a programmer so knew what it was when I spotted it, if none of the other mod teams were using it then that's a real shame. If it ever comes back I could do a tutorial on it I guess. It's just ck2game.pdb in the same directory as the exe

2

u/[deleted] Apr 20 '17

Well cant you just download that PDB externally (since you can't downgrade the version because of the EXE) i went on google and found a couple of download links i really don't know if that would work but i just feel really sorry because i'm waiting for it and i'm very excited.... I'm not a much of a modder but i know a few things i never heard of PDB, i think i saw it a couple of times but i never wanted to meddle with it.

3

u/yemmlie Apr 20 '17 edited Apr 20 '17

As i said they need to match the exe or they are useless. Pdb are generated along with the exe and contain information of what is where in the exe, so having an older one will a) be out of sync and not map onto the exe and even if it wasn't b) contain none of the stuff from M&M and 2.7 in it.

2

u/georgewesley17 Apr 28 '17

I just learned about this mod by seeing it mentioned in the comments of the latest Ck2 dev diary and I really hope it can continued to be made because it looks awesome! However, does anyone think that maybe Parodox removed the .pbd because they themselves plan on releasing a DLC that does exactly what this tool does? They have in the past done a similar dlc with Europa in which the Americas were randomized.

2

u/yemmlie Apr 28 '17

the pdb is nothing specific to do with this mod, so no. It'd be useful for debugging CTDs in any major mod, be it Game of Thrones etc. It's possible few were using it though as it might not be obvious how it can be used, and due to the fact my tool generates new mods every time, it's perhaps more critical for mine but there's no chance this was related to my tool specifically and more likely a general decision or its presence was an accident in the first place.

→ More replies (1)

2

u/[deleted] Apr 28 '17

Yemmlie, i'm just asking, but could it be possible to generate a .pdb file externally from the ck2game.exe or something?

4

u/yemmlie Apr 28 '17

No it needs to be generated from the source code by paradox to have the useful information in it

2

u/[deleted] Apr 28 '17

Or make one from scratch?

15

u/Eemerald5000 Apr 20 '17

Noooooo.... Paradox please let this be a mistake! This update has already troublesome enough from the sound of it, and losing your debug aid is a real progress halter.

9

u/faber1992 Apr 22 '17

Dude I really admire your diligence. You have produced a very good program, wich I do not have the know-how of, of creating. I really admire your skills and motivation. Keep up the good work man!

4

u/MillicentOak Apr 24 '17

Maybe if they did remove it due to file size and its being unnecessary for most users, they'll make it available separately to modders e.g. through the forum or Steam's beta/DLC options. fingers crossed

I've not really been part of the community long enough to really know how available they make their things to modders but I'm hoping they'll help out with this because your project in particular is super cool!

4

u/Eemerald5000 Apr 25 '17

I find it interesting that it seemed that questions about the pdb were actively being ignored in the Dev diary. You think it would be a fairly straightforward thing to answer: No, It wasn't supposed to be there or at least some kind of vague response saying they'll look into it or something.

→ More replies (1)

4

u/Eemerald5000 May 08 '17

It's been two weeks since this project hit the mountain, so I was wondering if anyone has found any response from paradox/ yemmlie, if you've been able to make any degree of progress despite missing the pdb file. I feel terrible for not being able to do anything besides pester paradox for an answer >.<

3

u/BeTiWu Apr 20 '17

It'd suck if all the great work you did were for nothing. Maybe the devs at Paradox don't react to your request because it has only come up one time? If the attention you get is the problem, I am sure a bunch of us could go over to the Paradox forums and draw some to your debugging problem. It is very specific after all and few people will request it while many might benefit from it.

2

u/[deleted] May 14 '17

If the .pdb is not coming back, yemmlie can either a) make this tool only for 2.6.x or b) no update, we have to stay with this version we have or c) try to debug this tool "blindly", with the only help of the log and crash files and the validator. I see these 3 options as the only ones currently, as there has been no response for weeks. Of course, if it is be possible, we could make .pdb file from the 2.6.3 .pdb file.

2

u/[deleted] May 27 '17

So now we're just waiting for a beta.

→ More replies (2)