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

Dlib matrix.h modmap error #13

Closed
wilsonk opened this issue Apr 24, 2015 · 2 comments
Closed

Dlib matrix.h modmap error #13

wilsonk opened this issue Apr 24, 2015 · 2 comments

Comments

@wilsonk
Copy link

wilsonk commented Apr 24, 2015

Hello Elie,

I am getting an error when trying to modmap dlib/matrix/matrix.h, which is one the main headers needed for much of Dlib. It appears as though returning the 'literal_assign_helper' struct value at line 1670 of matrix.h is the problem. If you need more information on the bug, please let me know.

Here is part of the backtrace:

    `-ReturnStmt 0xcc62760 <col:16>
      `-UnaryOperator 0xcc62740 <col:16> 'struct dlib::matrix<long, 2, 1, class dlib::memory_manager_stateless_kernel_1<char>, struct dlib::row_major_layout>::literal_assign_helper' lvalue prefix '*'
        `-CXXThisExpr 0xcc62728 <col:16> 'struct dlib::matrix<long, 2, 1, class dlib::memory_manager_stateless_kernel_1<char>, struct dlib::row_major_layout>::literal_assign_helper *' this
ldc2: /home/wilsonk/Downloads/Calypso/dmd2/template.c:4254: virtual void deduceType(RootObject*, Scope*, Type*, TemplateParameters*, Objects*, unsigned int*, size_t)::DeduceType::visit(TypeInstance*): Assertion `false && "Argument type should be semantic'd by now"' failed.
#0 0x3a4cf26 llvm::sys::PrintStackTrace(_IO_FILE*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x3a4cf26)
#1 0x3a4d1c1 PrintStackTraceSignalHandler(void*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x3a4d1c1)
#2 0x3a4bde3 SignalHandler(int) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x3a4bde3)
#3 0x7f040bca4340 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#4 0x7f040aa9fcc9 gsignal /build/buildd/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x7f040aaa30d8 abort /build/buildd/eglibc-2.19/stdlib/abort.c:91:0
#6 0x7f040aa98b86 __assert_fail_base /build/buildd/eglibc-2.19/assert/assert.c:92:0
#7 0x7f040aa98c32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)
#8 0x11a9deb (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11a9deb)
#9 0x1163834 TypeInstance::accept(Visitor*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x1163834)
#10 0x11abeee deduceType(RootObject*, Scope*, Type*, Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned long) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11abeee)
#11 0x11aa32e deduceType(RootObject*, Scope*, Type*, Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned long)::DeduceType::deduceBaseClassParameters(BaseClass*, Scope*, Type*, Array<TemplateParameter*>*, Array<RootObject*>*, Array<RootObject*>*, int&) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11aa32e)
#12 0x11aa67b deduceType(RootObject*, Scope*, Type*, Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned long)::DeduceType::visit(TypeClass*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11aa67b)
#13 0x1163960 TypeClass::accept(Visitor*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x1163960)
#14 0x11aa9ae deduceType(RootObject*, Scope*, Type*, Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned long)::DeduceType::visit(Expression*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11aa9ae)
#15 0x11ab14f deduceType(RootObject*, Scope*, Type*, Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned long)::DeduceType::visit(NullExp*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11ab14f)
#16 0x1230b9e NullExp::accept(Visitor*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x1230b9e)
#17 0x11abf40 deduceType(RootObject*, Scope*, Type*, Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned long) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11abf40)
#18 0x11a1859 TemplateDeclaration::deduceFunctionTemplateMatch(TemplateInstance*, Scope*, FuncDeclaration*&, Type*, Array<Expression*>*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11a1859)
#19 0x11a406b functionResolve(Match*, Dsymbol*, Loc, Scope*, Array<RootObject*>*, Type*, Array<Expression*>*)::ParamDeduce::fp(TemplateDeclaration*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11a406b)
#20 0x11a3040 functionResolve(Match*, Dsymbol*, Loc, Scope*, Array<RootObject*>*, Type*, Array<Expression*>*)::ParamDeduce::fp(void*, Dsymbol*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11a3040)
#21 0x11cbe66 overloadApply(Dsymbol*, void*, int (*)(void*, Dsymbol*)) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11cbe66)
#22 0x11a47ef functionResolve(Match*, Dsymbol*, Loc, Scope*, Array<RootObject*>*, Type*, Array<Expression*>*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11a47ef)
#23 0x11ccb0b resolveFuncCall(Loc, Scope*, Dsymbol*, Array<RootObject*>*, Type*, Array<Expression*>*, int) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x11ccb0b)
#24 0x121be85 hasIdentityOpAssign(AggregateDeclaration*, Scope*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x121be85)
#25 0x1199057 ClassDeclaration::semantic(Scope*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x1199057)
#26 0x1399b65 cpp::ClassDeclaration::semantic(Scope*) (/home/wilsonk/Downloads/Calypso/build/bin/ldc2+0x1399b65)

Thanks,
Kelly

@Syniurge
Copy link
Owner

I think DeduceType::deduceBaseClassParameters should be passing the TypeClass or TypeStruct of the base class/struct instead of the TypeInstance. To be tested when I get the time.

@wilsonk wilsonk mentioned this issue May 9, 2015
Syniurge added a commit that referenced this issue Nov 1, 2015
Do not create a TypeInstance in deduceBaseClassParameters, the deduction was made more robust for Calypso needs (should have been PR'd but Calypso is always lagging far behind DMD).
@Syniurge
Copy link
Owner

Syniurge commented Nov 7, 2015

While revisiting template arg deduction for the merge I fixed at least importing dlib.Matrix and dlib._, I didn't try to use it though.

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