public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
       [not found] <bug-24196-4@http.gcc.gnu.org/bugzilla/>
@ 2014-02-16 13:12 ` jackie.rosen at hushmail dot com
  2015-03-23 13:36 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 28+ messages in thread
From: jackie.rosen at hushmail dot com @ 2014-02-16 13:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196

Jackie Rosen <jackie.rosen at hushmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jackie.rosen at hushmail dot com

--- Comment #27 from Jackie Rosen <jackie.rosen at hushmail dot com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
       [not found] <bug-24196-4@http.gcc.gnu.org/bugzilla/>
  2014-02-16 13:12 ` [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails jackie.rosen at hushmail dot com
@ 2015-03-23 13:36 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 28+ messages in thread
From: redi at gcc dot gnu.org @ 2015-03-23 13:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196
Bug 24196 depends on bug 24882, which changed state.

Bug 24882 Summary: [meta-bug] Non-refcounted, moveable basic_string
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24882

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (24 preceding siblings ...)
  2010-03-20 19:46 ` davek at gcc dot gnu dot org
@ 2010-06-01 20:51 ` steven at gcc dot gnu dot org
  25 siblings, 0 replies; 28+ messages in thread
From: steven at gcc dot gnu dot org @ 2010-06-01 20:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #26 from steven at gcc dot gnu dot org  2010-06-01 20:50 -------
May become relevant to GCC itself again if GCC wants to link to a static
libstdc++


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |steven at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (23 preceding siblings ...)
  2009-10-25  5:51 ` paolo dot carlini at oracle dot com
@ 2010-03-20 19:46 ` davek at gcc dot gnu dot org
  2010-06-01 20:51 ` steven at gcc dot gnu dot org
  25 siblings, 0 replies; 28+ messages in thread
From: davek at gcc dot gnu dot org @ 2010-03-20 19:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #25 from davek at gcc dot gnu dot org  2010-03-20 19:46 -------
This was fixed on 2009-11-30 by r.154853, which enabled libstdc++ as a DLL on
windows platforms.


-- 

davek at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (22 preceding siblings ...)
  2009-10-25  5:50 ` johnw at gnu dot org
@ 2009-10-25  5:51 ` paolo dot carlini at oracle dot com
  2010-03-20 19:46 ` davek at gcc dot gnu dot org
  2010-06-01 20:51 ` steven at gcc dot gnu dot org
  25 siblings, 0 replies; 28+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-10-25  5:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #24 from paolo dot carlini at oracle dot com  2009-10-25 05:50 -------
The Snow Leopard case is different, apparently they decided to build the system
compiler with --enable-fully-dynamic-string and then that shows up everywhere,
see 41645. As far as we can understand so far, people willing to experiment
with recent GCCs on Snow Leopard have to use that configure time switch.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (21 preceding siblings ...)
  2009-10-25  5:44 ` johnw at gnu dot org
@ 2009-10-25  5:50 ` johnw at gnu dot org
  2009-10-25  5:51 ` paolo dot carlini at oracle dot com
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: johnw at gnu dot org @ 2009-10-25  5:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #23 from johnw at gnu dot org  2009-10-25 05:50 -------
I should also mention, this discrepancy only occurs when _GLIBCXX_DEBUG=1.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (20 preceding siblings ...)
  2009-10-25  5:40 ` johnw at gnu dot org
@ 2009-10-25  5:44 ` johnw at gnu dot org
  2009-10-25  5:50 ` johnw at gnu dot org
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: johnw at gnu dot org @ 2009-10-25  5:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from johnw at gnu dot org  2009-10-25 05:43 -------
A little more data:

With the stock compiler, g++ 4.2.1:

vulcan /tmp $ otool -L bug
bug:
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current
version 7.9.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 123.0.0)
vulcan /tmp $ nm -o /usr/lib/libstdc++.6.dylib | grep empty_rep
0003f200 T __ZNSbIwSt11char_traitsIwESaIwEE12_S_empty_repEv
0003f2fd T __ZNSbIwSt11char_traitsIwESaIwEE4_Rep12_S_empty_repEv
0006fe50 S __ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE
0002fae3 T __ZNSs12_S_empty_repEv
0002fbe7 T __ZNSs4_Rep12_S_empty_repEv
0006fdb0 S __ZNSs4_Rep20_S_empty_rep_storageE
vulcan /tmp $ nm bug | grep empty_rep                       
0000000100001fc7 T __ZNSs12_S_empty_repEv
0000000100001f14 T __ZNSs4_Rep12_S_empty_repEv
000000010000dd00 D __ZNSs4_Rep20_S_empty_rep_storageE

With the compiler built from MacPorts, g++ 4.4.2:

vulcan /tmp $ otool -L bug                                                    
bug:
        /opt/local/lib/gcc44/libstdc++.6.dylib (compatibility version 7.0.0,
current version 7.13.0)
        /opt/local/lib/gcc44/libgcc_s.1.dylib (compatibility version 1.0.0,
current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 123.0.0)
vulcan /tmp $ nm /opt/local/lib/gcc44/libstdc++.6.dylib | grep empty_rep 
00000000000655c0 T __ZNSbIwSt11char_traitsIwESaIwEE12_S_empty_repEv
00000000000658c0 T __ZNSbIwSt11char_traitsIwESaIwEE4_Rep12_S_empty_repEv
00000000000bbe40 D __ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE
000000000004de20 T __ZNSs12_S_empty_repEv
000000000004e0e0 T __ZNSs4_Rep12_S_empty_repEv
00000000000bbdc0 D __ZNSs4_Rep20_S_empty_rep_storageE
vulcan /tmp $ nm bug | grep empty_rep                       
000000010000193b T __ZNSs4_Rep12_S_empty_repEv
0000000100007820 D __ZNSs4_Rep20_S_empty_rep_storageE


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (19 preceding siblings ...)
  2009-06-29 15:12 ` dave dot korn dot cygwin at gmail dot com
@ 2009-10-25  5:40 ` johnw at gnu dot org
  2009-10-25  5:44 ` johnw at gnu dot org
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: johnw at gnu dot org @ 2009-10-25  5:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from johnw at gnu dot org  2009-10-25 05:40 -------
I'm actually getting this same error on Snow Leopard (Mac OS X 10.6.0).  It's
pretty easy to reproduce with Boost (1.40):

#include <string>
#include <sstream>

#include <boost/variant.hpp>

int main()
{
  std::ostringstream buf;
  boost::variant<bool, std::string> data;
  data = buf.str();
  data = false;
  return 0;
}

$ g++ -I/opt/local/include -o bug bug.cc

What happens here is that ostringstream, which is in libstdc++.dylib, returns
an empty string which does not match the notion of empty string compiled into
my executable; thus when Boost tries to deconstruct the string it stored in
order to store the boolean, it crashes trying to deallocate a foreign lib's
empty string.

This doesn't happen with the same Boost using the stock compiler (g++ 4.2).

John


-- 

johnw at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |johnw at gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (18 preceding siblings ...)
  2009-04-25 19:17 ` paolo dot carlini at oracle dot com
@ 2009-06-29 15:12 ` dave dot korn dot cygwin at gmail dot com
  2009-10-25  5:40 ` johnw at gnu dot org
                   ` (5 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: dave dot korn dot cygwin at gmail dot com @ 2009-06-29 15:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from dave dot korn dot cygwin at gmail dot com  2009-06-29 15:12 -------
I think the best solution to this problem is to enable libstdc++ as a DLL, and
export _S_empty_rep from it.  Then every C++ DLL and EXE will link against
libstdc++ and they'll all import the exact same instance.  Problem solved *and*
we get to keep the optimisation.  The more difficult problem of windows
shared-libraries not allowing undefined references (and how this interacts with
RTTI and COMDATs in particular) is a larger issue which will need to be tackled
separately.

I'm about to test a patch based on this approach.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (17 preceding siblings ...)
  2009-04-25 19:10 ` ktietz at gcc dot gnu dot org
@ 2009-04-25 19:17 ` paolo dot carlini at oracle dot com
  2009-06-29 15:12 ` dave dot korn dot cygwin at gmail dot com
                   ` (6 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-25 19:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from paolo dot carlini at oracle dot com  2009-04-25 19:16 -------
Sorry, but at this point in history, it's unlikely that we are going to do much
to the current std::string, given all the ABI implications. When we'll break
the ABI, for C++1x, a completely different implementation will be used, neither
affected by this issue nor by many others (ext/vstring is close, and already
available).


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|paolo dot carlini at oracle |unassigned at gcc dot gnu
                   |dot com                     |dot org
             Status|ASSIGNED                    |NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (16 preceding siblings ...)
  2006-07-06  1:06 ` dannysmith at users dot sourceforge dot net
@ 2009-04-25 19:10 ` ktietz at gcc dot gnu dot org
  2009-04-25 19:17 ` paolo dot carlini at oracle dot com
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: ktietz at gcc dot gnu dot org @ 2009-04-25 19:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from ktietz at gcc dot gnu dot org  2009-04-25 19:10 -------
(In reply to comment #16)
> Ok. Hopefully, before the end of this week I can tell you something trustworthy
> about binary compatibility.
> 

Have you found a solution for it? On w64 target 4.4 (and 4.5) the problem seems
to exist still. At least the patch you sent solved it (I had to adjust it a
bit).

Cheers,
Kai


-- 

ktietz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.4.0 4.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (15 preceding siblings ...)
  2006-05-17 10:09 ` pcarlini at suse dot de
@ 2006-07-06  1:06 ` dannysmith at users dot sourceforge dot net
  2009-04-25 19:10 ` ktietz at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: dannysmith at users dot sourceforge dot net @ 2006-07-06  1:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from dannysmith at users dot sourceforge dot net  2006-07-06 01:06 -------
On mingw32 the testcase will succeed on trunk if libstdc++ (and libgcc) are
built as dlls.   Wouldn't that be the preferred solution?  It also solves very
similar problems with EH data.

Danny


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (14 preceding siblings ...)
  2006-05-17 10:03 ` dave dot korn at artimi dot com
@ 2006-05-17 10:09 ` pcarlini at suse dot de
  2006-07-06  1:06 ` dannysmith at users dot sourceforge dot net
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: pcarlini at suse dot de @ 2006-05-17 10:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from pcarlini at suse dot de  2006-05-17 10:09 -------
Ok. Hopefully, before the end of this week I can tell you something trustworthy
about binary compatibility.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (13 preceding siblings ...)
  2005-10-07 17:06 ` pcarlini at suse dot de
@ 2006-05-17 10:03 ` dave dot korn at artimi dot com
  2006-05-17 10:09 ` pcarlini at suse dot de
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: dave dot korn at artimi dot com @ 2006-05-17 10:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from dave dot korn at artimi dot com  2006-05-17 10:03 -------
I'm new maintainer for Cygwin gcc.  I'll be rolling a release with the patch
Paolo proposed rather than using the configure option, although if binary
compatibility problems do crop up I'll look at the second route.

    DaveK


-- 

dave dot korn at artimi dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dave dot korn at artimi dot
                   |                            |com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2005-10-07 12:13 ` ptsekov at gmx dot net
@ 2005-10-07 17:06 ` pcarlini at suse dot de
  2006-05-17 10:03 ` dave dot korn at artimi dot com
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: pcarlini at suse dot de @ 2005-10-07 17:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from pcarlini at suse dot de  2005-10-07 17:05 -------
(In reply to comment #13)
> Both the simple testcase and the program I am working on work fine with your
> patch.

Thanks. Actually, I have to think a bit more about the idea. I'm not sure that
there are binary compatibility problems, maybe not ;)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2005-10-06 17:01 ` pcarlini at suse dot de
@ 2005-10-07 12:13 ` ptsekov at gmx dot net
  2005-10-07 17:06 ` pcarlini at suse dot de
                   ` (12 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: ptsekov at gmx dot net @ 2005-10-07 12:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from ptsekov at gmx dot net  2005-10-07 12:13 -------
Both the simple testcase and the program I am working on work fine with your
patch.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2005-10-06 17:00 ` pcarlini at suse dot de
@ 2005-10-06 17:01 ` pcarlini at suse dot de
  2005-10-07 12:13 ` ptsekov at gmx dot net
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: pcarlini at suse dot de @ 2005-10-06 17:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from pcarlini at suse dot de  2005-10-06 17:01 -------
I'm attaching a first draft implementing what I have in mind. Assuming testing
goes well, the issue of binary compatibility should be evaluated: whereas the
library-ABI is preserved, in general object code build with the current lib
and with the new one will not be able to safely exchange empty strings. I don't
how much this is an issue for the Cygwin project (certainly it would be for a
linux distribution).

Consider, anyway, that we are talking about a new configure option and those
can break the binary compatibility in any way (like changing the locale model,
for instance), we don't provide guarantees in those cases.

We can try to figure out ways to improve that, but I'm not super confident
we can make it. If binary compatibility is a major requirement, then the
--enable-fully-dynamic-string option would be ok, maybe improved along the
way I mentioned yesterday.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2005-10-06 12:53 ` pcarlini at suse dot de
@ 2005-10-06 17:00 ` pcarlini at suse dot de
  2005-10-06 17:01 ` pcarlini at suse dot de
                   ` (14 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: pcarlini at suse dot de @ 2005-10-06 17:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pcarlini at suse dot de  2005-10-06 17:00 -------
Created an attachment (id=9911)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9911&action=view)
First draft vs 3_4-branch


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2005-10-06 12:50 ` ptsekov at gmx dot net
@ 2005-10-06 12:53 ` pcarlini at suse dot de
  2005-10-06 17:00 ` pcarlini at suse dot de
                   ` (15 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: pcarlini at suse dot de @ 2005-10-06 12:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pcarlini at suse dot de  2005-10-06 12:53 -------
(In reply to comment #9)
> I will test any patch that resolves the issue. In any case the final decision
> will be that of the Cygwin gcc maintainer. But what you suggests sounds better
> than just using --enable-fully-dynamic-string.

Excellent. I will prepare one against 3_4-branch, for your ease. Will not
include
any configury bits, for now, just apply and rebuild. Give me 1-2 days max...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2005-10-06 11:50 ` pcarlini at suse dot de
@ 2005-10-06 12:50 ` ptsekov at gmx dot net
  2005-10-06 12:53 ` pcarlini at suse dot de
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: ptsekov at gmx dot net @ 2005-10-06 12:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from ptsekov at gmx dot net  2005-10-06 12:50 -------
I will test any patch that resolves the issue. In any case the final decision
will be that of the Cygwin gcc maintainer. But what you suggests sounds better
than just using --enable-fully-dynamic-string.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2005-10-05 10:20 ` pcarlini at suse dot de
@ 2005-10-06 11:50 ` pcarlini at suse dot de
  2005-10-06 12:50 ` ptsekov at gmx dot net
                   ` (17 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: pcarlini at suse dot de @ 2005-10-06 11:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pcarlini at suse dot de  2005-10-06 11:50 -------
I'm thinking that another possibility would be avoiding only *part* of the
optimization scheme that relies on _S_empty_rep_storage, that is return to
the behavior pre-2003-06-13. The empty string object would be reference
counted, as any other string, no special cases and no addresses at destruction
time. Seems a good compromise for some targets. Are you willing to test a
patch? I can prepare one vs 3.4.x but consider that that branch is no longer
maintained and any change would eventually go in mainline (and, possibly,
4_0-branch) only.


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pcarlini at suse dot de
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-10-06 11:50:31
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2005-10-05  8:51 ` pcarlini at suse dot de
@ 2005-10-05 10:20 ` pcarlini at suse dot de
  2005-10-06 11:50 ` pcarlini at suse dot de
                   ` (18 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: pcarlini at suse dot de @ 2005-10-05 10:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pcarlini at suse dot de  2005-10-05 10:20 -------
PS: if you are going to experiment with _GLIBCXX_FULLY_DYNAMIC_STRING defined
by default, I would suggest also testing the performance impact of the
following:
change the default constructor to allocate memory on the heap not only for the
'\0', but also for a given small capacity > 0, say 15 chars. This would recover
in some cases the initial overhead by not freeing and allocating memory at the
first real usage.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-10-05  8:36 ` ptsekov at gmx dot net
@ 2005-10-05  8:51 ` pcarlini at suse dot de
  2005-10-05 10:20 ` pcarlini at suse dot de
                   ` (19 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: pcarlini at suse dot de @ 2005-10-05  8:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pcarlini at suse dot de  2005-10-05 08:50 -------
(In reply to comment #5)
> Paolo, I guess it is obvious to anyone around that _S_empty_rep_storage is
> there to speed up things. What is not obvious to Cygwin users is that this
> optimization actually makes their programs crash. And let me assure you that
> the crash is not easy to track down unless you want to step trough assembler
> code.

I believe you, but I'm definitely not sure that giving away by default this
important optimization for the sake of the few people playing with dlls is
the way to go for Cygwin. Maybe the fact that in so many years nobody
reported problems before should tell you something...

Anyway, you are probably right, you should first discuss the issue in the
Cygwin community and weight the various options. Then, if a change to the
configury localized to Cygwin will be in order rest assured that will be
very quickly approved. Thanks.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-10-04 20:53 ` pcarlini at suse dot de
@ 2005-10-05  8:36 ` ptsekov at gmx dot net
  2005-10-05  8:51 ` pcarlini at suse dot de
                   ` (20 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: ptsekov at gmx dot net @ 2005-10-05  8:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from ptsekov at gmx dot net  2005-10-05 08:36 -------
Paolo, I guess it is obvious to anyone around that _S_empty_rep_storage is
there to speed up things. What is not obvious to Cygwin users is that this
optimization actually makes their programs crash. And let me assure you that
the crash is not easy to track down unless you want to step trough assembler
code.

Anyway, what I meant was that it may be good to have
_GLIBCXX_FULLY_DYNAMIC_STRING undefined for the common case but not for the
current libstdc++ on Cygwin i.e. libstdc++ comes as a static library. Maybe
this question concerns only Cygwin and is not of general interest and as such
should be discussed only on the Cygwin mailing list.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-10-04 19:28 ` ptsekov at gmx dot net
@ 2005-10-04 20:53 ` pcarlini at suse dot de
  2005-10-05  8:36 ` ptsekov at gmx dot net
                   ` (21 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: pcarlini at suse dot de @ 2005-10-04 20:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pcarlini at suse dot de  2005-10-04 20:53 -------
(In reply to comment #3)
> Is there any specific reason that _GLIBCXX_FULLY_DYNAMIC_STRING is not defined
> on Cygwin ?

Not having really looked into this issue, the reason is however obvious: the
use of _S_empty_rep_storage represents a very good optimization without
negative side effects for many (I would say, most) applications of the c++
library. As
the string class is currently designed, _GLIBCXX_FULLY_DYNAMIC_STRING should 
be definitely undefined by default.

By the way, for gcc4.1 we will provide an alternate "versatile" string class
which doesn't have this problem, but in any case cannot become immediately
our default string class implementation due to ABI stability (you can already
play with it using CVS gcc: <ext/vstring.h>)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
  2005-10-04 19:08 ` [Bug libstdc++/24196] " gerrit at gcc dot gnu dot org
  2005-10-04 19:10 ` pinskia at gcc dot gnu dot org
@ 2005-10-04 19:28 ` ptsekov at gmx dot net
  2005-10-04 20:53 ` pcarlini at suse dot de
                   ` (22 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: ptsekov at gmx dot net @ 2005-10-04 19:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ptsekov at gmx dot net  2005-10-04 19:28 -------
Is there any specific reason that _GLIBCXX_FULLY_DYNAMIC_STRING is not defined
on Cygwin ?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
  2005-10-04 19:08 ` [Bug libstdc++/24196] " gerrit at gcc dot gnu dot org
@ 2005-10-04 19:10 ` pinskia at gcc dot gnu dot org
  2005-10-04 19:28 ` ptsekov at gmx dot net
                   ` (23 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-04 19:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2005-10-04 19:10 -------
Maybe it is better just to support shared (dynamic) Libraries on win32 too.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails
  2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
@ 2005-10-04 19:08 ` gerrit at gcc dot gnu dot org
  2005-10-04 19:10 ` pinskia at gcc dot gnu dot org
                   ` (24 subsequent siblings)
  25 siblings, 0 replies; 28+ messages in thread
From: gerrit at gcc dot gnu dot org @ 2005-10-04 19:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from gerrit at gcc dot gnu dot org  2005-10-04 19:08 -------
Created an attachment (id=9877)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9877&action=view)
Testcase which demostrates the problem


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2015-03-23 13:02 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-24196-4@http.gcc.gnu.org/bugzilla/>
2014-02-16 13:12 ` [Bug libstdc++/24196] Using string instances to pass arguments to dlls fails jackie.rosen at hushmail dot com
2015-03-23 13:36 ` redi at gcc dot gnu.org
2005-10-04 19:07 [Bug libstdc++/24196] New: " gerrit at gcc dot gnu dot org
2005-10-04 19:08 ` [Bug libstdc++/24196] " gerrit at gcc dot gnu dot org
2005-10-04 19:10 ` pinskia at gcc dot gnu dot org
2005-10-04 19:28 ` ptsekov at gmx dot net
2005-10-04 20:53 ` pcarlini at suse dot de
2005-10-05  8:36 ` ptsekov at gmx dot net
2005-10-05  8:51 ` pcarlini at suse dot de
2005-10-05 10:20 ` pcarlini at suse dot de
2005-10-06 11:50 ` pcarlini at suse dot de
2005-10-06 12:50 ` ptsekov at gmx dot net
2005-10-06 12:53 ` pcarlini at suse dot de
2005-10-06 17:00 ` pcarlini at suse dot de
2005-10-06 17:01 ` pcarlini at suse dot de
2005-10-07 12:13 ` ptsekov at gmx dot net
2005-10-07 17:06 ` pcarlini at suse dot de
2006-05-17 10:03 ` dave dot korn at artimi dot com
2006-05-17 10:09 ` pcarlini at suse dot de
2006-07-06  1:06 ` dannysmith at users dot sourceforge dot net
2009-04-25 19:10 ` ktietz at gcc dot gnu dot org
2009-04-25 19:17 ` paolo dot carlini at oracle dot com
2009-06-29 15:12 ` dave dot korn dot cygwin at gmail dot com
2009-10-25  5:40 ` johnw at gnu dot org
2009-10-25  5:44 ` johnw at gnu dot org
2009-10-25  5:50 ` johnw at gnu dot org
2009-10-25  5:51 ` paolo dot carlini at oracle dot com
2010-03-20 19:46 ` davek at gcc dot gnu dot org
2010-06-01 20:51 ` steven at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).