On 3/28/19 6:49 AM, William F Pokorny wrote:
> On 3/26/19 8:10 AM, clipka wrote:
> Second, on enabling the POV_ASSERT source code mechanism, took the time
> to do some full compiles with a known fail assert of 1 == 0 and the
> short of it for *nix is doing something like:
> ./configure COMPILED_BY="wfp__POV_DEBUG" CXXFLAGS="-DPOV_DEBUG"
With the thought I might help others doing debug by rambling more about
my ignorance/learning while attempting to debug this issue...
Woke up this morning remembering seeing a core file when I did my
POV_ASSERT(1 == 0) test with a compile where POV_DEBUG was really
defined. This got me wondering why I didn't get a core file with initial
failing code here given an assert ran and I did a debug compile. A core
file would have have made it easy to look at the call stack with gdb.
Well, looking at the source code this morning it's because we have this
set up today for the parser related asserts in ./parser/configparser.h :
#define POV_PARSER_DEBUG POV_DEBUG
#define POV_PARSER_ASSERT(expr) POV_ASSERT_HARD(expr)
#define POV_PARSER_ASSERT(expr) POV_ASSERT_SOFT(expr)
I wasn't previously getting POV_DEBUG set so I was getting a soft assert
which parse.cpp catches triggering a more graceful - but less
informative (no core file) - program exit. Trying my debug compile again
just now with POV_DEBUG set, I do get a core file and gdb gives me :
#4 0x000055a82da4b703 in pov_parser::LexemePosition::operator==
o=...) at parser/parsertypes.cpp:62
#5 0x000055a82da40420 in pov_parser::Parser::IsEndOfInvokedMacro
#6 0x000055a82da44dcd in pov_parser::Parser::Get_Token
#7 0x000055a82da05cf7 in pov_parser::Parser::Parse_Frame
#8 0x000055a82da06591 in pov_parser::Parser::Run
#9 0x000055a82d9cb3ef in pov::ParserTask::Run
Today, I'd find my way to IsEndOfInvokedMacro in less than an hour
instead of the full day it took me to trace top down - so to speak.
The lessons I learned: Get POV_DEBUG set in your compile while debugging
any issue. If still no core file generated and tangled in a POV-Ray code
assert, be sure you're getting a hard assert and not a soft one. I
didn't know we had 'soft' POV_ASSERT* version until today.
Post a reply to this message