Modify

Ticket #2575 (closed Patches: fixed)

Opened 5 years ago

Last modified 23 months ago

Bug- Boost 1.36.0 on Itanium platform

Reported by: asonawane@… Owned by: viboes
Milestone: Boost 1.50.0 Component: thread
Version: Boost 1.36.0 Severity: Problem
Keywords: interlocked Cc: viboes

Description

Environment: WinXP SP2/Visual Studio Team System 2005/Itanium cross compiler tools

1 . Generate boost libs using Itanium cross compiler command prompt with these options bjam -a --build-type=complete --toolset=msvc >architecture=ia64 --stagedir=Winia64 stage

  1. Compiling under Itanium configuration in VS2005 generates several linker errors:

error LNK2019: unresolved external symbol ._interlockedbittestandset referenced in function "[Entry] bool cdecl >boost::detail::win32::interlocked_bit_test_and_set(long *,long)" (.?interlocked_bit_test_and_set@win32@detail@boost@@YA_NPEAJJ@Z)

error LNK2001: unresolved external symbol ._interlockedbittestandset

libboost_thread-vc80-mt-1_36.lib(thread.obj) : error LNK2001: unresolved external symbol ._interlockedbittestandset

3.The projects compile fine under x86 and x64. _interlockbittestandset is not intrinsic on Itanium platform

This sounds like an issue with Boost code itself. Your might want to either post to boost-devel, or file a bug at svn.boost.org

  • Volodya

Attachments

thread_primitives.hpp Download (13.2 KB) - added by asonawane@… 2 years ago.
itanium patch
2575.patch Download (910 bytes) - added by viboes 2 years ago.
patch respect to trunk

Change History

comment:1 Changed 5 years ago by marshall

  • Owner set to johnmaddock
  • Component changed from None to thread

John - can you take a look at this, since you've got the compiler?

The calls (and fns) are: boost/thread/win32/basic_timed_mutex.hpp: return !win32::interlocked_bit_test_and_set(&active_count,lock_flag_bit); boost/thread/win32/basic_timed_mutex.hpp: if(!win32::interlocked_bit_test_and_set(&active_count,lock_flag_bit)) boost/thread/win32/basic_timed_mutex.hpp: if(!win32::interlocked_bit_test_and_set(&active_count,event_set_flag_bit))

boost/thread/win32/thread_primitives.hpp: inline bool interlocked_bit_test_and_set(long* x,long bit) boost/thread/win32/thread_primitives.hpp: inline bool interlocked_bit_test_and_set(long* x,long bit) boost/thread/win32/thread_primitives.hpp: inline bool interlocked_bit_test_and_set(long* x,long bit)

comment:2 Changed 5 years ago by johnmaddock

  • Owner changed from johnmaddock to marshall

I don't have access to the itanium compiler but looking at the docs and the headers:

  • _interlockedbittestandset is a compiler intrinsic *only* available on x86 and x86_64 architechtures, it should *not* be used on any other architechture.
  • I can't see a similar IA64 intrinsic (but could easily have missed it).
  • The function:

BOOLEAN WINAPI InterlockedBitTestAndSet?(

in LONG volatile *Base, in LONG Bit

);

Appears to be universally available and offers the same functionality (in fact it just calls _interlockedbittestandset on x86 platforms).

HTH, John.

comment:3 Changed 5 years ago by marshall

  • Owner changed from marshall to anthonyw

comment:4 Changed 2 years ago by viboes

  • Cc viboes added
  • Owner changed from anthonyw to viboes
  • Status changed from new to assigned
  • Milestone changed from Boost 1.38.0 to To Be Determined

comment:5 Changed 2 years ago by viboes

After making the suggested replacement, I get this error when linking

msvc.link ..\..\..\bin.v2\libs\thread\test\test_thread.test\msvc-10.0\debug\threading-multi\test_thread.exe
test_thread.obj : error LNK2019: unresolved external symbol _InterlockedBitTestAndSet referenced in function "bool __cdecl boost::detail::win32::interlocked_bit_test_and_set(long *,long)" (?interlocked_bit_test_and_set@win32@detail@boost@@YA_NPAJJ@Z)
..\..\..\bin.v2\libs\thread\test\test_thread.test\msvc-10.0\debug\threading-multi\test_thread.exe : fatal error LNK1120: 1 unresolved externals

From which version is this primitive available?

comment:6 Changed 2 years ago by viboes

  • Keywords interlocked added

comment:7 follow-up: ↓ 9 Changed 2 years ago by viboes

  • Type changed from Bugs to Support Requests

Moved to support request until availability clarified.

Changed 2 years ago by asonawane@…

itanium patch

comment:8 Changed 2 years ago by anonymous

I think it's been available on almost all Win32 versions since forever, a trivial program with just:

#include <windows.h>
int main()
{
   LONG i = 132;

   InterlockedBitTestAndSet(&i, 1);
}

compiles and links just fine for me on Vista with VC10.

Are you including windows.h or defining the prototype for InterlockedBitTestAndSet? yourself?

comment:9 in reply to: ↑ 7 Changed 2 years ago by anonymous

Replying to viboes:

Moved to support request until availability clarified.

Use the attached update (thread_primitives.hpp) replace and compile. Works with boost version 1.39.0 and MS-VS 2005. Later versions of boost not tested.

Changed 2 years ago by viboes

patch respect to trunk

comment:10 Changed 2 years ago by viboes

  • Type changed from Support Requests to Patches

comment:11 Changed 2 years ago by viboes

  • Milestone changed from To Be Determined to Boost 1.49.0

comment:12 Changed 2 years ago by viboes

Committed in trunk at revision [76543].

comment:13 Changed 23 months ago by viboes

  • Status changed from assigned to closed
  • Resolution set to fixed
  • Milestone changed from Boost 1.49.0 to Boost 1.50.0

Committed in release branch at [78543]

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.