sol icon indicating copy to clipboard operation
sol copied to clipboard

assert if name demangling fails

Open PeterHajdu opened this issue 11 years ago • 5 comments

I'm not sure if this is the best way to handle demangling failure, but it should save a few minutes of debugging. Is there a graceful solution?

PeterHajdu avatar Oct 30 '14 15:10 PeterHajdu

Curiously enough, has the demangling ever actually failed? Not that this will affect if this should be accepted or not, I'm just genuinely curious (e.g. under which conditions would this happen. Maybe no RTTI or something?).

ThePhD avatar Oct 30 '14 16:10 ThePhD

Unfortunately it did, and I even had rtti. To be honest, it was some time before and I do not remember the actual case, but I'll try to reproduce it.

PeterHajdu avatar Oct 30 '14 16:10 PeterHajdu

namespace
{

class a
{
  public:
    a()
    {
      sol::state lua;
      lua.set_function( "foo", [ this ]() {} );
      lua.script( "foo()" );
    }
};

}

This segfaults when I instantiate a. I think it works even without the unnamed namespace the key is the captured "this".

FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 Target: x86_64-unknown-freebsd10.0 Thread model: posix

PeterHajdu avatar Oct 30 '14 16:10 PeterHajdu

Sorry to bother you, I don't want to be pushy. Did you manage to reproduce the crash? Or did I misunderstand something? Please correct me if I made a mistake here. I'm just as much curious as you are :)

PeterHajdu avatar Nov 03 '14 15:11 PeterHajdu

I failed to reproduce the crash. That is, it works for me with gcc 4.8 and 4.9. Have yet to try clang.

ThePhD avatar Nov 03 '14 15:11 ThePhD