From Fedora Project Wiki
(Formatting fixes)
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 12: Line 12:
<!-- Include you email address that you can be reached should people want to contact you about helping with your change, status is requested, or technical issues need to be resolved. If the change proposal is owned by a SIG, please also add a primary contact person. -->
<!-- Include you email address that you can be reached should people want to contact you about helping with your change, status is requested, or technical issues need to be resolved. If the change proposal is owned by a SIG, please also add a primary contact person. -->
* Email: <manisandro@gmail.com>
* Email: <manisandro@gmail.com>
* Release notes owner: <!--- To be assigned by docs team [[User:FASAccountName| Release notes owner name]] <email address> -->
* Release notes ticket: [https://pagure.io/fedora-docs/release-notes/issue/119 #119]
<!--- UNCOMMENT only for Changes with assigned Shepherd (by FESCo)
<!--- UNCOMMENT only for Changes with assigned Shepherd (by FESCo)
* FESCo shepherd: [[User:FASAccountName| Shehperd name]] <email address>
* FESCo shepherd: [[User:FASAccountName| Shehperd name]] <email address>
Line 32: Line 32:
CLOSED as NEXTRELEASE -> change is completed and verified and will be delivered in next release under development
CLOSED as NEXTRELEASE -> change is completed and verified and will be delivered in next release under development
-->
-->
* Tracker bug: <will be assigned by the Wrangler>
* Tracker bug: [https://bugzilla.redhat.com/show_bug.cgi?id=1492824 #1492824]


== Detailed Description ==
== Detailed Description ==
Line 58: Line 58:
</pre>
</pre>


A test with some packages in [https://copr.fedorainfracloud.org/coprs/smani/mingw-debuginfo-test/builds/ this COPR repo] shows that the price is a size increase of in average 17%:
A test with some packages in [https://copr.fedorainfracloud.org/coprs/smani/mingw-debuginfo-test/builds/ this COPR repo] shows that the price is a size increase of on average 17%:


{|
{|
Line 114: Line 114:
<!-- What work do other developers have to accomplish to complete the feature in time for release?  Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->
<!-- What work do other developers have to accomplish to complete the feature in time for release?  Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->


* Release engineering: [https://pagure.io/releng/issues #Releng issue number] (a check of an impact with Release Engineering is needed) <!-- REQUIRED FOR SYSTEM WIDE AS WELL AS FOR SELF CONTAINED CHANGES -->
* Release engineering: [https://pagure.io/releng/issue/7005 #7005] (a check of an impact with Release Engineering is needed) <!-- REQUIRED FOR SYSTEM WIDE AS WELL AS FOR SELF CONTAINED CHANGES -->
<!-- Does this feature require coordination with release engineering (e.g. changes to installer image generation or update package delivery)?  Is a mass rebuild required?  include a link to the releng issue.  
<!-- Does this feature require coordination with release engineering (e.g. changes to installer image generation or update package delivery)?  Is a mass rebuild required?  include a link to the releng issue.  
The issue is required to be filed prior to feature submission, to ensure that someone is on board to do any process development work and testing, and that all changes make it into the pipeline; a bullet point in a change is not sufficient communication -->
The issue is required to be filed prior to feature submission, to ensure that someone is on board to do any process development work and testing, and that all changes make it into the pipeline; a bullet point in a change is not sufficient communication -->
Line 202: Line 202:
MinGW binaries contain symbol names by default for easier debugging.
MinGW binaries contain symbol names by default for easier debugging.


[[Category:ChangePageIncomplete]]
[[Category:ChangeAcceptedF28]]
<!-- When your change proposal page is completed and ready for review and announcement -->
<!-- When your change proposal page is completed and ready for review and announcement -->
<!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler -->
<!-- remove Category:ChangePageIncomplete and change it to Category:ChangeReadyForWrangler -->

Latest revision as of 15:12, 2 March 2018

MinGW MiniDebugInfo

Summary

Analogously to the MiniDebugInfo change for native packages, install minimal debuginfos by default also for MinGW packages.

Owner

Current status

Detailed Description

Currently the debuginfo data of MinGW binaries is completely stripped from the binary and placed in the respective .debuginfo file. This change proposes keeping the PE symbols in the binary, similarly to what was done for native binaries.

The change basically involves changing mingw-find-debuginfo.sh as follows:

diff --git a/mingw-filesystem/mingw-find-debuginfo.sh b/mingw-filesystem/mingw-find-debuginfo.sh
index de6dee1..261385f 100755
--- a/mingw-filesystem/mingw-find-debuginfo.sh
+++ b/mingw-filesystem/mingw-find-debuginfo.sh
@@ -25,7 +25,10 @@ do
        echo extracting debug info from $f
        mingw-objcopy --only-keep-debug $f $f.debug || :
        pushd `dirname $f`
-       mingw-objcopy --add-gnu-debuglink=`basename $f.debug` --strip-unneeded `basename $f` || :
+       keep_symbols=`mktemp`
+  mingw-nm $f.debug --format=sysv --defined-only | awk -F \| '{ if ($4 ~ "Function") print $1 }' | sort > "$keep_symbols"
+       mingw-objcopy --add-gnu-debuglink=`basename $f.debug` --strip-unneeded `basename $f` --keep-symbols="$keep_symbols" || :
+       rm -f "$keep_symbols"
        popd
 done

A test with some packages in this COPR repo shows that the price is a size increase of on average 17%:

Binary Stripped size Size with symbols Relative size change
libgio-2.0-0.dll 1412 1656 117.28%
libglib-2.0-0.dll 1092 1184 108.42%
libgmodule-2.0-0.dll 28 32 114.29%
libgobject-2.0-0.dll 312 352 112.82%
libgiomm-2.4-1.dll 1284 1732 134.89%
libglibmm-2.4-1.dll 432 588 136.11%
Qt5Concurrent.dll 36 44 122.22%
Qt5Core.dll 4884 5508 112.78%
Qt5DBus.dll 548 652 118.99%
Qt5Gui.dll 4408 5208 118.15%
Qt5Network.dll 1568 1892 120.66%
Qt5OpenGL.dll 328 404 123.17%
Qt5PrintSupport.dll 376 448 119.15%
Qt5Sql.dll 268 312 116.42%
Qt5Test.dll 252 284 112.70%
Qt5Widgets.dll 5716 6768 118.40%
Qt5Xml.dll 216 268 124.07%


Benefit to Fedora

Make it easier to debug Windows applications cross-compiled from Fedora, in particular:

  • A convenient way to manage crash reporting is to ship gdb with the application, and in case of a crash, attach it to the dying process, collect a stacktrace, and ask the user to send it to the developer. For the developer it helps plenty if the stacktrace already contained symbol names, instead of being number-only.
  • If you need to live-debug a deployed system, it is not always easy to obtain the correct debuginfo packages and install them along the binaries.


Scope

  • Proposal owners:
    • Change mingw-binutils toalso install a generic mingw-nm, which will be used by mingw-find-debuginfo.sh
    • Change mingw-find-debuginfo.sh as outlined above
    • Rebuild all mingw packages
  • Other developers: N/A (not a System Wide Change)
  • Release engineering: #7005 (a check of an impact with Release Engineering is needed)
  • Policies and guidelines: N/A (not a System Wide Change)
  • Trademark approval: N/A (not needed for this Change)

Upgrade/compatibility impact

N/A (not a System Wide Change)

How To Test

  • Wait for the packages rebuilt with the new mingw-find-debuginfo.sh to land, or use the test packages in this COPR repo.
  • Make a Windows application using the binaries with minidebug infos crash
  • The stacktrace should contain function names, i.e.
#0  0x000000000040157d in foo() ()
#1  0x00000000004015b5 in main () 

as opposed to being number only:

#0  0x000000000040157d in ?? ()
#1  0x00000000004015b5 in ?? ()
#2  0x00000000004013f7 in ?? ()
#3  0x000000000040152b in ?? ()
#4  0x0000000076af652d in KERNEL32!BaseThreadInitThunk ()
   from C:\Windows\system32\kernel32.dll
#5  0x0000000076d2c521 in ntdll!RtlUserThreadStart ()
   from C:\Windows\SYSTEM32\ntdll.dll
#6  0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)


User Experience

N/A (not a System Wide Change)

Dependencies

N/A (not a System Wide Change)

Contingency Plan

  • Contingency mechanism: N/A (not a System Wide Change)
  • Contingency deadline: N/A (not a System Wide Change)
  • Blocks release? N/A (not a System Wide Change), Yes/No
  • Blocks product? none

Documentation

N/A (not a System Wide Change)

Release Notes

MinGW binaries contain symbol names by default for easier debugging.