POV-Ray : Newsgroups : povray.bugreports : Parse error: Uncategorized error thrown at parser/parsertypes.cpp line 62 : Re: Parseerror:Uncategorizederrorthrownatparser/parsertypes.cppline62 Server Time
17 Apr 2024 20:19:36 EDT (-0400)
  Re: Parseerror:Uncategorizederrorthrownatparser/parsertypes.cppline62  
From: William F Pokorny
Date: 29 Mar 2019 10:31:49
Message: <5c9e2c55$1@news.povray.org>
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"
> 
> works. 
...
> 

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 :

#ifndef POV_PARSER_DEBUG
     #define POV_PARSER_DEBUG POV_DEBUG
#endif

...

#if POV_PARSER_DEBUG
     #define POV_PARSER_ASSERT(expr) POV_ASSERT_HARD(expr)
#else
     #define POV_PARSER_ASSERT(expr) POV_ASSERT_SOFT(expr)
                                  // POV_ASSERT_DISABLE(expr)
#endif

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
     at parser/parser_tokenizer.cpp:964
#6  0x000055a82da44dcd in pov_parser::Parser::Get_Token
     at parser/parser_tokenizer.cpp:289
#7  0x000055a82da05cf7 in pov_parser::Parser::Parse_Frame
     at parser/parser.cpp:6559
#8  0x000055a82da06591 in pov_parser::Parser::Run
     at parser/parser.cpp:242
#9  0x000055a82d9cb3ef in pov::ParserTask::Run
     at backend/control/parsertask.cpp:81
...

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.

Bill P.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.