Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2170010 - weechat-3.6-4.fc39 FTBS: TEST(GuiChat, PrintYDateTags)__weechat_plugin__: [BUG] Segmentation fault
Summary: weechat-3.6-4.fc39 FTBS: TEST(GuiChat, PrintYDateTags)__weechat_plugin__: [BU...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: weechat
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Paul P Komkoff Jr
QA Contact: Fedora Extras Quality Assurance
URL: https://koschei.fedoraproject.org/pac...
Whiteboard:
Depends On:
Blocks: F38FTBFS F39FTBFS
TreeView+ depends on / blocked
 
Reported: 2023-02-15 11:29 UTC by Petr Pisar
Modified: 2023-03-11 03:08 UTC (History)
6 users (show)

Fixed In Version: weechat-3.6-5.fc38
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-03-11 03:08:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Petr Pisar 2023-02-15 11:29:15 UTC
weechat-3.6-4.fc39 fails to build in Fedora 39 and Fedora 38:


>>> Tests tcl: 111 tests, 111 OK, 0 errors, 0 unexpected messages, 19 ms
>>> Running command: /script unload -q testapi.tcl
TEST(Scripts, API) - 350 ms
TEST(GuiNick, FindColor) - 0 ms
TEST(GuiNick, StrdupForColor) - 0 ms
TEST(GuiNick, GetForcedColor) - 0 ms
TEST(GuiNick, HashColor) - 0 ms
TEST(GuiNick, HashSum32) - 0 ms
TEST(GuiNick, HashSum64) - 0 ms
TEST(GuiNick, HashDbj232) - 0 ms
TEST(GuiNick, HashDbj264) - 0 ms
TEST(GuiLine, HdataPrintLog) - 0 ms
TEST(GuiLine, AddToInfolist) - 0 ms
TEST(GuiLine, HdataLineDataCb) - 0 ms
TEST(GuiLine, HdataLineDataUpdateCb) - 0 ms
TEST(GuiLine, HdataLineCb) - 0 ms
TEST(GuiLine, HdataLinesCb) - 0 ms
TEST(GuiLine, MixBuffers) - 0 ms
TEST(GuiLine, Clear) - 0 ms
TEST(GuiLine, AddY) - 0 ms
TEST(GuiLine, Add) - 0 ms
TEST(GuiLine, HookUpdate) - 0 ms
TEST(GuiLine, New) - 0 ms
TEST(GuiLine, SetHighlight) - 0 ms
TEST(GuiLine, SetNotifyLevel) - 0 ms
TEST(GuiLine, GetMaxNotifyLevel) - 0 ms
TEST(GuiLine, FreeAll) - 0 ms
TEST(GuiLine, Free) - 0 ms
TEST(GuiLine, MixedFreeAll) - 0 ms
TEST(GuiLine, MixedFreeBuffer) - 0 ms
TEST(GuiLine, MixedAdd) - 0 ms
TEST(GuiLine, RemoveFromList) - 0 ms
TEST(GuiLine, FreeData) - 0 ms
TEST(GuiLine, AddToList) - 0 ms
TEST(GuiLine, ComputePrefixMaxLength) - 0 ms
TEST(GuiLine, ComputeBufferMaxLength) - 0 ms
TEST(GuiLine, HasOfflineNick) - 0 ms
TEST(GuiLine, HasHighlight) - 0 ms
TEST(GuiLine, GetNickTag) - 0 ms
TEST(GuiLine, SearchTagStartingWith) - 0 ms
TEST(GuiLine, MatchTags) - 0 ms
TEST(GuiLine, HasTagNoFilter) - 0 ms
TEST(GuiLine, MatchRegex) - 0 ms
TEST(GuiLine, SearchText) - 0 ms
TEST(GuiLine, GetNextDisplayed) - 0 ms
TEST(GuiLine, GetPrevDisplayed) - 0 ms
TEST(GuiLine, GetLastDisplayed) - 0 ms
TEST(GuiLine, GetFirstDisplayed) - 0 ms
TEST(GuiLine, IsDisplayed) - 0 ms
TEST(GuiLine, BuildStringMessageTags) - 0 ms
TEST(GuiLine, BuildStringPrefixMessage) - 0 ms
TEST(GuiLine, GetAlign) - 0 ms
TEST(GuiLine, GetPrefixForDisplay) - 0 ms
TEST(GuiLine, PrefixIsSameNick) - 0 ms
TEST(GuiLine, TagsAlloc) - 0 ms
TEST(GuiLine, LinesAlloc) - 0 ms
TEST(GuiColor, Emphasize) - 0 ms
TEST(GuiColor, EncodeAnsi) - 0 ms
TEST(GuiColor, DecodeAnsi) - 0 ms
TEST(GuiColor, Decode) - 0 ms
TEST(GuiColor, CodeSize) - 0 ms
TEST(GuiColor, GetCustom) - 0 ms
TEST(GuiChat, ChatEnd) - 0 ms
TEST(GuiChat, HsignalQuoteLineCb) - 0 ms
TEST(GuiChat, PrintYDateTags)__weechat_plugin__: [BUG] Segmentation fault at 0x0000000000000000
ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0003 E:001ab0 DUMMY  [FINISH]
-- Machine register context ------------------------------------------------
 RIP: 0x00007fe92198e498 RBP: 0x00007ffe90af9f40 RSP: 0x00007ffe90af9a28
 RAX: 0x0000000000000000 RBX: 0x00007ffe90af9f50 RCX: 0x0000000000000002
 RDX: 0x00007ffe90afa060 RDI: 0x0000000000000000 RSI: 0x0000000000000025
  R8: 0x0000561d4bffd660  R9: 0x00007ffe90afa060 R10: 0x0000000000000000
 R11: 0xa31e022ec468253a R12: 0x0000561d4bffd260 R13: 0x00007ffe90afa060
 R14: 0x00007ffe90af9f50 R15: 0x0000000000000000 EFL: 0x0000000000010283
-- C level backtrace information -------------------------------------------
/lib64/libruby.so.3.2(0x7fe91f8e1429) [0x7fe91f8e1429]
/lib64/libruby.so.3.2(0x7fe91f8e5789) [0x7fe91f8e5789]
/lib64/libruby.so.3.2(0x7fe91f734cfc) [0x7fe91f734cfc]
/lib64/libruby.so.3.2(0x7fe91f859316) [0x7fe91f859316]
/lib64/libc.so.6(__restore_rt+0x0) [0x7fe92185eba0]
/lib64/libc.so.6(__strchrnul_evex+0x18) [0x7fe92198e498]
/lib64/libc.so.6(__printf_buffer+0x6e) [0x7fe92187f4ce]
/lib64/libc.so.6(__vsnprintf_internal+0x76) [0x7fe9218a20d6]
/builddir/build/BUILD/weechat-3.6/redhat-linux-build/tests/tests(0x561d49971739) [0x561d49971739]
/builddir/build/BUILD/weechat-3.6/redhat-linux-build/tests/tests(_ZN32TEST_GuiChat_PrintYDateTags_Test8testBodyEv) [0x561d49a9579f]
/lib64/libCppUTest.so(0x7fe9220f19d0) [0x7fe9220f19d0]
/lib64/libCppUTest.so(_ZN5Utest3runEv+0x120) [0x7fe9220fc940]
/lib64/libCppUTest.so(_ZN10UtestShell26runOneTestInCurrentProcessEP10TestPluginR10TestResult+0x162) [0x7fe9220fc412]
/lib64/libCppUTest.so(0x7fe9220f19d0) [0x7fe9220f19d0]
/lib64/libCppUTest.so(_ZN10UtestShell10runOneTestEP10TestPluginR10TestResult+0xb1) [0x7fe9220f15f1]
/lib64/libCppUTest.so(_ZN12TestRegistry11runAllTestsER10TestResult+0x13b) [0x7fe9220eccbb]
/lib64/libCppUTest.so(_ZN21CommandLineTestRunner11runAllTestsEv+0x11c) [0x7fe9220ea30c]
/lib64/libCppUTest.so(_ZN21CommandLineTestRunner15runAllTestsMainEv+0xa7) [0x7fe9220f06b7]
/lib64/libCppUTest.so(_ZN21CommandLineTestRunner11RunAllTestsEiPKPKc+0xd3) [0x7fe9220f0863]
/builddir/build/BUILD/weechat-3.6/redhat-linux-build/tests/tests(main) [0x561d498ff72a]
-- Other runtime information -----------------------------------------------
* Loaded script: __weechat_plugin__
* Loaded features:
    0 enumerator.so
    1 thread.rb
    2 fiber.so
    3 rational.so
    4 complex.so
    5 ruby2_keywords.rb
    6 /usr/lib64/ruby/enc/encdb.so
    7 /usr/lib64/ruby/enc/trans/transdb.so
[...]
======= WeeChat backtrace =======
(written by WeeChat 3.6, compiled on Jan 21 2023 00:00:00)
001  /builddir/build/BUILD/weechat-3.6/src/core/wee-backtrace.c:168 [function weechat_backtrace]
002  /builddir/build/BUILD/weechat-3.6/src/core/wee-debug.c:186 [function debug_sigsegv_cb]
003  ??:? [function rb_bug_errno]
004  ??:? [function rb_f_kill]
005  ??:? [function __restore_rt]
006  :? [function __strchrnul_evex]
007  :? [function __printf_buffer]
008  :? [function __vsnprintf_internal]
009  /builddir/build/BUILD/weechat-3.6/src/gui/gui-chat.c:959 (discriminator 12) [function gui_chat_printf_y_date_tags]
010  TEST_GuiChat_PrintYDateTags_Test::testBody()
010  ??:?
011  TestInstaller::~TestInstaller()
011  ??:?
012  Utest::run()
012  ??:?
013  UtestShell::runOneTestInCurrentProcess(TestPlugin*, TestResult&)
013  ??:?
014  TestInstaller::~TestInstaller()
014  ??:?
015  UtestShell::runOneTest(TestPlugin*, TestResult&)
015  ??:?
016  TestRegistry::runAllTests(TestResult&)
016  ??:?
017  CommandLineTestRunner::runAllTests()
017  ??:?
018  CommandLineTestRunner::runAllTestsMain()
018  ??:?
019  CommandLineTestRunner::RunAllTests(int, char const* const*)
019  ??:?
020  ??:? [function main]
021  ??:? [function __libc_start_call_main]
022  :? [function __libc_start_main_alias_2]
023  ??:? [function _start]
======= End of  backtrace =======
0% tests passed, 1 tests failed out of 1
Total Test time (real) =   1.92 sec
The following tests FAILED:
	  1 - unit (Subprocess aborted)

A difference between a passing and failing buildroot is at <https://koschei.fedoraproject.org/build/14672581>.

Comment 1 Mamoru TASAKA 2023-02-20 15:25:48 UTC
Thread 1 "tests" received signal SIGSEGV, Segmentation fault.
0x00007ffff775a583 in __strchrnul_avx2 () from /lib64/libc.so.6
Missing separate debuginfos, use: dnf debuginfo-install cpputest-devel-4.0-4.fc38.x86_64 cyrus-sasl-lib-2.1.28-9.fc38.x86_64 enchant-1.6.0-32.fc38.x86_64 gc-8.2.2-3.fc38.x86_64 glib2-2.75.3-4.fc39.x86_64 glibc-2.37-1.fc38.x86_64 gmp-6.2.1-4.fc38.x86_64 gnutls-3.7.8-11.fc38.x86_64 guile22-2.2.7-7.fc38.x86_64 hunspell-1.7.2-3.fc38.x86_64 keyutils-libs-1.6.1-6.fc38.x86_64 krb5-libs-1.20.1-9.fc39.x86_64 libbrotli-1.0.9-11.fc38.x86_64 libcom_err-1.46.5-4.fc38.x86_64 libcurl-7.88.0-2.fc39.x86_64 libevent-2.1.12-8.fc38.x86_64 libffi-3.4.4-2.fc38.x86_64 libgcc-13.0.1-0.4.fc39.x86_64 libgcrypt-1.10.1-7.fc38.x86_64 libgpg-error-1.46-2.fc38.x86_64 libidn2-2.3.4-2.fc38.x86_64 libnghttp2-1.52.0-1.fc39.x86_64 libpsl-0.21.2-2.fc38.x86_64 libselinux-3.5-0.rc3.1.fc39.x86_64 libssh-0.10.4-3.fc38.x86_64 libstdc++-13.0.1-0.4.fc39.x86_64 libtool-ltdl-2.4.7-6.fc38.x86_64 libunistring1.0-1.0-1.fc38.x86_64 libxcrypt-4.4.33-7.fc39.x86_64 libzstd-1.5.4-1.fc39.x86_64 ncurses-libs-6.4-3.20230114.fc38.x86_64 nettle-3.8-3.fc38.x86_64 openldap-2.6.3-2.fc38.x86_64 openssl-libs-3.0.8-1.fc39.x86_64 p11-kit-0.24.1-6.fc38.x86_64 p11-kit-trust-0.24.1-6.fc38.x86_64 pcre2-10.42-1.fc38.1.x86_64 python3-libs-3.11.2-1.fc39.x86_64 ruby-libs-3.2.1-179.fc39.x86_64 tcl-8.6.12-4.fc38.x86_64 zlib-1.2.13-3.fc38.x86_64
(gdb) bt
#0  0x00007ffff775a583 in __strchrnul_avx2 () from /lib64/libc.so.6
#1  0x00007ffff765b4ce in __printf_buffer () from /lib64/libc.so.6
#2  0x00007ffff767e0d6 in __vsnprintf_internal () from /lib64/libc.so.6
#3  0x0000555555768739 in vsnprintf (__ap=<optimized out>, __fmt=<optimized out>, __n=<optimized out>, __s=<optimized out>, __s=<optimized out>, __n=<optimized out>, __fmt=<optimized out>, 
    __ap=<optimized out>) at /usr/include/bits/stdio2.h:68
#4  gui_chat_printf_y_date_tags (buffer=0x555556aef670, y=0, date=0, tags=0x0, message=0x0) at /builddir/build/BUILD/weechat-3.6/src/gui/gui-chat.c:959
#5  0x000055555588c79f in TEST_GuiChat_PrintYDateTags_Test::testBody() ()
#6  0x00007ffff7e619d0 in PlatformSpecificSetJmpImplementation () from /lib64/libCppUTest.so
#7  0x00007ffff7e6c940 in Utest::run() () from /lib64/libCppUTest.so
#8  0x00007ffff7e6c412 in UtestShell::runOneTestInCurrentProcess(TestPlugin*, TestResult&) () from /lib64/libCppUTest.so
#9  0x00007ffff7e619d0 in PlatformSpecificSetJmpImplementation () from /lib64/libCppUTest.so
#10 0x00007ffff7e615f1 in UtestShell::runOneTest(TestPlugin*, TestResult&) () from /lib64/libCppUTest.so
#11 0x00007ffff7e5ccbb in TestRegistry::runAllTests(TestResult&) () from /lib64/libCppUTest.so
#12 0x00007ffff7e5a30c in CommandLineTestRunner::runAllTests() () from /lib64/libCppUTest.so
#13 0x00007ffff7e606b7 in CommandLineTestRunner::runAllTestsMain() () from /lib64/libCppUTest.so
#14 0x00007ffff7e60863 in CommandLineTestRunner::RunAllTests(int, char const* const*) () from /lib64/libCppUTest.so
#15 0x00005555556f672a in main ()

https://github.com/weechat/weechat/blob/e5a159c74f8c71483129abd013b77f0f7a9ca216/tests/unit/gui/test-gui-chat.cpp#L592
https://github.com/weechat/weechat/blob/e5a159c74f8c71483129abd013b77f0f7a9ca216/src/gui/gui-chat.c#L942-L959
https://github.com/weechat/weechat/blob/e5a159c74f8c71483129abd013b77f0f7a9ca216/src/plugins/weechat-plugin.h#L192-L203

So when calling vsnprintf(fmt, ...) with fmt=NULL, Fedora 37 glibc accepts it, but Fedora 38 glibc make this segfault.
Short example:

==========================================================
#include <stdarg.h>
#include <stdio.h>

static void foo(const char *fmt, ...) {
	va_list ap;
	char buf[1024];

	va_start(ap, fmt);
	vsnprintf(buf, sizeof buf, fmt, ap);
	va_end(ap);

	fprintf(stdout, "%s", buf);	
}

int main(void) {
	foo(""); /* No problem */
	foo(NULL); /* segfaults on Fedora 38, not on Fedora 37 */

	return 0;
}
==========================================================

Perhaps this is due to the change in glibc-2.36.9000-20, however I don't think
this is accepted by specification - although "glibc" is supposed to accept this...

Comment 2 Mamoru TASAKA 2023-02-21 08:05:53 UTC
https://github.com/weechat/weechat/issues/1883

Comment 3 Fedora Update System 2023-02-24 06:32:46 UTC
FEDORA-2023-6b1842e2d3 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-6b1842e2d3

Comment 4 Fedora Update System 2023-02-25 03:39:34 UTC
FEDORA-2023-6b1842e2d3 has been pushed to the Fedora 38 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-6b1842e2d3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2023-03-11 03:08:28 UTC
FEDORA-2023-6b1842e2d3 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.