#1094 Assert in Module/emit.cxx

closed
go (2)
5
2010-06-16
2010-06-16
Evan Shaw
No

I'm hitting an assert using SWIG with Go, built from SVN r12131:

swig: Modules/emit.cxx:358: int emit_action_code(Node*, String*, String*): Assertion `DohGetattr(n, "wrap:name")' failed.
Aborted

Here's the backtrace I get in GDB:
#0 0x00007ffff710d515 in raise () from /lib/libc.so.6
#1 0x00007ffff710e996 in abort () from /lib/libc.so.6
#2 0x00007ffff71060f5 in __assert_fail () from /lib/libc.so.6
#3 0x000000000043e9c9 in emit_action_code (n=0x7ffff7f78c30, wrappercode=0x7ffff7f86c10, eaction=0x7ffff7f86e50)
at Modules/emit.cxx:358
#4 0x000000000043ed43 in emit_action (n=0x7ffff7f78c30) at Modules/emit.cxx:510
#5 0x000000000043f9f1 in GO::emitGoAction (this=0x73ead0, n=0x7ffff7f78c30, base=0x7ffff7f84590, parms=0x0,
result=0x7ffff7f864d0, f=0x84b240) at Modules/go.cxx:1409
#6 0x0000000000441d56 in GO::gccFunctionWrapper (this=<value optimized out>, n=0x7ffff7f78c30, base=0x7ffff7f84590,
wname=<value optimized out>, parms=0x0, result=0x7ffff7f864d0) at Modules/go.cxx:1221
#7 0x00000000004494cd in GO::makeWrappers (this=0x73ead0, method_class=<value optimized out>, bases=0x7ffff7f84590,
method=0x7ffff7f78c30) at Modules/go.cxx:717
#8 GO::goBaseMethod (this=0x73ead0, method_class=<value optimized out>, bases=0x7ffff7f84590, method=0x7ffff7f78c30)
at Modules/go.cxx:2050
#9 0x000000000044d40a in GO::addBase (this=0x73ead0, n=0x7ffff7f79110, base=0x7ffff7f788b0, bases=0x7ffff7f84590,
local=0x7ffff7f85950) at Modules/go.cxx:1949
#10 0x000000000044daf6 in GO::classHandler (this=0x73ead0, n=0x7ffff7f79110) at Modules/go.cxx:1854
#11 0x000000000046a621 in Language::classDeclaration (this=0x73ead0, n=0x7ffff7f79110) at Modules/lang.cxx:2409
#12 0x0000000000468ef2 in Dispatcher::emit_one (this=0x73ead0, n=0x7ffff7f79110) at Modules/lang.cxx:129
#13 0x0000000000469194 in Language::emit_one (this=0x73ead0, n=0x7ffff7f79110) at Modules/lang.cxx:377
#14 0x0000000000468abd in Dispatcher::emit_children (this=0x73ead0, n=<value optimized out>) at Modules/lang.cxx:212
#15 0x0000000000464b6a in Language::includeDirective (this=<value optimized out>, n=<value optimized out>)
at Modules/lang.cxx:619
#16 0x00000000004690db in Dispatcher::emit_one (this=0x73ead0, n=0x7ffff7f78730) at Modules/lang.cxx:165
#17 0x0000000000469194 in Language::emit_one (this=0x73ead0, n=0x7ffff7f78730) at Modules/lang.cxx:377
#18 0x0000000000468abd in Dispatcher::emit_children (this=0x73ead0, n=<value optimized out>) at Modules/lang.cxx:212
#19 0x0000000000442f42 in GO::top (this=0x73ead0, n=0x7ffff7f4d650) at Modules/go.cxx:395
#20 0x00000000004711f6 in SWIG_main (argc=<value optimized out>, argv=<value optimized out>, l=<value optimized out>)
at Modules/main.cxx:1237
#21 0x00000000004c5d12 in main (margc=<value optimized out>, margv=<value optimized out>) at Modules/swigmain.cxx:206

Here's what I've come up with for the minimum reproduction case:

test.h:
class Base {
public:
static void Func();
};

test.i:
%module test

%import "test.h"

%inline %{
class Child : public Base {};
%}

Discussion

  • Ian Lance Taylor

    • status: open --> closed
     
  • Ian Lance Taylor

    Thanks for the bug report. I committed a patch which fixes this test case. Revision 12132.

     

Log in to post a comment.