-
Notifications
You must be signed in to change notification settings - Fork 10
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
Bring back stack tracing #7
Comments
As of OpenFOAM 2.2.0, they have got the |
Research done so far
|
Determined possible reasons why it's not working properly on 64bitIt looks like there is a very big flaw in Windows XP to 7 64-bit in handling CPUs with AVX, along with there being a frame hiding maneuver that seems to only be possible on x86_64, which makes the call stack walking a major problem. For more information on this topic, see these two blog posts:
This is a very good reference of several details on call stack and debuggers: |
About MSys2It's possible that MSys2's software stack can help sort out this issue, given that it has utilities that OpenFOAM uses on Linux for stack tracing as well, namely the |
It seems that perhaps we could use this library instead: http://boostorg.github.io/stacktrace/stacktrace/configuration_and_build.html It looks like we can follow these installation instructions: boostorg/stacktrace#14 (comment) |
Commands used to try out the
Then for testing:
But it's not working :( There is no stack trace. However, at least the |
On MSys2 i686, it worked well, at least with an old installation of MSys2 that provided GCC 6.3.0. Am updating it to the more recent MSys2 stack, to see what might need fixing.
At least on i686, it was possible so far to assess that using
Results in:
Which we can then do:
Which gave:
|
After considerable reading into pull requests and reports on https://github.com/rust-lang/rust, the assessment so far is that perhaps the issue on x64 is related to problems on either the executable path is retrieved and provided to the |
Playing around with the mixing of |
Using the example https://github.com/ErwanLegrand/libbacktrace/blob/master/examples/bt.c - it was possible to diagnose that the problem is on the x64 builds, because it works just fine on i686. Clearly the unwrapper is broken, because it gives 7 entries on each category on x64, versus 3 on i686:
|
Another more detailed test is the one done by
Then running it will give the following output:
|
In an attempt to try and build Rust's
The solution was to hack the file
On a side-note: using
|
The somewhat good news is that it is possible to generate stack traces in 64-bit builds, as proven by this blog post: http://theorangeduck.com/page/printing-stack-trace-mingw I've tested with success by using the MSys2 stack being used for blueCFD-Core 2017-1, however:
Furthermore, the other downside is that it doesn't state the line of the crash, although it at least gives the names of the functions which were called. Furthermore, the following mailing list thread on mingw-w64 has a few more details which may be useful: https://sourceforge.net/p/mingw-w64/mailman/message/26662488/ The downside to using On the other hand, |
Have tried bringing back the
And this was done using a minimal application code, while using OpenFOAM's However, I did not account for the changes made in Chromium:
Have tried the code modifications in the Chomium code and it has gotten fairly worse:
Will try to adapt only specific details from it... |
Further R&D on adapting our old
|
Using the following code with our latest
We got the following stack trace:
Which means that using However, this context option may be useful in some stack tracing scenarios, such as the However, this strategy requires us to:
For example, not using
However, in this scenario, it is possible to retrieve the line via
However, it only works if the DWARF data is not stripped out. |
Will go forward with this solution for blueCFD-Core 2017. The development steps to wrap this up are as follows:
For point 10, here is the example output:
With PDB files for all of the relevant modules:
Which isn't exactly entirely accurate, but given that there is a lot of template and macro management being used in the code, it's natural that it's not entirely accurate... it seems that we could use the ability to see both the mangled and unmangled names. However, after considerable testing, it was concluded that we cannot easily get the mangled/decorated names once we have the PDB files. But this was not a problem, once a full rebuild was done, apparently due to stale object files having been used for the previous output. A clean output for a clean build was this:
|
Important note for the futureThe build option However, while we are using Although it is not clear if the option Have added this note to #71. |
This issue is now solved up to the following commits:
|
There is a somewhat critical issue with how This means that the Therefore, what we should do is run |
Fixed in commit 01be2c05866b9b07ae2b04d74274ec2561c752eb, even though this still means that This specific problem with |
The bug in
Therefore it's expected that DLL files larger than 1GB will give us a problem with using the 32-bit version of Have revised the error/warning message that we shown in |
… blueCFD-Core 2.1 and further fixed the problems we were having with it. See Issue blueCFD/Core#7 for more details about this implementation.
…hough it's now no longer expected to fail.
…hough it's now no longer expected to fail.
… blueCFD-Core 2.1 and further fixed the problems we were having with it. See Issue blueCFD/Core#7 for more details about this implementation.
Back in 2011, we were able to add a simple stack trace mechanism, by using a library that had several stack tracing excerpts from online projects. For example, seen here: https://github.com/blueCFD/ThirdParty-2.1.x/tree/blueCFD-2.1-2/stack_trace
Unfortunately, it after the release of blueCFD(-Core) 2.1-1, subsequent releases had the stack tracer broken for 64-bit releases. It was really weird, but apparently something either changed on our building infrastructure or something was patched on Windows.
The objectives for this task originally seemed to be the following:
Nonetheless, the comments below offer more details.
The text was updated successfully, but these errors were encountered: