Opened 10 years ago

Last modified 10 years ago

#7564 new Bugs

filesystem::path passed to GTest's assertion leads to stack overflow

Reported by: oliora@… Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.51.0 Severity: Problem
Keywords: filesystem gtest path stack_overflow Cc: oliora@…

Description

The following code:

boost::filesystem::path p1("c:\\123"), p2("c:\\987");

ASSERT_EQ(p1, p2);

leads to stack overflow. It's because when GTest prints the assertion values it examines path as a container and try to print its items which are also path instances. This leads to recursion and stack overflow.

Most probably, the problem should be solved at Gtest side, but personal I think the design when path consist of paths (infinite recursion) is not very good and should be fixed.

Change History (2)

comment:1 by oliora@…, 10 years ago

Keywords: stack_overflow added; "stack overflow" removed

comment:2 by Craig Dickson <cdickson@…>, 10 years ago

The elements of a path should not be paths. They should be strings.

Note: See TracTickets for help on using tickets.