Opened 7 years ago

Closed 6 years ago

Last modified 2 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@…


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 Changed 7 years ago by Beman Dawes

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.



comment:2 Changed 6 years ago by mjklaim@…

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:

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

comment:3 in reply to:  2 Changed 6 years ago by mjklaim@…

Replying to mjklaim@…:

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

comment:4 in reply to:  2 Changed 6 years ago by mjklaim@…

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 Changed 6 years ago by Beman Dawes

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.


comment:6 Changed 6 years ago by Beman Dawes

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 Changed 6 years ago by erik.l.nelson@…

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 Changed 6 years ago by henry@…

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 Changed 2 years ago by raad@…

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