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

Fix crash on NodeTreeBase::parse_date_id() #1199

Merged
merged 1 commit into from Jul 15, 2023
Merged

Conversation

ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Jul 15, 2023

スレッド読み込み中に異常終了したためstd::string_viewの部分文字列を取得する処理を修正します。

gcc12.2 gdbのバックトレース

#10 0x0000555555c32acf in std::__sv_check(unsigned long, unsigned long, char const*)
    (__size=243, __pos=244, __s=0x55555598ca42 "basic_string_view::substr") at /usr/include/c++/12/string_view:67
#11 0x0000555555c32fa2 in std::basic_string_view<char, std::char_traits<char> >::substr(unsigned long, unsigned long) const
    (this=0x7fffe97fe210, __pos=244, __n=18446744073709551615) at /usr/include/c++/12/string_view:311
#12 0x0000555555c7d072 in DBTREE::NodeTreeBase::parse_date_id(DBTREE::NODE*, std::basic_string_view<char, std::char_traits<char> >)
(gdb) frame 12
#12 0x0000555555c7d072 in DBTREE::NodeTreeBase::parse_date_id (this=0x5555577c19f0, header=0x555558e6bbe8,
2019                str = str.substr( start_block + lng_block );
(gdb) p str.size()
$3 = 243
(gdb) p start_block + lng_block
$4 = 244

スレッド読み込み中に異常終了したため`std::string_view`の部分文字列
を取得する処理を修正します。

gdbのバックトレース
```
\#10 0x0000555555c32acf in std::__sv_check(unsigned long, unsigned long, char const*)
    (__size=243, __pos=244, __s=0x55555598ca42 "basic_string_view::substr") at /usr/include/c++/12/string_view:67
\#11 0x0000555555c32fa2 in std::basic_string_view<char, std::char_traits<char> >::substr(unsigned long, unsigned long) const
    (this=0x7fffe97fe210, __pos=244, __n=18446744073709551615) at /usr/include/c++/12/string_view:311
\#12 0x0000555555c7d072 in DBTREE::NodeTreeBase::parse_date_id(DBTREE::NODE*, std::basic_string_view<char, std::char_traits<char> >)
(gdb) frame 12
\#12 0x0000555555c7d072 in DBTREE::NodeTreeBase::parse_date_id (this=0x5555577c19f0, header=0x555558e6bbe8,
2019                str = str.substr( start_block + lng_block );
(gdb) p str.size()
$3 = 243
(gdb) p start_block + lng_block
$4 = 244
```
@ma8ma ma8ma added the bug バグの追跡 label Jul 15, 2023
@ma8ma ma8ma merged commit 582fe6e into master Jul 15, 2023
20 checks passed
@ma8ma ma8ma deleted the nodetreebase-fix-crash branch July 15, 2023 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug バグの追跡
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant