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

Python exception during dump of boost::optional (no member named m_initialized) #43

Open
fperies opened this issue May 5, 2020 · 5 comments
Assignees

Comments

@fperies
Copy link

fperies commented May 5, 2020

Hello,

First of all, thank you for this project!

I'm running into the following error when trying to dump a boost::optional type object:

(gdb) p 'l2ps::db::UeDbBase<l2ps::ul::db::Ue>::ueDbInstance'
$17 = Python Exception <class 'gdb.error'> There is no member named m_initialized.: 

I'm using Boost 1.69.0

Do you have any clue that would explain this issue ?

Thanks !

@mbalabin mbalabin self-assigned this May 8, 2020
@mbalabin
Copy link
Collaborator

mbalabin commented May 8, 2020

Hi, could you please give more details about your case? What is ueDbInstance? Ideally, a minumal test case - it will help greatly.

@mbalabin
Copy link
Collaborator

mbalabin commented May 8, 2020

Also, what build type (release, debug, etc) and compiler do you use?

@fperies
Copy link
Author

fperies commented May 11, 2020

Hello,

ueDbInstance is declared as follows:

template <typename Ue>
class UeDbBase : 
{
   ...
   static boost::optional<l2ps::utils::SharedObject<UeDbBase<Ue>>> ueDbInstance;
   ...
}

SharedObject is basically a class which allocates/deallocates in shared memory (this implementation is plateform specific)

I'm using a debug build with GCC, compilation options are -ggdb3, -O0.

At the stage where I asked to print ueDbInstance, it is supposed to be initialized.

Have you validated the Boost pretty printer when static attribute is set ?

Thanks

@mbalabin
Copy link
Collaborator

mbalabin commented May 11, 2020

Compilation options are pretty standard. I never tried -ggdb3, though, only -ggdb (which is equivalent to -ggdb2). You can try to switch to -ggdb, but it is unlikely that it can fix the problem.

Static members should not be a problem. Is SharedObject a complete type in this translation unit?

Can you print ueDbInstance with printers disabled and post result here? Preferably with set print pretty to make gdb output more readable.

@mbalabin
Copy link
Collaborator

@fperies Is this issue still relevant?

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

No branches or pull requests

2 participants