public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC Help needed
@ 2020-07-04 20:39 Shrivani .
  2020-07-06 11:32 ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: Shrivani . @ 2020-07-04 20:39 UTC (permalink / raw)
  To: gcc-help

Hello Team

The following std::cout results in termination of the program.

std::stringstream string_1, string_2;
std::cout<<string_1.str()<< int_1<<" "<<string_2.str()<<std::endl;



#0  __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1  0x00007ffff6afb910 in __GI__IO_fwrite (buf=0x7ffff6e698c0 <_IO_stdfile_1_lock>, size=1, count=75,
    fp=0x7ffff6bac6ac <__lll_lock_wait_private+28>) at iofwrite.c:37
#2  0x00007ffff795db84 in std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) ()
   from target:/usr/lib/x86_64-linux-gnu/libstdc++.so.6


#0  0x00007ffff6b8c187 in GI_libc_write (fd=1, buf=0x555555b01840, nbytes=172)

    at ../sysdeps/unix/sysv/linux/write.c:27

#1  0x00007ffff6b071bd in IO_new_file_write (f=0x7ffff6e68760 <_IO_2_1_stdout>, data=0x555555b01840,
    n=172) at fileops.c:1203

#2  0x00007ffff6b08f51 in new_do_write (to_do=172,
    data=0x555555b01840 "2020/05/19 15:57:50.000000  230542208 000 ECU1 Para ACOM log debug verbose 8 SomeIpPosixClient TransmitSomeIpMessage : 1028 Instance_id 0x 0x0001  memory buffer length  34\nx00000001 :0x 0x00000001 :0x"..., fp=0x7ffff6e68760 <_IO_2_1_stdout_>) at fileops.c:457

#3  IO_new_do_write (fp=fp@entry=0x7ffff6e68760 <_IO_2_1_stdout>,
    data=0x555555b01840 "2020/05/19 15:57:50.000000  230542208 000 ECU1 Para ACOM log debug verbose 8 SomeIpPosixClient TransmitSomeIpMessage : 1028 Instance_id 0x 0x0001  memory buffer length  34\nx00000001 :0x 0x00000001 :0x"..., to_do=172) at fileops.c:433

#4  0x00007ffff6b09403 in IO_new_file_overflow (f=0x7ffff6e68760 <_IO_2_1_stdout>, ch=10)
    at fileops.c:798

#5  0x00007ffff6b0434b in GIIO_putc (c=<optimized out>, fp=0x7ffff6e68760 <_IO_2_1_stdout_>)
    at putc.c:31

#6  0x00007ffff795d68a in std::ostream::put(char) ()
   from target:/usr/lib/x86_64-linux-gnu/libstdc++.so.6

#7  0x00007ffff795d88f in std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&) ()
   from target:/usr/lib/x86_64-linux-gnu/libstdc++.so.6




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

* Re: GCC Help needed
  2020-07-04 20:39 GCC Help needed Shrivani .
@ 2020-07-06 11:32 ` Jonathan Wakely
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Wakely @ 2020-07-06 11:32 UTC (permalink / raw)
  To: Shrivani .; +Cc: gcc-help

On Sat, 4 Jul 2020 at 21:41, Shrivani . <Shrivani@kpit.com> wrote:
>
> Hello Team
>
> The following std::cout results in termination of the program.
>
> std::stringstream string_1, string_2;
> std::cout<<string_1.str()<< int_1<<" "<<string_2.str()<<std::endl;

Similar code works for everybody else, so you must be doing something
wrong (maybe you have a bug elsewhere in your program which is
corrupting the program's memory or the I/O streams). You didn't show a
complete example though, so we have no idea what the rest of your
program does.

I suggest you try the steps recommended before reporting a bug:

"Before reporting that GCC compiles your code incorrectly, compile it
with gcc -Wall -Wextra and see whether this shows anything wrong with
your code. Similarly, if compiling with -fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations makes a difference, or if compiling
with -fsanitize=undefined produces any run-time errors, then your code
is probably not correct."

You could also try -fsanitize=address or valgrind to check for memory
errors (but don't use valgrind on code compiled with
-fsanitize=address, use one at a time).

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

* GCC help needed
@ 2005-05-30 15:29 Thushara Gopalakrishnan
  0 siblings, 0 replies; 3+ messages in thread
From: Thushara Gopalakrishnan @ 2005-05-30 15:29 UTC (permalink / raw)
  To: gcc-help

hello,
    can u pls tell me ,
 1) Using 2 GCCs in one Distro
 2)  How to add 2 GCCs in one Distro.
i want to know the steps that has to be followed in adding and using of 
2 Gcc in the same distro.
pls help me out in this.


-

Thanks.
Kind Regards                                                    
                                               
Thushara.G                                            


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

end of thread, other threads:[~2020-07-06 11:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-04 20:39 GCC Help needed Shrivani .
2020-07-06 11:32 ` Jonathan Wakely
  -- strict thread matches above, loose matches on Subject: below --
2005-05-30 15:29 GCC help needed Thushara Gopalakrishnan

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).