Opened 11 years ago

Closed 11 years ago

Last modified 6 years ago

#6737 closed Bugs (fixed)

static boost::filesystem::path crashes with Debug mode

Reported by: Emrah Ustun <emrahustun@…> Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.49.0 Severity: Showstopper
Keywords: Cc: raad@…

Description

static boost::filesystem::path FilePath = "FilePath";

When filesystem::path is used with static, application crashes on runtime. Release mode works correct. Using VS2010. Boost compiled with debug, static, multithread.

It crashes with codecvt to wstring on xlocale.

Change History (9)

comment:1 by Beman Dawes, 11 years ago

Status: newassigned

The problem also seems to involve other some uses of filesystem with static builds. As a first step to solving the problem, I'll expand testing to cover both your specific example and static builds in general.

Thanks,

--Beman

comment:2 by mjklaim@…, 11 years ago

I have apparently the same problem using this line:

const bfs::path	AOSL_XSD_FILE			= bfs::current_path() / "aosl.xsd";

With bfs namespace being boost::filesystem namespace.

Full source is available there: http://code.google.com/p/art-of-sequence/source/browse/tools/aosdesigner/Paths.cpp?r=d51b374de600ecc4f8829b5aeb9cfdcd50335096

Also, is it normal behavior that current_path() returns and empty string? Not sure if it's related.

in reply to:  2 comment:3 by mjklaim@…, 11 years ago

Replying to mjklaim@…:

Actually, in my case the same problem occurs in Debug and Release mode too, using VS2010, with static/multithreaded boost libraries.

in reply to:  2 comment:4 by mjklaim@…, 11 years ago

Replying to mjklaim@…:

In fact my problem is better described by #6690 . I'm trying to hunt why the codecvt() function returns a null object.

comment:5 by Beman Dawes, 11 years ago

I'm working this issue today. Plan is to (1) revert 76303 and verify that fixes the initialization problems, and then (2) work on fixes to #4889, #6320, codecvt_facet not thread safe on Windows, which will be reintroduced when 76303 is reverted.

--Beman

comment:6 by Beman Dawes, 11 years ago

Resolution: fixed
Status: assignedclosed

(In [78000]) Fix #6690 and #6737, resolving static linking related problems with VC++ 8 through 11. Note that this fix may reintroduce codecvt thread safety problems #4889, #6320, for these compilers if static linking is used.

comment:7 by erik.l.nelson@…, 10 years ago

I'm running into this... will this make it into 1.50? Is the thread safety problem (#4889, #6320) re-fixed in 1.50?

comment:8 by henry@…, 10 years ago

I am using 1.50 and vs2010 and am still seeing this problem. I may need to pull boost out of my project if I can't get past this very soon

comment:9 by raad@…, 6 years ago

Cc: raad@… added
Note: See TracTickets for help on using tickets.