Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2019 closed Bugs (fixed)

Intrusive lists seem to return invalid references with member hooks in 64 bit mode on calling front/back

Reported by: Nico Becherer <n.becherer@…> Owned by: Ion Gaztañaga
Milestone: Component: intrusive
Version: Boost 1.35.0 Severity: Showstopper
Keywords: crash, 64 bit, Cc:

Description

In our application we use intrusive lists with classes that contain multiple member hooks for insertion in variuos lists. The member_hooks are defined without any template options as are the boost::intrusive lists that are used.

Our code however, which runs great on 32 bit machines crashes on 64 bit windows vista (compiled by MSVC 2005) when calling front () or back () on an intrusive list. The problem seems to be caused by ...

inline std::size_t offset_from_pointer_to_member(const Member Parent::* ptr_to_member)

... in parent_from_member.hpp, where the parameter ptr_to_member is unitialized in the upper 32bit fields. There is a static assertion at the top of the function (BOOST_STATIC_ASSERT(( sizeof(std::ptrdiff_t) == sizeof(ptr_to_member) ));) wich is disabled but throws an error in 64 bit if enabled.

Change History (3)

comment:1 by Nico Becherer <n.becherer@…>, 14 years ago

Add: The code runs fine under 64 bit, when instead of the BOOST_MSVC implementation of offset_from_pointer_to_member, the GNUC implementation (2nd definen branch) is used.

comment:2 by Ion Gaztañaga, 14 years ago

Resolution: fixed
Status: newclosed

Fixed in trunk SVN, revision 46514.

comment:3 by (none), 14 years ago

Milestone: Boost 1.35.1

Milestone Boost 1.35.1 deleted

Note: See TracTickets for help on using tickets.