https://sourceware.org/bugzilla/show_bug.cgi?id=30375

            Bug ID: 30375
           Summary: C++ std::cout's rdbuf gives ridiculous address on
                    windows with dynamic linking
           Product: binutils
           Version: 2.41 (HEAD)
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: euloanty at live dot com
  Target Milestone: ---

struct foo
{

        foo()
        {
                __builtin_puts("hello\n");
        }
};
foo f{};

#include<iostream>

foo death{};

int main()
{
        __builtin_puts("before crashing\n");
        __builtin_printf("%p\n",std::cout.rdbuf());
        __builtin_puts("crashing\n");
}
Here is an example:

>g++ -o hw hw.cc -Ofast -s -I../include

>hw
hello

hello

before crashing

6156746547736C54
crashing

Using lld:

>g++ -o hw hw.cc -Ofast -s -I../include -fuse-ld=lld

>hw
hello

hello

before crashing

00007FFFA97A4C00
crashing

>g++ -o hw hw.cc -Ofast -s -I../include -static

D:\msys64\home\unlvs\projects\fast_io\.temp>hw
hello

hello

before crashing

00007FF62687E8C0
crashing


What happens here??

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to