* Re: Exception handling and stack unwinds segfault on aarch64-musl
2020-10-12 1:02 [ISSUE] Exception handling and stack unwinds segfault on aarch64-musl duncancmt
@ 2020-10-12 19:10 ` jnbr
2020-10-12 23:44 ` sgn
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jnbr @ 2020-10-12 19:10 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 243 bytes --]
New comment by jnbr on void-packages repository
https://github.com/void-linux/void-packages/issues/25535#issuecomment-707297314
Comment:
See also https://github.com/void-linux/void-packages/issues/7498 for the same problem reported earlier.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Exception handling and stack unwinds segfault on aarch64-musl
2020-10-12 1:02 [ISSUE] Exception handling and stack unwinds segfault on aarch64-musl duncancmt
2020-10-12 19:10 ` jnbr
@ 2020-10-12 23:44 ` sgn
2020-10-12 23:45 ` sgn
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: sgn @ 2020-10-12 23:44 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 3442 bytes --]
New comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/issues/25535#issuecomment-707399563
Comment:
```
==13821== Memcheck, a memory error detector
==13821== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==13821== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==13821== Command: ./a.out
==13821==
==13821== Invalid read of size 1
==13821== at 0x40607DC: strlen (strlen.c:16)
==13821== by 0x4F9271B: get_cie_encoding (unwind-dw2-fde.c:300)
==13821== by 0x4F92BAB: classify_object_over_fdes (unwind-dw2-fde.c:656)
==13821== by 0x4F9340B: init_object (unwind-dw2-fde.c:777)
==13821== by 0x4F9340B: search_object (unwind-dw2-fde.c:989)
==13821== by 0x4F93D63: _Unwind_Find_registered_FDE (unwind-dw2-fde.c:1066)
==13821== by 0x4F93D63: _Unwind_Find_FDE (unwind-dw2-fde-dip.c:458)
==13821== by 0x4F907A7: uw_frame_state_for (unwind-dw2.c:1257)
==13821== by 0x4F917CB: uw_init_context_1 (unwind-dw2.c:1586)
==13821== by 0x4F91DFF: _Unwind_RaiseException (unwind.inc:93)
==13821== by 0x4DD3B33: __cxa_throw (in /usr/lib/libstdc++.so.6.0.28)
==13821== by 0x108BC7: main (in /home/danh/a.out)
==13821== Address 0x2093162 is not stack'd, malloc'd or (recently) free'd
==13821==
==13821==
==13821== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==13821== Access not within mapped region at address 0x2093162
==13821== at 0x40607DC: strlen (strlen.c:16)
==13821== by 0x4F9271B: get_cie_encoding (unwind-dw2-fde.c:300)
==13821== by 0x4F92BAB: classify_object_over_fdes (unwind-dw2-fde.c:656)
==13821== by 0x4F9340B: init_object (unwind-dw2-fde.c:777)
==13821== by 0x4F9340B: search_object (unwind-dw2-fde.c:989)
==13821== by 0x4F93D63: _Unwind_Find_registered_FDE (unwind-dw2-fde.c:1066)
==13821== by 0x4F93D63: _Unwind_Find_FDE (unwind-dw2-fde-dip.c:458)
==13821== by 0x4F907A7: uw_frame_state_for (unwind-dw2.c:1257)
==13821== by 0x4F917CB: uw_init_context_1 (unwind-dw2.c:1586)
==13821== by 0x4F91DFF: _Unwind_RaiseException (unwind.inc:93)
==13821== by 0x4DD3B33: __cxa_throw (in /usr/lib/libstdc++.so.6.0.28)
==13821== by 0x108BC7: main (in /home/danh/a.out)
==13821== If you believe this happened as a result of a stack
==13821== overflow in your program's main thread (unlikely but
==13821== possible), you can try to increase the size of the
==13821== main thread stack using the --main-stacksize= flag.
==13821== The main thread stack size used in this run was 8388608.
==13821==
==13821== HEAP SUMMARY:
==13821== in use at exit: 74,233 bytes in 12 blocks
==13821== total heap usage: 14 allocs, 2 frees, 74,345 bytes allocated
==13821==
==13821== LEAK SUMMARY:
==13821== definitely lost: 0 bytes in 0 blocks
==13821== indirectly lost: 0 bytes in 0 blocks
==13821== possibly lost: 174 bytes in 2 blocks
==13821== still reachable: 74,059 bytes in 10 blocks
==13821== of which reachable via heuristic:
==13821== stdstring : 30 bytes in 1 blocks
==13821== suppressed: 0 bytes in 0 blocks
==13821== Rerun with --leak-check=full to see details of leaked memory
==13821==
==13821== For lists of detected and suppressed errors, rerun with: -s
==13821== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
```
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Exception handling and stack unwinds segfault on aarch64-musl
2020-10-12 1:02 [ISSUE] Exception handling and stack unwinds segfault on aarch64-musl duncancmt
2020-10-12 19:10 ` jnbr
2020-10-12 23:44 ` sgn
@ 2020-10-12 23:45 ` sgn
2020-10-14 10:17 ` jnbr
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: sgn @ 2020-10-12 23:45 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]
New comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/issues/25535#issuecomment-707399563
Comment:
```
==13821== at 0x40607DC: strlen (strlen.c:16)
==13821== by 0x4F9271B: get_cie_encoding (unwind-dw2-fde.c:300)
==13821== by 0x4F92BAB: classify_object_over_fdes (unwind-dw2-fde.c:656)
==13821== by 0x4F9340B: init_object (unwind-dw2-fde.c:777)
==13821== by 0x4F9340B: search_object (unwind-dw2-fde.c:989)
==13821== by 0x4F93D63: _Unwind_Find_registered_FDE (unwind-dw2-fde.c:1066)
==13821== by 0x4F93D63: _Unwind_Find_FDE (unwind-dw2-fde-dip.c:458)
==13821== by 0x4F907A7: uw_frame_state_for (unwind-dw2.c:1257)
==13821== by 0x4F917CB: uw_init_context_1 (unwind-dw2.c:1586)
==13821== by 0x4F91DFF: _Unwind_RaiseException (unwind.inc:93)
==13821== by 0x4DD3B33: __cxa_throw (in /usr/lib/libstdc++.so.6.0.28)
==13821== by 0x108BC7: main (in /home/danh/a.out)
==13821== Address 0x2093162 is not stack'd, malloc'd or (recently) free'd
```
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Exception handling and stack unwinds segfault on aarch64-musl
2020-10-12 1:02 [ISSUE] Exception handling and stack unwinds segfault on aarch64-musl duncancmt
` (2 preceding siblings ...)
2020-10-12 23:45 ` sgn
@ 2020-10-14 10:17 ` jnbr
2020-10-14 19:34 ` jnbr
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jnbr @ 2020-10-14 10:17 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 338 bytes --]
New comment by jnbr on void-packages repository
https://github.com/void-linux/void-packages/issues/25535#issuecomment-708307487
Comment:
I believe the problem is that the `eh_frame` section of `/usr/lib/libstdc++.so.6.0.28` does not end with a zero terminator, causing `classify_object_over_fdes` to read beyond the end of the section.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Exception handling and stack unwinds segfault on aarch64-musl
2020-10-12 1:02 [ISSUE] Exception handling and stack unwinds segfault on aarch64-musl duncancmt
` (3 preceding siblings ...)
2020-10-14 10:17 ` jnbr
@ 2020-10-14 19:34 ` jnbr
2020-10-14 19:34 ` jnbr
2020-10-16 18:29 ` [ISSUE] [CLOSED] " jnbr
6 siblings, 0 replies; 8+ messages in thread
From: jnbr @ 2020-10-14 19:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 308 bytes --]
New comment by jnbr on void-packages repository
https://github.com/void-linux/void-packages/issues/25535#issuecomment-708616027
Comment:
The problem was indeed missing termination of the eh_frame header, caused by wrong order of objects when linking libstdc++.
A fix is in PR #25605, feel free to verify.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Exception handling and stack unwinds segfault on aarch64-musl
2020-10-12 1:02 [ISSUE] Exception handling and stack unwinds segfault on aarch64-musl duncancmt
` (4 preceding siblings ...)
2020-10-14 19:34 ` jnbr
@ 2020-10-14 19:34 ` jnbr
2020-10-16 18:29 ` [ISSUE] [CLOSED] " jnbr
6 siblings, 0 replies; 8+ messages in thread
From: jnbr @ 2020-10-14 19:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 309 bytes --]
New comment by jnbr on void-packages repository
https://github.com/void-linux/void-packages/issues/25535#issuecomment-708616027
Comment:
The problem was indeed missing termination of the eh_frame section, caused by wrong order of objects when linking libstdc++.
A fix is in PR #25605, feel free to verify.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ISSUE] [CLOSED] Exception handling and stack unwinds segfault on aarch64-musl
2020-10-12 1:02 [ISSUE] Exception handling and stack unwinds segfault on aarch64-musl duncancmt
` (5 preceding siblings ...)
2020-10-14 19:34 ` jnbr
@ 2020-10-16 18:29 ` jnbr
6 siblings, 0 replies; 8+ messages in thread
From: jnbr @ 2020-10-16 18:29 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 565 bytes --]
Closed issue by duncancmt on void-packages repository
https://github.com/void-linux/void-packages/issues/25535
Description:
`gdb` itself uses exception, so gdb couldn't help. Please don't report more issues with this kind of problem until we fixed it.
```cpp
#include <string>
#include <stdexcept>
int main(int argc, char **argv) {
try {
throw std::runtime_error("hello");
} catch (const std::exception& e) {
}
return 0;
}
```
_Originally posted by @sgn in https://github.com/void-linux/void-packages/issues/25125#issuecomment-706798828_
^ permalink raw reply [flat|nested] 8+ messages in thread