DynamoRIO / drmemory

Memory Debugger for Windows, Linux, Mac, and Android
Other
2.38k stars 257 forks source link

Compatibility with /JMC switch #2231

Open pgroke-dt opened 4 years ago

pgroke-dt commented 4 years ago

Is it possible that Dr.Memory is not compatible with Visual C++'s /JMC switch? I'm getting a lot of UNADDRESSABLE ACCESS issues in __CheckForDebuggerJustMyCode. If that's a limitation I think it should be documented on https://drmemory.org/docs/page_prep.html

Carrotman42 commented 4 years ago

DynamoRIO supports compiling on Windows with Visual Studio 2013 ( https://github.com/DynamoRIO/dynamorio/wiki/How-To-Build#windows) and the JMC switch appears to be from Visual Studio 2017 ( https://docs.microsoft.com/en-us/cpp/build/reference/jmc?view=vs-2019).

Perhaps I'm missing something, but if what I said about the versions is correct: I do not personally think it makes sense to explicitly list all functionality from compilers we don't support (yet), given that's probably a long and boring list.

If you are sure that DrM should be handling this case and it is not, please provide more information about what the problem you are encountering is. We have some debugging tips if you're unfamiliar with this: https://github.com/DynamoRIO/dynamorio/wiki/Debugging

On Tue, Oct 15, 2019, 3:25 AM Paul Groke notifications@github.com wrote:

Is it possible that Dr.Memory is not compatible with Visual C++'s /JMC switch? I'm getting a lot of UNADDRESSABLE ACCESS issues in __CheckForDebuggerJustMyCode. If that's a limitation I think it should be documented on https://drmemory.org/docs/page_prep.html

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DynamoRIO/drmemory/issues/2231?email_source=notifications&email_token=AAELF3Y37GVOJJLULHYYV3DQOWEBLA5CNFSM4JAZXXKKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HR2AZ3Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAELF37QHEWIB53NSF3UHDDQOWEBLANCNFSM4JAZXXKA .

pgroke-dt commented 4 years ago

Hello Carrotman42,

I did read the "How-To-Build" page but it wasn't clear to me that only VS 2013 U3 will work. Yes it says other versions are not officially supported but I assumed that Dr.Memory should still work. Many products only officially support certain compiler/... versions but work reliably with a much larger range of versions. Also it's not uncommon for product documentation to not be updated with every release.

And if there are switches of later compiler versions that are known to cause problems, then I do think it would make sense to list them. Unless of course it's not possible to reasonably use Dr.Memory with newer compiler versions at all. In that case I agree that it wouldn't make much sense. In that case I think the page should explicitly state that it's known to be practically impossible to use Dr.Memory in any meaningful way with newer versions. That's a big difference to "not officially supported".

TBH I'm quite shocked that Dr.Memory only supports VS 2013. We've been using it for quite some time with VS 2015. We changed our build to VS 2017 a while ago and are about to switch to 2019, and we simply cannot go back. Do you know if support for VS 2017/2019 is planned/will be available any time soon?

Sorry, my mistake. I did not read the "How-To-Build" page (unless now). That's because I'm not trying to build Dr.Memory. I'm trying to use it. I'm talking about the "Preparing Your Application" page here: https://drmemory.org/docs/page_prep.html

So is it possible to debug applications that have been built with VS 2017 with DrM?

derekbruening commented 4 years ago

Apps built with VS2017 should run under DrM, yes. I suspect that nobody has tried JMC before. We are a very small team and it is not easy to test every new VS feature. Still, it is surprising that this would raise errors: it must be doing something unusual. What is it accessing that seems invalid? Pasting a full error report with full callstack and culprit instruction disassembly (in the note) might help.

If you would like to help investigate the aid would be appreciated. You could also suppress all callstacks with the JMC function in them as a workaround.

pgroke-dt commented 4 years ago

@derekbruening I'm not 100% sure if /JMC is the problem. I'm currently restricted to what our CI system gives me, which is not a lot.

I tried to run DrM locally so I could play around with compiler settings to see if any setting was causing DrM to generate spurious results. But I could not because of "fail to init Umbra". See my comment here https://github.com/DynamoRIO/drmemory/issues/2184

If there's no other way I'll set up a Windows 8.1 VM to run the DrM tests. But that's a lot of work and I don't have the time right now, so this could take a few days.

Re. posting more detailed information + stack traces I'd have to clear that first.

Carrotman42 commented 4 years ago

Sorry I was confused earlier, I definitely thought you were trying to compile Dr Memory with VS Code 2017. As Derek mentioned, we do indeed hope to support all generic windows applications with our pre-compiled distribution.

Any more information about the failures that you could share would definitely be appreciated to help track down the problem.

On Tue, Oct 15, 2019 at 11:25 AM Paul Groke notifications@github.com wrote:

@derekbruening https://github.com/derekbruening I'm not 100% sure if /JMC is the problem. I'm currently restricted to what our CI system gives me, which is not a lot.

I tried to run DrM locally so I could play around with compiler settings to see if any setting was causing DrM to generate spurious results. But I could not because of "fail to init Umbra". See my comment here #2184 https://github.com/DynamoRIO/drmemory/issues/2184

If there's no other way I'll set up a Windows 8.1 VM to run the DrM tests. But that's a lot of work and I don't have the time right now, so this could take a few days.

Re. posting more detailed information + stack traces I'd have to clear that first.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DynamoRIO/drmemory/issues/2231?email_source=notifications&email_token=AAELF32ZZ427J3E2V56QNYTQOX4KBA5CNFSM4JAZXXKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBJSK6Y#issuecomment-542319995, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAELF3ZFJKGWDRTEEXYMRDTQOX4KBANCNFSM4JAZXXKA .

pgroke-dt commented 4 years ago

I'll try to make some time for investigating this some more.

Until then, it would really be helpful to be able to run DrM locally on Windows 10 1903 again... Did you have a look at the ticket I linked (#2184 ) ? I'm not sure what's the current status there. Has the bug that causes this already been found or is the problem that you can't pin it down or even reproduce it?

derekbruening commented 4 years ago

I replied on #2184: have not been able to reproduce, but if it's purely address layout we should be able to resolve it once we have the layout information.