Wednesday, 4 June 2014

[gccsdk] [Bug 254] New: C++11 threads do not work and cause a crash

http://www.riscos.info/bugzilla3/show_bug.cgi?id=254

Summary: C++11 threads do not work and cause a crash
Product: GCC/GCCSDK
Version: other
Platform: Other
OS/Version: RISC OS
Status: NEW
Severity: normal
Priority: P1
Component: C++ compiler
AssignedTo: John.Tytgat@aaug.net
ReportedBy: alan_baa@hotmail.com
Estimated Hours: 0.0


When trying to use the new threads functionality in C++11 the program crashes
with the following error:

terminate called after throwing an instance of 'std::system_error'
terminate called recursively

Fatal signal received: Aborted

Stack backtrace:

Running thread 0x4f57c
( 1626e10) pc: 33fbc lr: 34460 sp: 1626e14 __write_backtrace()
( 1626e80) pc: 340d8 lr: 347c4 sp: 1626e84 __unixlib_raise_signal()
( 1626e90) pc: 347a8 lr: 27a4c sp: 1626e94 raise()
( 1626ea4) pc: 27a10 lr: 179dc sp: 1626ea8 abort()
( 1626ec4) pc: 17910 lr: 15078 sp: 1626ec8
__gnu_cxx::__verbose_terminate_handler()()
( 1626ed4) pc: 1506c lr: 150d0 sp: 1626ed8
__cxxabiv1::__terminate(void (*)())()
( 1626f18) pc: 1790c lr: 15078 sp: 1626f1c
__gnu_cxx::__verbose_terminate_handler()()
( 1626f28) pc: 15068 lr: 150d0 sp: 1626f2c
__cxxabiv1::__terminate(void (*)())()
( 1626f80) pc: d3bc lr: 12cd0 sp: 1626f84
std::__throw_system_error(int)()
( 1626f98) pc: 12cb0 lr: 8fd8 sp: 1626f9c
std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>)()
( 1626fc8) pc: 8f64 lr: 8834 sp: 1626fcc std::thread::thread<void
(&)()>(void (&)())()
( 1626fec) pc: 8810 lr: 2bfec sp: 1626ff0 main()

The program that produced the error was:

#include <thread>
#include "stdio.h"

void test()
{
printf("Hello from test\n");
}

int main(int argc, char *argv[])
{
std::thread t(test);
t.join();
return 0;
}

It was compiled with the cross compiler built from trunk on 27th May 2014 on
Cygwin and tried again with the same build on Debian.

with:
~/gccsdk/cross/bin/arm-unknown-riscos-g++ -std=c++11 -static main.cc
~/gccsdk/cross/bin/elf2aif a.out thread11,ff8

--
Configure bugmail: http://www.riscos.info/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

No comments:

Post a Comment