libstdc Question about error 7

Arsen Arsenović arsen@aarsen.me
Wed May 31 16:05:45 GMT 2023


Hi there,

CASTEL Alexandre -EXT <alexandre.castel-1-ext@alstomgroup.com> writes:

> Hello libstdc development group,
>
> We are contacting you about one issue we discover in a laboratory.
> We have made DMESG command on a linux computer, we saw that line:
> TB_RP_Server[27922]: segfault at 47e01d78 ip 48f708dc sp b695a030 error 7 in libstdc++.so.6.0.13[48ee1000+e1000]
>
> We know a segfault but we wanted to understand the end of this line "error 7 in libstdc++.so.6.0.13[48ee1000+e1000]"
> What does error 7 or 4 or other numbers mean?
> What does [48ee1000+e1000] represent?

These are Linux messages, rather than libstdc++ messages.  Linux prints
the error, as defined by the CPU, and the [foo+bar] values are the
address of the mapping the instruction pointer was in and the offset
into that mapping (foo being the mapping base, and bar the offset into
it).

On Intel (and compatible) CPUs, an error of four means the fault was a
userspace fault (so, the 4 bit will always be set), and (as the present
bit is unset) the target page was missing, while an error value of seven
means that a write to a present but unwritable page caused the fault
(bits 4, 2 and 1 are set, respectively being User, Write, Present).  See
the Intel Software Developer's Manual, Volume 3, Chapter 4.7 for a
precise meaning of the error bits; again, assuming you're on an Intel
compatible CPU (and getting a page fault).

I can't accurately say what function inside libstdc++ wrote to invalid
memory based on just the address you posted, but odds are it was given
an invalid pointer by accident.  The best course of action is likely
loading the coredump into GDB and getting a backtrace and inspecting the
program state, and then reporting a bug should my hunch be wrong :)

I hope that helps, have a lovely day.
-- 
Arsen Arsenović
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 381 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20230531/1a2e92b6/attachment.sig>


More information about the Libstdc++ mailing list