[Boost-bugs] [Boost C++ Libraries] #1848: Boost.Thread is incompatible with UPX

Subject: [Boost-bugs] [Boost C++ Libraries] #1848: Boost.Thread is incompatible with UPX
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-04-22 16:12:33


#1848: Boost.Thread is incompatible with UPX
-----------------------------------------------------------+----------------
 Reporter: Gordon Magnusson <gordon.magnusson_at_[hidden]> | Owner: anthonyw
     Type: Bugs | Status: new
Milestone: Boost 1.36.0 | Component: thread
  Version: Boost 1.35.0 | Severity: Problem
 Keywords: |
-----------------------------------------------------------+----------------
 Programs using Boost.Thread can't be compressed with UPX
 (http://upx.sourceforge.net). This is a regression from 1.34.1 (which UPX
 could compress) to 1.35.0 (which UPX can't compress). Example, with MinGW
 GCC 4.2.1 and statically-linked Boost.Thread 1.35.0:

 {{{
 C:\Temp>type foo.cpp
 #include <iostream>
 #include <ostream>
 #include <boost/thread/thread.hpp>
 using namespace std;
 using namespace boost;

 void foo() {
     cout << "foo()" << endl;
 }

 int main() {
     thread t(foo);
     t.join();
 }

 C:\Temp>g++ -Wall -Wextra foo.cpp -o foo.exe -lboost_thread

 C:\Temp>foo
 foo()

 C:\Temp>upx --best foo.exe
                        Ultimate Packer for eXecutables
   Copyright (C)
 1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007
 UPX 3.02w Markus Oberhumer, Laszlo Molnar & John Reiser Dec 16th
 2007

         File size Ratio Format Name
    -------------------- ------ ----------- -----------
 upx: foo.exe: CantPackException: TLS callbacks are not supported

 Packed 1 file: 0 ok, 1 error.
 }}}

 Presumably, "TLS callbacks" are providing some feature.

 1. It would be nice if this was documented: what the feature is, why it
 requires TLS callbacks, and that they prevent UPX from working. (Some
 users might not figure out the connection here.)

 2. If some users could live without this feature (i.e. if the feature is
 not universally required for correctness), it would be nice to have a way
 to disable it, either by defining some macro before including the
 Boost.Thread headers or by building a special configuration of
 Boost.Thread.

 It appears that TLS callbacks are being used to support thread exit
 handlers, but I don't know what they provide over Boost 1.34.1, or whether
 my program can live without them.

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1848>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC