[Bug c++/60959] New: Does “cout<<(char*)NULL” doing “close(1)” ?

2014-04-24 Thread sree.gooogle at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60959

Bug ID: 60959
   Summary: Does “cout<<(char*)NULL” doing “close(1)” ?
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sree.gooogle at gmail dot com

In the following piece of C++ code I have used cout<<(char*)NULL; after this
line, my program printing nothing to the output screen. Does it mean I have
done close(1) with cout here?

#include
using namespace std;

void f(){
cout<<"\nfun\n";
}

main(){
cout<<(char*)NULL;
f(); //not getting printed !
cout<<"\nhello\n";  //not getting printed !
cout<<"hii how are you?"; //not getting printed, why??
}

compiled using:
g++ myprog.cpp
run:
./a.out

o/p:
 Prints nothing

I have tried this code in gcc as well as DevCpp compiler, same behavior
observed. Is this a compiler bug? Please provide detailed information about
this behavior. 

Thank you!

[Bug c++/60959] Does “cout<<(char*)NULL” doing “close(1)” ?

2014-04-24 Thread sree.gooogle at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60959

--- Comment #2 from Sreenath U S  ---
"sets the badbit on the stream which causes nothing to be printed after that.";
So this is a defined behavior or it varies on compiler to compiler?


[Bug c++/60959] Does “cout<<(char*)NULL” doing “close(1)” ?

2014-04-24 Thread sree.gooogle at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60959

--- Comment #4 from Sreenath U S  ---
Okay Thanks. One more thing, Is there any way to make the remaining cout
statements to get printed in gcc without removing the faulty
cout<<(char*)NULL;?


[Bug c/60388] New: Program received signal SIGSEGV, Segmentation fault. 0xb7fb62ff in __pthread_create_2_1

2014-03-02 Thread sree.gooogle at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60388

Bug ID: 60388
   Summary: Program received signal SIGSEGV, Segmentation fault.
0xb7fb62ff in __pthread_create_2_1
   Product: gcc
   Version: 4.7.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sree.gooogle at gmail dot com

Created attachment 32242
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32242&action=edit
c program used for Segmentation fault at line number 563 in pthread_create.c

Hi,

Please take a look at this issue. I have faced a SIGSEGV at line number 563 in
pthread_create.c. The program Crashed in the below fashion:
(gdb)s
514 in pthread_create.c
(gdb)
518 in pthread_create.c
(gdb)
563 in pthread_create.c
(gdb)
Program received signal SIGSEGV, Segmentation fault.
0xb7fb62ff in __pthread_create_2_1 (newthread=0x0, attr=0x0,
start_routine=0x80484cc , arg=0x0) at pthread_create.c:563
563 in pthread_create.c
(gdb)
(gdb) bt
#0  0xb7fb62ff in __pthread_create_2_1 (newthread=0x0, attr=0x0,
start_routine=0x80484cc , arg=0x0) at pthread_create.c:563
#1  0x0804853c in main () at max_trd_creation.c:22
(gdb) i frame
Stack level 0, frame at 0xb670:
 eip = 0xb7fb62ff in __pthread_create_2_1 (pthread_create.c:563); saved eip
0x804853c
 called by frame at 0xb6a0
 source language c.
 Arglist at unknown address.
 Locals at unknown address, Previous frame's sp is 0xb670
 Saved registers:
  ebx at 0xb65c, ebp at 0xb668, esi at 0xb660, edi at 0xb664,
eip at 0xb66c
(gdb)s
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb)

I am going through the below link for details about the line number 563 in
pthread_create.c
http://code.woboq.org/userspace/glibc/nptl/pthread_create.c.html
557if (iattr->flags & ATTR_FLAG_SCHED_SET)
558memcpy (&pd->schedparam, &iattr->schedparam,
559sizeof (struct sched_param));
560else if ((pd->flags & ATTR_FLAG_SCHED_SET) == 0)
561{
562INTERNAL_SYSCALL (sched_getparam, scerr, 2, 0, &pd->schedparam);
563pd->flags |= ATTR_FLAG_SCHED_SET;
564}


What is the gcc version which I have used?
==
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)

How I compiled the program and what are all the options given and the warnings
produced?
===
labro@ubuntu:~/Desktop/sree/DevUnix$ gcc max_trd_creation.c -g -lpthread
max_trd_creation.c: In function âmainâ:
max_trd_creation.c:22:3: warning: passing argument 1 of âpthread_createâ makes
pointer from integer without a cast [enabled by default]
In file included from max_trd_creation.c:2:0:
/usr/include/pthread.h:225:12: note: expected âpthread_t * __restrict__â but
argument is of type âpthread_tâ


I have attached the piece of code which I have used for producing this seg
fault. 

Kindly ignore this if you dot see something useful. 


Thanks and Regards,
Sreenath

[Bug c/60388] Program received signal SIGSEGV, Segmentation fault. 0xb7fb62ff in __pthread_create_2_1

2014-03-02 Thread sree.gooogle at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60388

Sreenath U S  changed:

   What|Removed |Added

   Keywords||diagnostic
 CC||sree.gooogle at gmail dot com
   Severity|normal  |minor