Re: [Cppcms-users] Advice on debugging file upload
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-04-23 12:36:47
|
The backtrace support requires some API in the standard C library. Linux, Mac OS X, Solaris: Getting trace: execinfo.h + backtrace() Getting symbols: dladdr Windows: Getting trace: RtlCaptureStackBackTrace Getting symbols: SymFromAddr (MSVC Only) Unfortunately FreeBSD does not provide such API, so it is not possible to create safe backtrace - the existing execinfo.h library that comes with FreeBSD is not safe when using with "omit-frame-pointer" optimization. If you find any other suitable way to create a backtrace (at least backtrace - not backtrace_symbols) it would be possible to provide stack tracing for FreeBSD as well. For example, backtrace would not work on Linux with uclibc as well and it is not possible to print symbols using Windows+GCC. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ ----- Original Message ----- > From: "ele...@ex..." <ele...@ex...> > To: Artyom Beilis <art...@ya...>; cpp...@li... > Cc: > Sent: Monday, April 23, 2012 3:20 PM > Subject: Re: [Cppcms-users] Advice on debugging file upload > > I've been following this discussion and I ran the same test on FreeBSD 8 > and it only prints "My Error", but no trace. > > Petr > >>> ~/src/cppcms-1.0.1/mybuild$ ./a.out >>> My Error >>> 0x107963102: booster::backtrace::backtrace(unsigned long) + 0x76 in >>> /Users/douglivesey/src/cppcms-1.0.1/mybuild/./a.out >>> 0x1079632c9: booster::runtime_error::runtime_error(std::string > const&) + >>> 0x39 in /Users/douglivesey/src/cppcms-1.0.1/mybuild/./a.out >>> 0x107962eda: foo() + 0x4a in >>> /Users/douglivesey/src/cppcms-1.0.1/mybuild/./a.out >>> 0x107962f4a: bar() + 0x9 in >>> /Users/douglivesey/src/cppcms-1.0.1/mybuild/./a.out >>> 0x107962f5d: main + 0xe in >>> /Users/douglivesey/src/cppcms-1.0.1/mybuild/./a.out >>> 0x107962e88: start + 0x34 in >>> /Users/douglivesey/src/cppcms-1.0.1/mybuild/./a.out >> >> >> Ok, the stack backtrace works on Mac OS X. >> >> >> If so you should probably see where exactly the exception comes from in >> the >> log - including cppcms::widgers::file::value() in the stack trace. >> >> Use it, it is very powerful tool. >> >> (Don't forget -dynamic options) >> >> Artyom >> >> >> > ------------------------------------------------------------------------------ >> For Developers, A Lot Can Happen In A Second. >> Boundary is the first to Know...and Tell You. >> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! >> http://p.sf.net/sfu/Boundary-d2dvs2 >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > > > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |