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

Fix libc++abi.dylib: Pure virtual function called! #685

Merged
merged 3 commits into from
Apr 2, 2020

Conversation

dgmzc
Copy link
Contributor

@dgmzc dgmzc commented Mar 10, 2020

On MacOS, we may end up with the following runtime error.
OpenEXR/dwaLookups.h
libc++abi.dylib: Pure virtual function called!

Fix dwaLookup generation which is due to calling the base function from constructor which calls the pure virtual method only, which does not do anything. output file ended up not being generated.

see similar Stackoverflow issue: https://stackoverflow.com/questions/14549489/how-to-fix-pure-virtual-function-called-runtime-error

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 10, 2020

CLA Check
The committers are authorized under a signed CLA.

@kdt3rd
Copy link
Contributor

kdt3rd commented Mar 10, 2020

Strange, this should be (mostly) defined behavior, in that if you have class A with a virtual function foo, and class B derived from A which overrides that, you should be able to call foo from B's constructor and have that treated as if it is a B and call that (B::foo). Which in this particular scenario should be correct. That being said, it is ... dangerous ... in that if you then have a class C which is a subclass of B, and also overrides foo, then the call to foo in B's constructor will still only ever call B's version of the function.

I wonder if the reason Apple clang fails to call B::foo on that is due to something to do with the final keyword implementation (which we don't have in this situation), such that it doesn't know it's the last virtual function, so it ends up in the wrong call.

Either way, thanks for digging into this.

@dgmzc
Copy link
Contributor Author

dgmzc commented Mar 10, 2020

@meshula
Copy link
Contributor

meshula commented Mar 10, 2020

I verified that MSVC as well can fail in the same way with a small test program.

@cary-ilm
Copy link
Member

Thanks for the fix here. Could we kindly ask you to add a signoff to the commit? The DCO check failed above because the commit is missing the "Signed-off-by" signature. The instructions are on the "Detail" link above, https://github.com/AcademySoftwareFoundation/openexr/pull/685/checks?check_run_id=497475513. Thanks.

Signed-off-by: Phyrexian <jarko.paska@gmail.com>
Signed-off-by: Dorian Gomez <dorian.gmz@hotmail.com>
On MacOS, we may end up with the following runtime error.
OpenEXR/dwaLookups.h
libc++abi.dylib: Pure virtual function called!

Fix dwaLookup generation which is due to calling the base function from constructor which calls the overriden method run, which causes the base class to call the pure virtual method only, which does not do anything. outfile ended up not being generated.

Signed-off-by: Dorian Gomez <dorian.gmz@hotmail.com>
@cary-ilm
Copy link
Member

cary-ilm commented Apr 2, 2020

@dgmzc, I'd like to merge this, but can you first add a line to the commit that reads:

Signed-off-by:

If you run "git commit -s", it will add the signoff automatically. Thanks.

@cary-ilm
Copy link
Member

cary-ilm commented Apr 2, 2020

Oops, my apologies, it's already there. Merging now.

@cary-ilm cary-ilm merged commit fa435e2 into AcademySoftwareFoundation:master Apr 2, 2020
@cary-ilm cary-ilm added this to the v2.5.0 milestone Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants