Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libxkbcommon for openSUSE:Factory checked in at 2025-12-05 16:50:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libxkbcommon (Old) and /work/SRC/openSUSE:Factory/.libxkbcommon.new.1939 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libxkbcommon" Fri Dec 5 16:50:45 2025 rev:54 rq:1321038 version:1.12.4 Changes: -------- --- /work/SRC/openSUSE:Factory/libxkbcommon/libxkbcommon.changes 2025-10-30 17:09:46.510528198 +0100 +++ /work/SRC/openSUSE:Factory/.libxkbcommon.new.1939/libxkbcommon.changes 2025-12-05 16:51:04.538436010 +0100 @@ -1,0 +2,6 @@ +Thu Dec 4 04:10:46 UTC 2025 - Jan Engelhardt <[email protected]> + +- Update to release 1.12.4 + * Fixed a segfault occurring in unlikely setups. + +------------------------------------------------------------------- Old: ---- xkbcommon-1.12.3.tar.gz New: ---- xkbcommon-1.12.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libxkbcommon.spec ++++++ --- /var/tmp/diff_new_pack.MH3gE0/_old 2025-12-05 16:51:05.498476291 +0100 +++ /var/tmp/diff_new_pack.MH3gE0/_new 2025-12-05 16:51:05.502476459 +0100 @@ -23,7 +23,7 @@ %endif Name: libxkbcommon -Version: 1.12.3 +Version: 1.12.4 Release: 0 Summary: Library for handling xkb descriptions License: MIT ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.MH3gE0/_old 2025-12-05 16:51:05.550478473 +0100 +++ /var/tmp/diff_new_pack.MH3gE0/_new 2025-12-05 16:51:05.558478808 +0100 @@ -1,5 +1,5 @@ -mtime: 1761732881 -commit: 2027205c96d0ae06d06040a7fdb93ef1cae6a2259bf09f1ed296a04ca56c418f +mtime: 1764821840 +commit: 200fa54b69cb379fee4e72b0c1d4655ee571600fd74c5a009e456f4f667f8e42 url: https://src.opensuse.org/jengelh/libxkbcommon revision: master ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2025-12-04 05:17:41.000000000 +0100 @@ -0,0 +1 @@ +.osc ++++++ xkbcommon-1.12.3.tar.gz -> xkbcommon-1.12.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libxkbcommon-xkbcommon-1.12.3/.github/workflows/linux.yml new/libxkbcommon-xkbcommon-1.12.4/.github/workflows/linux.yml --- old/libxkbcommon-xkbcommon-1.12.3/.github/workflows/linux.yml 2025-10-29 07:49:13.000000000 +0100 +++ new/libxkbcommon-xkbcommon-1.12.4/.github/workflows/linux.yml 2025-12-03 16:16:44.000000000 +0100 @@ -2,9 +2,13 @@ on: push: - branches: [ master ] + branches: + - master + - 'releases/**' pull_request: - branches: [ master ] + branches: + - master + - 'releases/**' # Set permissions at the job level. permissions: {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libxkbcommon-xkbcommon-1.12.3/.github/workflows/macos.yml new/libxkbcommon-xkbcommon-1.12.4/.github/workflows/macos.yml --- old/libxkbcommon-xkbcommon-1.12.3/.github/workflows/macos.yml 2025-10-29 07:49:13.000000000 +0100 +++ new/libxkbcommon-xkbcommon-1.12.4/.github/workflows/macos.yml 2025-12-03 16:16:44.000000000 +0100 @@ -2,9 +2,13 @@ on: push: - branches: [ master ] + branches: + - master + - 'releases/**' pull_request: - branches: [ master ] + branches: + - master + - 'releases/**' # Set permissions at the job level. permissions: {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libxkbcommon-xkbcommon-1.12.3/.github/workflows/windows.yml new/libxkbcommon-xkbcommon-1.12.4/.github/workflows/windows.yml --- old/libxkbcommon-xkbcommon-1.12.3/.github/workflows/windows.yml 2025-10-29 07:49:13.000000000 +0100 +++ new/libxkbcommon-xkbcommon-1.12.4/.github/workflows/windows.yml 2025-12-03 16:16:44.000000000 +0100 @@ -2,9 +2,13 @@ on: push: - branches: [ master ] + branches: + - master + - 'releases/**' pull_request: - branches: [ master ] + branches: + - master + - 'releases/**' # Set permissions at the job level. permissions: {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libxkbcommon-xkbcommon-1.12.3/NEWS.md new/libxkbcommon-xkbcommon-1.12.4/NEWS.md --- old/libxkbcommon-xkbcommon-1.12.3/NEWS.md 2025-10-29 07:49:13.000000000 +0100 +++ new/libxkbcommon-xkbcommon-1.12.4/NEWS.md 2025-12-03 16:16:44.000000000 +0100 @@ -1,3 +1,16 @@ +libxkbcommon [1.12.4] – 2025-12-03 +================================== + +[1.12.4]: https://github.com/xkbcommon/libxkbcommon/tree/xkbcommon-1.12.4 + +# API + +## Fixes + +- Fixed segfault triggering in unlikely setups. + ([#934](https://github.com/xkbcommon/libxkbcommon/issues/934)) + + libxkbcommon [1.12.3] – 2025-10-29 ================================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libxkbcommon-xkbcommon-1.12.3/meson.build new/libxkbcommon-xkbcommon-1.12.4/meson.build --- old/libxkbcommon-xkbcommon-1.12.3/meson.build 2025-10-29 07:49:13.000000000 +0100 +++ new/libxkbcommon-xkbcommon-1.12.4/meson.build 2025-12-03 16:16:44.000000000 +0100 @@ -1,7 +1,7 @@ project( 'libxkbcommon', 'c', - version: '1.12.3', + version: '1.12.4', default_options: [ 'c_std=c11', 'warning_level=3', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libxkbcommon-xkbcommon-1.12.3/src/xkbcomp/keymap.c new/libxkbcommon-xkbcommon-1.12.4/src/xkbcomp/keymap.c --- old/libxkbcommon-xkbcommon-1.12.3/src/xkbcomp/keymap.c 2025-10-29 07:49:13.000000000 +0100 +++ new/libxkbcommon-xkbcommon-1.12.4/src/xkbcomp/keymap.c 2025-12-03 16:16:44.000000000 +0100 @@ -329,14 +329,14 @@ add_key_aliases(struct xkb_keymap *keymap, darray_size_t min, darray_size_t max, struct xkb_key_alias *aliases) { - darray_size_t num_key_aliases = 0; for (darray_size_t alias = min; alias <= max; alias++) { const KeycodeMatch entry = keymap->key_names[alias]; if (entry.is_alias && entry.found) { - aliases[num_key_aliases++] = (struct xkb_key_alias) { + *aliases = (struct xkb_key_alias) { .alias = alias, .real = entry.alias.real }; + aliases++; } } } @@ -369,15 +369,15 @@ static_assert(sizeof(struct xkb_key_alias) == 2 * sizeof(KeycodeMatch), ""); #endif darray_size_t num_key_aliases = 0; - darray_size_t min_alias = DARRAY_SIZE_MAX; + darray_size_t min_alias = 0; darray_size_t max_alias = 0; for (xkb_atom_t alias = 0; alias < keymap->num_key_names; alias++) { const KeycodeMatch entry = keymap->key_names[alias]; if (entry.is_alias && entry.found) { - num_key_aliases++; - if (min_alias == DARRAY_SIZE_MAX) + if (!num_key_aliases) min_alias = alias; max_alias = alias; + num_key_aliases++; } } if (num_key_aliases) { @@ -385,12 +385,13 @@ * No fancy algorithm used here: either we can trivially write the whole * range of `xkb_key_aliases` without overlapping with the `KeycodeMatch` * alias entries or we allocate a new array. - * In practice no new allocation is is needed and it delivers performs - * better than using a buffer to handle overlaps. + * In practice no new allocation is needed and it performs better than + * using a buffer to handle overlaps. */ const darray_size_t required_space = sizeof(struct xkb_key_alias) / sizeof(KeycodeMatch) * num_key_aliases; + assert(num_key_aliases <= keymap->num_key_names); if (min_alias >= required_space) { /* Overwrite before the *first* alias entry */ add_key_aliases(keymap, min_alias, max_alias, keymap->key_aliases); @@ -398,24 +399,24 @@ struct xkb_key_alias * const r = realloc(keymap->key_aliases, num_key_aliases * sizeof(*keymap->key_aliases)); - if (r == NULL) + if (!r) return false; keymap->key_aliases = r; } else if (keymap->num_key_names - max_alias - 1 > required_space) { - /* Overwrite after the *last* alias entry, then move to the start */ + /* Overwrite after the *last* alias entry */ struct xkb_key_alias * const aliases = (struct xkb_key_alias *) ( - keymap->key_names - required_space - - !is_aligned(keymap->key_names - required_space, - sizeof(struct xkb_key_alias)) + keymap->key_names + max_alias + 1 + + !is_aligned(keymap->key_names + max_alias + 1, sizeof(*aliases)) ); add_key_aliases(keymap, min_alias, max_alias, aliases); + /* Move to the start */ memcpy(keymap->key_aliases, aliases, - num_key_aliases * sizeof(*aliases)); + num_key_aliases * sizeof(*keymap->key_aliases)); /* Shrink */ struct xkb_key_alias * const r = realloc(keymap->key_aliases, num_key_aliases * sizeof(*keymap->key_aliases)); - if (r == NULL) + if (!r) return false; keymap->key_aliases = r; } else { @@ -425,7 +426,7 @@ */ struct xkb_key_alias * const aliases = calloc(num_key_aliases, sizeof(*aliases)); - if (aliases == NULL) + if (!aliases) return false; add_key_aliases(keymap, min_alias, max_alias, aliases); free(keymap->key_names); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libxkbcommon-xkbcommon-1.12.3/test/buffercomp.c new/libxkbcommon-xkbcommon-1.12.4/test/buffercomp.c --- old/libxkbcommon-xkbcommon-1.12.3/test/buffercomp.c 2025-10-29 07:49:13.000000000 +0100 +++ new/libxkbcommon-xkbcommon-1.12.4/test/buffercomp.c 2025-12-03 16:16:44.000000000 +0100 @@ -1055,7 +1055,7 @@ " xkb_keycodes {\n" /* * Multiple aliases *before* names: check that the key name LUT - * overwrite is done properly. + * is replaced with new allocation. */ " alias <A> = <X>;\n" " alias <B> = <X>;\n" @@ -1078,13 +1078,42 @@ "};", .expected = GOLDEN_TESTS_OUTPUTS "keycodes-aliases-2.xkb" }, + { + .keymap = + "xkb_keymap {\n" + " xkb_keycodes {\n" + /* + * Multiple aliases *before* names: check that the key name LUT + * overwrite is done properly after the last alias. + */ + " alias <A> = <1>;\n" + " alias <B> = <1>;\n" + " alias <C> = <1>;\n" + " alias <D> = <1>;\n" + " alias <E> = <1>;\n" + " <1> = 1;\n" + " <2> = 2;\n" + " <3> = 3;\n" + " <4> = 4;\n" + " <5> = 5;\n" + " <6> = 6;\n" + " <7> = 7;\n" + " <8> = 8;\n" + " <9> = 9;\n" + " <10> = 10;\n" + " <11> = 11;\n" + " <12> = 12;\n" + " };\n" + "};", + .expected = GOLDEN_TESTS_OUTPUTS "keycodes-aliases-3.xkb" + }, }; for (unsigned int k = 0; k < ARRAY_SIZE(keymaps); k++) { fprintf(stderr, "------\n*** %s: #%u ***\n", __func__, k); /* * We use a new context because we want to check key name LUT is - * correctly implemented + * correctly implemented: it requires an empty atom table. */ struct xkb_context * const ctx2 = test_get_context(CONTEXT_NO_FLAG); assert(ctx2); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libxkbcommon-xkbcommon-1.12.3/test/data/keymaps/keycodes-aliases-3.xkb new/libxkbcommon-xkbcommon-1.12.4/test/data/keymaps/keycodes-aliases-3.xkb --- old/libxkbcommon-xkbcommon-1.12.3/test/data/keymaps/keycodes-aliases-3.xkb 1970-01-01 01:00:00.000000000 +0100 +++ new/libxkbcommon-xkbcommon-1.12.4/test/data/keymaps/keycodes-aliases-3.xkb 2025-12-03 16:16:44.000000000 +0100 @@ -0,0 +1,41 @@ +xkb_keymap { +xkb_keycodes { + minimum = 1; + maximum = 255; + <1> = 1; + <2> = 2; + <3> = 3; + <4> = 4; + <5> = 5; + <6> = 6; + <7> = 7; + <8> = 8; + <9> = 9; + <10> = 10; + <11> = 11; + <12> = 12; + alias <A> = <1>; + alias <B> = <1>; + alias <C> = <1>; + alias <D> = <1>; + alias <E> = <1>; +}; + +xkb_types { + type "ONE_LEVEL" { + modifiers= none; + }; +}; + +xkb_compatibility { + interpret.useModMapMods= AnyLevel; + interpret.repeat= False; + interpret VoidSymbol+AnyOfOrNone(none) { + repeat= True; + }; +}; + +xkb_symbols { +}; + +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libxkbcommon-xkbcommon-1.12.3/test/keymap.c new/libxkbcommon-xkbcommon-1.12.4/test/keymap.c --- old/libxkbcommon-xkbcommon-1.12.3/test/keymap.c 2025-10-29 07:49:13.000000000 +0100 +++ new/libxkbcommon-xkbcommon-1.12.4/test/keymap.c 2025-12-03 16:16:44.000000000 +0100 @@ -701,6 +701,31 @@ } } +/* + * Github issue 934: commit b09aa7c6d8440e1690619239fe57e5f12374af0d introduced + * a segfault while trying to optimize key aliases allocation. + */ +static void +test_issue_934(void) +{ + struct xkb_keymap *keymap; + struct xkb_context *context = test_get_context(CONTEXT_NO_FLAG); + assert(context); + + keymap = test_compile_rules(context, XKB_KEYMAP_FORMAT_TEXT_V1, + "base", "pc104", "us", NULL, NULL); + assert(keymap); + xkb_keymap_unref(keymap); + + /* Would segfaulted before */ + keymap = test_compile_rules(context, XKB_KEYMAP_FORMAT_TEXT_V1, + "evdev", "pc104", "us", NULL, NULL); + assert(keymap); + xkb_keymap_unref(keymap); + + xkb_context_unref(context); +} + int main(void) { @@ -714,6 +739,7 @@ test_multiple_keysyms_per_level(); test_multiple_actions_per_level(); test_keynames_atoms(); + test_issue_934(); return EXIT_SUCCESS; }
