Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in windows, when string flag longer then default value. #60

Open
GoogleCodeExporter opened this issue Mar 13, 2015 · 8 comments
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Define flag as: DEFINE_string(LogPath, "..\\..\\..\\logs", "The path to save 
log files.");
2. Run as: <program_name>.exe --LogPath="..\\..\\..\\logs\\1"
3. Program crashed at gflags.cc:441 void FlagValue::CopyFrom(const FlagValue& x)

What is the expected output? What do you see instead?
No crash

What version of the product are you using? On what operating system?
gflags 2.0, VS 2008

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 1 Nov 2012 at 1:53

@GoogleCodeExporter
Copy link
Author

In new test, program crashed even the string length is 1.
crash reason is x.value_buffer_ can not cast to string.
How to fix it?

Original comment by [email protected] on 1 Nov 2012 at 2:17

@GoogleCodeExporter
Copy link
Author

I created an empty project, just defined some flags.
It works fine.

Original comment by [email protected] on 1 Nov 2012 at 2:37

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

glog can not used with gflags?

Original comment by [email protected] on 1 Nov 2012 at 3:19

@GoogleCodeExporter
Copy link
Author

Debug version is fine, Release version crash always.
Linux is OK?

Original comment by [email protected] on 1 Nov 2012 at 4:01

@GoogleCodeExporter
Copy link
Author

I had such crash while using DEFINE_string. 
The crash was caused by linking libgflags-debug.lib while building Release 
version.
After changing to libgflags.lib the crash disappeared.


Original comment by [email protected] on 31 Oct 2013 at 6:11

@GoogleCodeExporter
Copy link
Author

I presume yuri is right and the problem was simply linking incompatible 
binaries. Before the v2.2 release, I will make sure to add unit tests for this 
scenario.

Original comment by [email protected] on 20 Mar 2014 at 3:46

  • Added labels: Milestone-v2.2

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 20 Mar 2014 at 4:03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant