public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* Segmentation fault with unique_ptr
@ 2015-02-13 11:15 tassos_souris
  2015-02-13 11:26 ` Kyrill Tkachov
  0 siblings, 1 reply; 3+ messages in thread
From: tassos_souris @ 2015-02-13 11:15 UTC (permalink / raw)
  To: gcc-bugs

Hi to everyone,

I am using g++-4.9 with -std=c++14 option (no optimization flag). For some
reason i have the following singly_linked_list class. The usage is this:
1) Construct a singly linked list
2) push_front() at least 100000000 values (this is important -- i.e for 1000
values i don't get a segfault)
3) Destroy the singly linked list

At step 3 i get a segfault. What is wrong with the code?
I would appreciate it if you could take a peek and help.
(ps: bardon me if this isn't the right forum for such questions)


 



--
View this message in context: http://gcc.1065356.n5.nabble.com/Segmentation-fault-with-unique-ptr-tp1120921.html
Sent from the gcc - bugs mailing list archive at Nabble.com.


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

* Re: Segmentation fault with unique_ptr
  2015-02-13 11:15 Segmentation fault with unique_ptr tassos_souris
@ 2015-02-13 11:26 ` Kyrill Tkachov
  2015-02-13 13:04   ` tassos_souris
  0 siblings, 1 reply; 3+ messages in thread
From: Kyrill Tkachov @ 2015-02-13 11:26 UTC (permalink / raw)
  To: tassos_souris, gcc-bugs


On 13/02/15 11:15, tassos_souris wrote:
> Hi to everyone,
>
> I am using g++-4.9 with -std=c++14 option (no optimization flag). For some
> reason i have the following singly_linked_list class. The usage is this:
> 1) Construct a singly linked list
> 2) push_front() at least 100000000 values (this is important -- i.e for 1000
> values i don't get a segfault)
> 3) Destroy the singly linked list
>
> At step 3 i get a segfault. What is wrong with the code?
> I would appreciate it if you could take a peek and help.
> (ps: bardon me if this isn't the right forum for such questions)

Your question will probably be lost in the torrent of automated bug 
tracker emails that go on this list. We'll need more information than 
that, including source code.
Please follow the instructions at https://gcc.gnu.org/bugs/ and submit a 
bug report if you think it's appropriate. Personally, I think you're 
just running out of memory (creating too large a list for your system), 
but I could be wrong.

Kyrill

>
>   
>
>
>
> --
> View this message in context: http://gcc.1065356.n5.nabble.com/Segmentation-fault-with-unique-ptr-tp1120921.html
> Sent from the gcc - bugs mailing list archive at Nabble.com.
>



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

* Re: Segmentation fault with unique_ptr
  2015-02-13 11:26 ` Kyrill Tkachov
@ 2015-02-13 13:04   ` tassos_souris
  0 siblings, 0 replies; 3+ messages in thread
From: tassos_souris @ 2015-02-13 13:04 UTC (permalink / raw)
  To: gcc-bugs

the main function is as simple as this:



Compile with: g++-4.9 -std=c++14 -g -o main main.cpp
and run with ./main. I get segfault. gdb in bt shows that the segfault
happens inside unique_ptr destructor. So it is not a memory issue. 
Also since the code runs with less size (i.e size=1000 no problem) i assume
that something is wrong with unique_ptr and not my code. That's of course
only an assumption don't get me wrong :)

Thanks for looking at it



--
View this message in context: http://gcc.1065356.n5.nabble.com/Segmentation-fault-with-unique-ptr-tp1120921p1120949.html
Sent from the gcc - bugs mailing list archive at Nabble.com.


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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-13 11:15 Segmentation fault with unique_ptr tassos_souris
2015-02-13 11:26 ` Kyrill Tkachov
2015-02-13 13:04   ` tassos_souris

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