[gdb pretty printers] gdb.error No type named jsstring
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr91 | --- | unaffected |
firefox94 | --- | unaffected |
firefox95 | --- | wontfix |
firefox96 | --- | wontfix |
firefox97 | --- | wontfix |
People
(Reporter: freddy, Assigned: sfink)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(5 obsolete files)
When running "./mach mochitest --debugger=gdb <some test>", I experienced this error:
This happened directly when loading the pretty printers, i.e., right after instructing gdb to run the target program.
Traceback (most recent call last):
File "/home/freddy/gecko/js/src/gdb/mozilla/prettyprinters.py", line 218, in __init__
self.JSString_ptr_t = gdb.lookup_type("JSString").pointer()
gdb.error: No type named JSString.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/freddy/gecko/obj-x86_64-pc-linux-gnu/build/.gdbinit.py", line 10, in <module>
mozilla.autoload.register(gdb.current_objfile())
File "/home/freddy/gecko/js/src/gdb/mozilla/autoload.py", line 40, in register
mozilla.unwind.register_unwinder(objfile)
File "/home/freddy/gecko/js/src/gdb/mozilla/unwind.py", line 584, in register_unwinder
type_cache = UnwinderTypeCache()
File "/home/freddy/gecko/js/src/gdb/mozilla/unwind.py", line 78, in __init__
super(UnwinderTypeCache, self).__init__(None)
File "/home/freddy/gecko/js/src/gdb/mozilla/prettyprinters.py", line 222, in __init__
raise NotSpiderMonkeyObjfileError
mozilla.prettyprinters.NotSpiderMonkeyObjfileError
Warnung: Missing auto-load script at offset 0 in section .debug_gdb_scripts
This is on our latest git revision 7a917a7e62ff34fc776ddf18b9dd3862a2afda97 (hg rev 0658bfc611aa2025d84fd169cd5d66f2bc445ec9).
Comment 1•3 years ago
|
||
This looks like a regression caused by clang13 (bug 1731582), because when I compile with clang12, no error is thrown.
Comparing the gdb info types
output for StringType.h, shows that multiple types aren't present when compiling with clang13:
1155: JSAtom;
942: JSDependentString;
992: JSExtensibleString;
1121: JSExternalString;
-1083: JSFatInlineString;
1012: JSInlineString;
788: JSLinearString;
709: JSRope;
714: JSRope::UsingBarrier;
-190: JSString;
-206: JSString::Data;
1052: JSThinInlineString;
-1226: js::FatInlineAtom;
1789: js::IdToPrintableBehavior;
1287: js::LittleEndianChars;
-1211: js::NormalAtom;
1541: js::PropertyName;
1303: js::StaticStrings;
1432: js::StaticStrings::SmallCharTable;
2076: js::gc::StringRelocationOverlay;
1430: typedef unsigned char js::StaticStrings::SmallChar;
Updated•3 years ago
|
Comment 2•3 years ago
|
||
Set release status flags based on info from the regressing bug 1731582
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
Note that we have a CI job that verifies that the gdb prettyprinters work, and it hasn't been failing. It turns out that it's compiling with gcc.
Assignee | ||
Comment 4•3 years ago
|
||
The clang bugtracker is down right now since they're in the middle of a failing migration to github. But to record some info:
The DWARF info for the .o file that is relevant to JSString
contains:
<1><48cbf>: Abbrev Number: 43 (DW_TAG_class_type)
<48cc0> DW_AT_calling_convention: 4 (pass by ref)
<48cc1> DW_AT_name : (indirect string, offset: 0x6830): JSLinearString
<48cc5> DW_AT_byte_size : 24
<48cc6> DW_AT_decl_file : 25
<48cc7> DW_AT_decl_line : 788
<2><48cc9>: Abbrev Number: 5 (DW_TAG_inheritance)
<48cca> DW_AT_type : <0x4862b>
<48cce> DW_AT_data_member_location: 0
<48ccf> DW_AT_accessibility: 1 (public)
...
so a complete declaration of JSLinearString
. It is tagged as inheriting from 0x4862b, which is:
<1><4862b>: Abbrev Number: 19 (DW_TAG_class_type)
<4862c> DW_AT_name : (indirect string, offset: 0x44c1): JSString
<48630> DW_AT_declaration : 1
<2><48630>: Abbrev Number: 20 (DW_TAG_subprogram)
<48631> DW_AT_linkage_name: (indirect string, offset: 0x2b059): _ZN8JSString23fillWithRepresentativesEP9JSContextN2JS6HandleIPN2js11ArrayObjectEEE
<48635> DW_AT_name : (indirect string, offset: 0x2b0ac): fillWithRepresentatives
<48639> DW_AT_decl_file : 25
...
Now, I don't know how to read DWARF, but the DW_AT_declaration
makes it look to me like it's doing only a non-defining (forward? partial?) declaration of the JSString
type -- and yet, it's also enumerating fields of it. Which seems a bit weird, but I think the DWARF format version 5 spec says it's ok in section E.2.3.
I have no clue why clang is not emitting the defining declaration of JSString
. Hopefully I can remember to file a bug once it's possible again.
Assignee | ||
Comment 5•3 years ago
|
||
Note that this means that a workaround to enable the gdb prettyprinters is to add CC=gcc
to your mozconfig.
Updated•3 years ago
|
Assignee | ||
Comment 6•3 years ago
|
||
This is also affecting work being done on Pernosco, which also relies on the debuginfo for these types.
needinfo? glandium just so he's aware.
Updated•3 years ago
|
Assignee | ||
Comment 7•3 years ago
|
||
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 8•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 9•3 years ago
|
||
Assignee | ||
Comment 10•3 years ago
|
||
Assignee | ||
Comment 11•3 years ago
|
||
Updated•3 years ago
|
Comment 12•3 years ago
|
||
Comment on attachment 9255832 [details]
Bug 1739321 - Avoid UB when allocating JSStrings and BigInts
Revision D134095 was moved to bug 1746699. Setting attachment 9255832 [details] to obsolete.
Comment 13•3 years ago
|
||
Comment on attachment 9255833 [details]
Bug 1739321 - Avoid pointing to untyped memory with TenuredChunk* pointers (reduces UB)
Revision D134096 was moved to bug 1746699. Setting attachment 9255833 [details] to obsolete.
Comment 14•3 years ago
|
||
Comment on attachment 9255859 [details]
Bug 1739321 - Change all callers of js::Allocate<T>() to properly use placement new
Revision D134116 was moved to bug 1746699. Setting attachment 9255859 [details] to obsolete.
Assignee | ||
Comment 15•3 years ago
|
||
Updated•3 years ago
|
Comment 16•3 years ago
|
||
Comment 17•3 years ago
|
||
bugherder |
Comment 18•3 years ago
|
||
Backed out as requested.
Backout link: https://hg.mozilla.org/integration/autoland/rev/631488168aeb768d16162d5c51bc5729732c886f
Updated•3 years ago
|
Comment 20•3 years ago
|
||
Backout merged to central: https://hg.mozilla.org/mozilla-central/rev/631488168aeb768d16162d5c51bc5729732c886f
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 21•3 years ago
|
||
Fixed by bug 1747269.
Description
•