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

Can't find custom attr constructor image: NLog.dll mtoken: 0x0a000331 (on ARM) #905

Closed
genemars opened this issue Sep 12, 2015 · 13 comments
Closed

Comments

@genemars
Copy link

Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
Can't find custom attr constructor image: /usr/local/bin/homegenie/NLog.dll mtoken: 0x0a000331
* Assertion at loader.c:1153, condition `!mono_loader_get_last_error ()' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.MonoCustomAttrs.IsDefinedInternal (System.Reflection.ICustomAttributeProvider,System.Type) <0xffffffff>
  at System.MonoCustomAttrs.IsDefined (System.Reflection.ICustomAttributeProvider,System.Type,bool) <0x00067>
  at System.MonoType.IsDefined (System.Type,bool) <0x00023>
  at NLog.Config.MethodFactory`2.RegisterType (System.Type,string) <0x00037>
  at NLog.Config.MethodFactory`2.ScanTypes (System.Type[],string) <0x00083>
  at NLog.Config.ConfigurationItemFactory.RegisterItemsFromAssembly (System.Reflection.Assembly,string) <0x0018f>
  at NLog.Config.ConfigurationItemFactory.RegisterItemsFromAssembly (System.Reflection.Assembly) <0x00027>
  at NLog.Config.ConfigurationItemFactory..ctor (System.Reflection.Assembly[]) <0x0034f>
  at NLog.Config.ConfigurationItemFactory.BuildDefaultFactory () <0x0009f>
  at NLog.Config.ConfigurationItemFactory..cctor () <0x0000b>
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at NLog.Config.XmlLoggingConfiguration..ctor (string) <0x0001f>
  at NLog.LogFactory.LoadLoggingConfiguration (string) <0x0006b>
  at NLog.LogFactory.get_Configuration () <0x0012b>
  at NLog.LogFactory.GetLogger (NLog.LogFactory/LoggerCacheKey) <0x003a3>
  at NLog.LogFactory.GetLogger (string) <0x0003f>
  at NLog.LogManager.GetCurrentClassLogger () <0x0002f>
  at MIG.MigService..cctor () <0x0000b>
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at HomeGenie.Service.HomeGenieService.InitializeSystem () <0x00153>
  at HomeGenie.Service.HomeGenieService..ctor () <0x00153>
  at HomeGenie.Program.Main (string[]) <0x00133>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:


Debug info from gdb:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0xb6b93440 (LWP 5906)]
0xb6f14aac in waitpid () from /lib/arm-linux-gnueabihf/libpthread.so.0
  Id   Target Id         Frame
  2    Thread 0xb6b93440 (LWP 5906) "Finalizer" 0xb6f12770 in sem_wait@@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0
* 1    Thread 0xb6fe5000 (LWP 5905) "mono" 0xb6f14aac in waitpid () from /lib/arm-linux-gnueabihf/libpthread.so.0

Thread 2 (Thread 0xb6b93440 (LWP 5906)):
#0  0xb6f12770 in sem_wait@@GLIBC_2.4 () from /lib/arm-linux-gnueabihf/libpthread.so.0
#1  0x001619e4 in mono_sem_wait ()
#2  0x0010ee0a in ?? ()
#3  0x0010ee0a in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0xb6fe5000 (LWP 5905)):
#0  0xb6f14aac in waitpid () from /lib/arm-linux-gnueabihf/libpthread.so.0
#1  0x00088020 in ?? ()
#2  0x00088020 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

Exit code: 134
@304NotModified
Copy link
Member

Nice error

Can you give some info?

@genemars
Copy link
Author

sure, what kind of info do you need?

@genemars
Copy link
Author

The problem seems to be around the Type.IsDefined:
https://github.com/NLog/NLog/blob/master/src/NLog/Config/MethodFactory.cs#L100

@genemars
Copy link
Author

the hosting platform is a BananaPi with raspbian os (debian derivative):

Linux lemaker 3.4.90 #2 SMP PREEMPT Tue Aug 5 14:11:40 CST 2014 armv7l GNU/Linux
Mono JIT compiler version 4.0.4 (Stable 4.0.4.1/5ab4c0d Tue Aug 25 23:45:14 UTC 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       normal
    Notifications: epoll
    Architecture:  armel,vfp+hard
    Disabled:      none
    Misc:          softdebug 
    LLVM:          supported, not enabled.
    GC:            sgen

@304NotModified
Copy link
Member

Which NLog version is this? Did it work with other versions before?

It mono I see? Do you use the tge nuget package?

@genemars
Copy link
Author

I tried nuget package 4.1, 4.0, also build from latest source. All of them same issue.
But I suspect this is a mono-arm bug, because everything is running fine on my ubuntu x64 pc.
If I delete the NLog.config file, the problem disappear and the application starts (without logging infos though).

@304NotModified 304NotModified added the bug Bug report / Bug fix label Sep 12, 2015
@304NotModified
Copy link
Member

Yes, I never have seen this issue before. Is it an other mono version?

@genemars
Copy link
Author

mono is the same, just running on different architecture:
Architecture: armel,vfp+hard
that are kind of SOCs used in mobile phones and little pc like Raspberry Pi.

@genemars
Copy link
Author

this is what I have in the config file:

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <targets>
        <target name="debugger" xsi:type="Console" layout="${longdate} ${level} ${message}"/>
  </targets>

  <rules>
    <logger name="*" minlevel="Trace" writeTo="debugger" />
  </rules>
</nlog>

@304NotModified
Copy link
Member

Can you also provide an internal log (DEBUG)?

It's a bit strange as RegisterType in ScanTypes is wrapped with a try catch. Our is this not the full config?

@304NotModified
Copy link
Member

and please test with NLog 4.1.1, which logs some more stuff :)

@genemars
Copy link
Author

NLog was not starting at all, but MONO_LOG_LEVEL=debug suggested that there was a missing dependency, so I solved the issue by installing it:

sudo apt-get install libmono-system-servicemodel4.0a-cil

@304NotModified
Copy link
Member

Good to hear it's solved!

I can see in the stacktrace that's was already logging to the internal logger. So if someone has a similar issue, check https://github.com/NLog/NLog/wiki/Logging-troubleshooting#internal-logging

@304NotModified 304NotModified added invalid and removed bug Bug report / Bug fix labels Sep 13, 2015
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