public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "damien.buhl at lecbna dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/42734] trivial use of std::thread fails with "pure virtual method called"
Date: Fri, 05 Dec 2014 00:26:00 -0000	[thread overview]
Message-ID: <bug-42734-4-iRvdUaUgug@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-42734-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42734

--- Comment #46 from Damien Buhl (daminetreg) <damien.buhl at lecbna dot org> ---
As a pretier alternative you can use boost::thread with boost::atomic as
backend as we did in a yocto cross toolchain with the same issue where latomic
also segfaulted.

Cheers

fenixk19 at mail dot ru <gcc-bugzilla@gcc.gnu.org> a écrit :

>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42734
>
>--- Comment #45 from Alexander Varnin <fenixk19 at mail dot ru> ---
>(In reply to Damien Buhl (daminetreg) from comment #44)
>
>While given test works properly with -latomic on my installation, my
>application doesn't. It fails with segfault in approximately half of launches.
>Core dump points to some thread execution code. I suppose, it is still broken
>in some way.
>
>Replacing std::thread in my code with pthread_* makes it work properly.
>
>So I conclude, that this std::thread and atomic things is broken on my gcc
>4.8.2 arm freescale imx53 yocto build.
>
>-- 
>You are receiving this mail because:
>You are on the CC list for the bug.
>From gcc-bugs-return-469518-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Dec 05 02:20:21 2014
Return-Path: <gcc-bugs-return-469518-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19032 invoked by alias); 5 Dec 2014 02:20:19 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 19014 invoked by uid 89); 5 Dec 2014 02:20:18 -0000
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.4 required=5.0 tests=AWL,BAYES_40,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,URIBL_DBL_ABUSE_REDIR,URIBL_DBL_REDIR autolearn=ham version=3.3.2
X-HELO: mail-yh0-f67.google.com
Received: from mail-yh0-f67.google.com (HELO mail-yh0-f67.google.com) (209.85.213.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 05 Dec 2014 02:20:17 +0000
Received: by mail-yh0-f67.google.com with SMTP id a41so2477919yho.10        for <gcc-bugs@gcc.gnu.org>; Thu, 04 Dec 2014 18:20:15 -0800 (PST)
MIME-Version: 1.0
X-Received: by 10.236.110.35 with SMTP id t23mr17736008yhg.126.1417746015619; Thu, 04 Dec 2014 18:20:15 -0800 (PST)
Received: by 10.170.162.85 with HTTP; Thu, 4 Dec 2014 18:20:15 -0800 (PST)
Date: Fri, 05 Dec 2014 02:20:00 -0000
Message-ID: <CAL3UPOdpTYGAtSBcGASTxYLG7xG7P34L2z4doW0z1sWYOn=7oQ@mail.gmail.com>
Subject: A problem of template implicit instantiation
From: Yu Sheng Oh <humbleoh@gmail.com>
To: gcc-bugs <gcc-bugs@gcc.gnu.org>
Content-Type: text/plain; charset=UTF-8
X-IsSubscribed: yes
X-SW-Source: 2014-12/txt/msg00525.txt.bz2
Content-length: 972

HI,

I have a piece of code at "http://goo.gl/r2ySE6"

Refer to the code, with option of "-O2 -std=c++1y", when we comment
out the statement "id<int>;" clang-3.4.1 compiles the code
successfully, but g++-4.9.0 compiles failed, where g++ complains that
"unresolved overloaded function type", which in turn implies that at
the point of calling compose function, id<int> is not instantiated.

"3. Unless a function template specialization has been explicitly
instantiated or explicitly specialized, *the function template
specialization is implicitly instantiated  when the specialization is
referenced in a context that requires a function definition to exist.*
"[temp.inst]

At the point of calling the compose function, the function definition
for id<int> is required, and so, id<int> should be implicitly
instantiated.

Based on my argument, it is a bug in g++-4.9.0, but I am not 100% sure
of it. Please advice.

PS: Yongwei Wu is credited for discovering the problem.


  parent reply	other threads:[~2014-12-05  0:26 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-42734-4@http.gcc.gnu.org/bugzilla/>
2010-10-15 18:46 ` nacitar at gmail dot com
2010-10-15 18:49 ` pinskia at gcc dot gnu.org
2010-10-15 19:28 ` redi at gcc dot gnu.org
2010-10-15 19:38 ` redi at gcc dot gnu.org
2010-10-15 19:45 ` redi at gcc dot gnu.org
2010-10-15 19:47 ` nacitar at gmail dot com
2010-10-15 20:07 ` redi at gcc dot gnu.org
2010-10-15 23:42 ` paolo.carlini at oracle dot com
2010-10-16 13:32 ` redi at gcc dot gnu.org
2010-10-16 15:54 ` redi at gcc dot gnu.org
2010-10-17  9:57 ` paolo.carlini at oracle dot com
2014-07-18  5:43 ` damien.buhl at lecbna dot org
2014-12-03 18:40 ` fenixk19 at mail dot ru
2014-12-04 12:52 ` fenixk19 at mail dot ru
2014-12-04 12:55 ` damien.buhl at lecbna dot org
2014-12-04 19:28 ` fenixk19 at mail dot ru
2014-12-05  0:26 ` damien.buhl at lecbna dot org [this message]
2014-12-08 15:54 ` damien.buhl at lecbna dot org
2014-12-08 21:05 ` fenixk19 at mail dot ru
2015-10-05 10:18 ` redi at gcc dot gnu.org
2010-01-13 20:21 [Bug libstdc++/42734] New: " phil at nwl dot cc
2010-01-13 20:22 ` [Bug libstdc++/42734] " phil at nwl dot cc
2010-01-13 20:23 ` phil at nwl dot cc
2010-01-13 20:24 ` phil at nwl dot cc
2010-01-13 20:41 ` paolo dot carlini at oracle dot com
2010-01-13 21:33 ` redi at gcc dot gnu dot org
2010-01-13 21:37 ` redi at gcc dot gnu dot org
2010-01-13 22:34 ` phil at nwl dot cc
2010-01-13 22:37 ` phil at nwl dot cc
2010-01-13 22:40 ` paolo dot carlini at oracle dot com
2010-01-13 22:40 ` paolo dot carlini at oracle dot com
2010-01-13 22:53 ` phil at nwl dot cc
2010-01-13 23:10 ` paolo dot carlini at oracle dot com
2010-01-13 23:34 ` redi at gcc dot gnu dot org
2010-01-14  1:14 ` phil at nwl dot cc
2010-01-14  1:59 ` paolo dot carlini at oracle dot com
2010-01-14 21:36 ` paolo dot carlini at oracle dot com
2010-01-15  1:49 ` phil at nwl dot cc
2010-01-15  1:55 ` phil at nwl dot cc
2010-01-15  2:00 ` paolo dot carlini at oracle dot com
2010-01-15  2:02 ` paolo dot carlini at oracle dot com
2010-01-15  2:05 ` paolo dot carlini at oracle dot com
2010-01-15 22:07 ` phil at nwl dot cc
2010-01-15 22:15 ` paolo dot carlini at oracle dot com
2010-01-15 22:32 ` phil at nwl dot cc
2010-01-15 23:07 ` paolo dot carlini at oracle dot com
2010-01-15 23:49 ` phil at nwl dot cc
2010-01-16  0:05 ` paolo dot carlini at oracle dot com
2010-01-16  1:08 ` phil at nwl dot cc
2010-01-16 10:10 ` paolo dot carlini at oracle dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-42734-4-iRvdUaUgug@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).