linker crash (ld returned 5 exit status)

kneko715
Posts: 9
Joined: Fri Dec 17, 2021 12:43 pm

linker crash (ld returned 5 exit status)

Postby kneko715 » Mon Apr 04, 2022 6:13 am

ESP-IDF : v4.4 (commit 8153bfe4125e6a608abccf1561fd10285016c90a)
Target : esp32s3
Build OS : Windows 10 pro 64bit

In my build, ld exit with error and start Werfault.exe(Windows Error Reporting).
Error message is only "collect2.exe: error: ld returned 5 exit status".

The following is the analyzation of the crash dump which Werfault.exe dumped.
How to fix this issue?

Thank you.
  1. Microsoft (R) Windows Debugger Version 10.0.22549.1000 AMD64
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3.  
  4.  
  5. Loading Dump File [C:\CrashDumps\ld.exe.33680.dmp]
  6. User Mini Dump File with Full Memory: Only application data is available
  7.  
  8. Symbol search path is: srv*
  9. Executable search path is:
  10. Windows 10 Version 19043 MP (4 procs) Free x64
  11. Product: WinNt, suite: SingleUserTS
  12. Edition build lab: 19041.1.amd64fre.vb_release.191206-1406
  13. Machine Name:
  14. Debug session time: Mon Apr  4 14:20:25.000 2022 (UTC + 9:00)
  15. System Uptime: 6 days 6:23:35.554
  16. Process Uptime: 0 days 0:00:08.000
  17. ............
  18. This dump file has an exception of interest stored in it.
  19. The stored exception information can be accessed via .ecxr.
  20. (8390.7dc0): Access violation - code c0000005 (first/second chance not available)
  21. For analysis of this file, run !analyze -v
  22. ntdll!NtWaitForMultipleObjects+0x14:
  23. 00007ffc`9186d8c4 c3              ret
  24. 0:000> !analyze -v
  25. *******************************************************************************
  26. *                                                                             *
  27. *                        Exception Analysis                                   *
  28. *                                                                             *
  29. *******************************************************************************
  30.  
  31.  
  32. KEY_VALUES_STRING: 1
  33.  
  34.     Key  : AV.Dereference
  35.     Value: NullClassPtr
  36.  
  37.     Key  : AV.Fault
  38.     Value: Read
  39.  
  40.     Key  : Analysis.CPU.mSec
  41.     Value: 1093
  42.  
  43.     Key  : Analysis.DebugAnalysisManager
  44.     Value: Create
  45.  
  46.     Key  : Analysis.Elapsed.mSec
  47.     Value: 6661
  48.  
  49.     Key  : Analysis.Init.CPU.mSec
  50.     Value: 1124
  51.  
  52.     Key  : Analysis.Init.Elapsed.mSec
  53.     Value: 33792
  54.  
  55.     Key  : Analysis.Memory.CommitPeak.Mb
  56.     Value: 78
  57.  
  58.     Key  : Timeline.OS.Boot.DeltaSec
  59.     Value: 541415
  60.  
  61.     Key  : Timeline.Process.Start.DeltaSec
  62.     Value: 8
  63.  
  64.     Key  : WER.OS.Branch
  65.     Value: vb_release
  66.  
  67.     Key  : WER.OS.Timestamp
  68.     Value: 2019-12-06T14:06:00Z
  69.  
  70.     Key  : WER.OS.Version
  71.     Value: 10.0.19041.1
  72.  
  73.  
  74. FILE_IN_CAB:  ld.exe.33680.dmp
  75.  
  76. NTGLOBALFLAG:  0
  77.  
  78. APPLICATION_VERIFIER_FLAGS:  0
  79.  
  80. CONTEXT:  (.ecxr)
  81. rax=0000000000000000 rbx=0000000000000000 rcx=0000000000cc0000
  82. rdx=0000000000000000 rsi=0000000000000001 rdi=0000000000000069
  83. rip=0000000000443e64 rsp=000000000119f750 rbp=0000000005f407d8
  84.  r8=0000000000000008  r9=0000000000000000 r10=7f65736d68716f75
  85. r11=8101010101010100 r12=0000000000000001 r13=0000000000565a08
  86. r14=0000000000597b60 r15=000000000b737518
  87. iopl=0         nv up ei pl nz na pe nc
  88. cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010202
  89. ld+0x43e64:
  90. 00000000`00443e64 0fb64318        movzx   eax,byte ptr [rbx+18h] ds:00000000`00000018=??
  91. Resetting default scope
  92.  
  93. EXCEPTION_RECORD:  (.exr -1)
  94. ExceptionAddress: 0000000000443e64 (ld+0x0000000000043e64)
  95.    ExceptionCode: c0000005 (Access violation)
  96.   ExceptionFlags: 00000000
  97. NumberParameters: 2
  98.    Parameter[0]: 0000000000000000
  99.    Parameter[1]: 0000000000000018
  100. Attempt to read from address 0000000000000018
  101.  
  102. PROCESS_NAME:  ld.exe
  103.  
  104. READ_ADDRESS:  0000000000000018
  105.  
  106. ERROR_CODE: (NTSTATUS) 0xc0000005 - 0x%p          0x%p            Q           B         %s                              B
  107.  
  108. EXCEPTION_CODE_STR:  c0000005
  109.  
  110. EXCEPTION_PARAMETER1:  0000000000000000
  111.  
  112. EXCEPTION_PARAMETER2:  0000000000000018
  113.  
  114. STACK_TEXT:  
  115. 00000000`0119f750 00000000`00472fa2     : 00000000`011a4ae0 00000000`00000004 00000000`05e5b7b0 00000000`00000017 : ld+0x43e64
  116. 00000000`0119f8f0 00000000`004747e7     : 00000000`011a4ae0 00000000`00597b60 00000000`0c128130 00000000`004b793c : ld+0x72fa2
  117. 00000000`0119fa80 00000000`00418246     : 00000000`011a4ae0 00000000`00597b60 00000000`05330fe5 00000000`00000040 : ld+0x747e7
  118. 00000000`0119fcb0 00000000`004cceaf     : 00007ffc`906dfc10 00000000`03972e76 00000000`0051f990 00000000`00592350 : ld+0x18246
  119. 00000000`0119fd90 00000000`004013f8     : 00000000`00000241 00000000`011af490 00000000`00598208 00000000`00000000 : ld+0xcceaf
  120. 00000000`0119fe30 00000000`0040151b     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ld+0x13f8
  121. 00000000`0119ff00 00007ffc`90797034     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ld+0x151b
  122. 00000000`0119ff30 00007ffc`91822651     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0x14
  123. 00000000`0119ff60 00000000`00000000     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x21
  124.  
  125.  
  126. STACK_COMMAND:  ~0s; .ecxr ; kb
  127.  
  128. SYMBOL_NAME:  ld+43e64
  129.  
  130. MODULE_NAME: ld
  131.  
  132. IMAGE_NAME:  ld.exe
  133.  
  134. FAILURE_BUCKET_ID:  NULL_CLASS_PTR_READ_c0000005_ld.exe!Unknown
  135.  
  136. OS_VERSION:  10.0.19041.1
  137.  
  138. BUILDLAB_STR:  vb_release
  139.  
  140. OSPLATFORM_TYPE:  x64
  141.  
  142. OSNAME:  Windows 10
  143.  
  144. FAILURE_ID_HASH:  {47bf2114-b1f0-50b5-d93d-41b4b9a09ef8}
  145.  
  146. Followup:     MachineOwner
  147. ---------

kneko715
Posts: 9
Joined: Fri Dec 17, 2021 12:43 pm

Re: linker crash (ld returned 5 exit status)

Postby kneko715 » Mon Apr 04, 2022 7:44 am

Additional information:
I update toolchain to `esp-2021r2-patch3-8.4.0` by modifing "tools/tools.json". (I cherry-picked from master to v4.4.)
But the issue is remain.

Sorry for no reproduce code.
My project is too large to write here.
And I don't know what is the root cause.

Thank you.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 64 guests