Opened 10 years ago

Last modified 10 years ago

#6831 new Bugs

__sync_lock_test_and_set_4 and illegal instruction

Reported by: Pascal Kesseli <pascal.kesseli@…> Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.43.0 Severity: Showstopper
Keywords: async_read __sync_lock_test_and_set_4 illegal_instruction Cc:

Description

In the attachment, I’ve prepared a simple test program verifying a trivial asynchronous read operation using asio sockets. The program compiles and runs fine up to boost version 1.42. In version 1.43, compiling the program fails with a linker error:

/tmp/ccQi0dGl.o: In function `boost::asio::detail::gcc_fenced_block::gcc_fenced_block()':
main.cpp:(.text._ZN5boost4asio6detail16gcc_fenced_blockC1Ev[boost::asio::detail::gcc_fenced_block::gcc_fenced_block()]+0x4c): undefined reference to `__sync_lock_test_and_set_4'

Since version 1.44 up to version 1.49, the linker error is gone and the program compiles fine. However, the program aborts at runtime upon executing “io.run()”, issuing an “Illegal instruction” error message. My assumption is that whatever “_sync_lock_test_and_set_4” was replaced by in version 1.44 represents an illegal operation on my target system.

The target system is a MOXA UC-8410 embedded ARM computer:

Linux Moxa 2.6.23.1 #1044 Fri May 6 10:25:20 CST 2011 armv5teb GNU/Linux
arm-linux-g++ (GCC) 4.2.1

Attachments (1)

test-program.cpp (3.0 KB ) - added by Pascal Kesseli <pascal.kesseli@…> 10 years ago.
Test program with trivial async_read use case.

Download all attachments as: .zip

Change History (2)

by Pascal Kesseli <pascal.kesseli@…>, 10 years ago

Attachment: test-program.cpp added

Test program with trivial async_read use case.

comment:1 by Pascal Kesseli <pascal.kesseli@…>, 10 years ago

Additional note: The program was compiled with the following command:

xscale-linux-g++ -fPIC -DBOOST_ASIO_DISABLE_EPOLL -I/var/lib/c++/boost/boost_1_43_0/target/arm-linux-4.2.1/include -oasync main.cpp -L/var/lib/c++/boost/boost_1_43_0/target/arm-linux-4.2.1/lib/static -pthread -lboost_system -lboost_thread
Note: See TracTickets for help on using tickets.