[Debian-med-packaging] Bug#1153516: arb: FTBFS on 32-bit architectures: arb_progress(const char*, unsigned int) is private
Andreas Tille
tille at debian.org
Tue Nov 10 07:40:16 GMT 2026
Hi Cheng Li,
thanks a lot for your verbose explanations and the patches. Would it be
feasible for you to provide MRs. I admit I feel a bit flooded mostly
due to other issues I'm working on - so having a MR and the according
CI test would help a lot. If you prefer just sending patches to the
BTS it might take some time until I can come back to this.
Thanks again for your great help in any case
Andreas.
Am Tue, Nov 10, 2026 at 03:58:38PM +0900 schrieb Cheng Li:
> Hi Andreas,
>
> A correction to my last message, and a substantive one. This row
>
> add unsigned int ok ok
>
> was wrong in the i386 column. It came from the 20-line reproducer, not from
> a build of arb, and the reproducer did not model enough of the real header.
> I have now built arb itself on both architectures. The patch I sent you is
> incomplete; please do not apply it as it stands. The complete one is below.
>
> First, why the mistake was possible at all, because it is not only mine.
> The i386 buildd log for 7.0+ds-1 contains exactly six errors, all of them
> the two-argument form, all in the first two libraries to be built:
>
> ARB_GDE/GDE_event.cxx:363
> ARBDB/adname.cxx:181, 219, 272
> ARBDB/TreeNode.cxx:425, 458
>
> and then `make[4]: *** Waiting for unfinished jobs....`. The build dies at
> ARB_GDE.a and lib/libARBDB.so, so PROBE, NTREE and AWTI are never compiled.
> The log is a faithful record of a build that stopped early, not a list of
> everything that is wrong on ILP32. Fixing those six sites lets the build get
> further, and two more defects appear.
>
> The second one is the same mechanism, one line up in the header. There are
> two private templates, not one:
>
> template <typename NUM> arb_progress(const char *t, NUM n);
> template <typename NUM> explicit arb_progress(NUM n);
>
> I only published an `unsigned int` partner for the first. These six call
> sites pass a single `size_t` and hit the second:
>
> PROBE/PT_new_design.cxx:1269 arb_progress base_progress(2*bp);
> NTREE/NT_dbrepair.cxx:189 arb_progress progress(species_count);
> NTREE/NT_dbrepair.cxx:267 arb_progress progress(species_count);
> NTREE/NT_dbrepair.cxx:477 arb_progress progress(all);
> NTREE/NT_syncroot.cxx:140 arb_progress progress2(toSyncCount);
> NTREE/NT_tree_cmp.cxx:679 arb_progress compare_progress(steps);
>
> The third has nothing to do with arb_progress, which is why neither of us
> looked for it. AWTI/AWTI_export.cxx:208 declares a callback as
>
> static const char* fake_exported_sequence(GBDATA*, unsigned long *len,
> const char**)
>
> but its typedef at ARBDB/arbdb.h:134 is
>
> typedef const char* (*gb_export_sequence_cb)(GBDATA *gb_species,
> size_t *seq_len,
> GB_ERROR *error);
>
> On LP64 `size_t` and `unsigned long` are the same type, so this is invisible
> on amd64. On ILP32 they are not, the function pointer types are
> incompatible, and GB_set_export_sequence_hook() is rejected with
> "invalid conversion".
>
> With all three in place, the matrix. Every cell is now a real build, not a
> reproducer:
>
> amd64 i386
> 7.0+ds-1 as released ok FTBFS (buildd log)
> 282faf2, replace unsigned long FTBFS -- (your CI 10622098)
> add two-arg unsigned int only ok FTBFS (what I sent you)
> both ctors + the AWTI hook ok ok
>
> The last row is sbuild 0.89.3 in unshare mode against sid, 7.0+ds-1 plus the
> two patches below, both architectures, built today. Both finished `Status:
> successful` and produced the full set of binaries (arb, libarb, libarb-dev,
> arb-common, arb-doc). Going by buildd, the last successful i386 build was
> 6.0.6-8 on 2024-08-24, and 7.0+ds-1 is the only 7.0 attempt there, so this
> looks like the first time arb 7.0 has built on i386 at all.
>
> I did not include your RAxML8/SATIVA patch from 0a147b11, because its
> condition is `ifeq (,$(filter $(DEB_HOST_ARCH_CPU),i386 amd64))`, so it is a
> no-op on both architectures I built. For this question the tree is
> equivalent to master.
>
> The amd64 cell is the direct answer to your question about CI job 10622098:
> the added overloads do not make anything ambiguous on LP64, because a
> non-template exact match beats the private template. What broke amd64 was
> replacing the `unsigned long` overload rather than adding to it. Both have
> to stay, since call sites use both types -- ARB_GDE/GDE_arbdb_io.cxx:236
> passes the `unsigned long numberspecies` declared at GDE_arbdb_io.cxx:49.
>
> If it helps, there is a stronger statement available for amd64: the patch
> emits no different code there at all. I first built the same unpatched
> source twice, to establish that arb builds reproducibly on this machine --
> 1827 files across the .debs, byte-identical both times -- and then compared
> unpatched against patched. 43 files differ: the installed copy of
> arb_progress.h, which is the patch itself; 28 dbgsym .debug files; and 14
> binaries and libraries. In all 14, the only sections that differ are
> .note.gnu.build-id and .gnu_debuglink. .text, .rodata, .data, .bss, the
> symbol tables and the relocations are byte-identical. The build-id moves
> because the DWARF line table records arb_progress.h as two lines longer, not
> because any instruction changed.
>
> On scope, so that none of the above is read as more than it is.
>
> This is builds, not behaviour. I have not started the GUI or loaded a
> database, so nothing here says arb is usable on i386, only that it compiles,
> links and packages. There is no autopkgtest to run: arb has no debian/tests
> and no Testsuite field. dh_auto_test does execute, but arb's Makefile has no
> target it recognises, so it is a no-op. Upstream's UNIT_TESTER is off by
> default (UNIT_TESTS := 0 in config.makefile.template) and enabling it would
> be a different build configuration from the one the archive ships, so I left
> it alone. What did run, as part of the build itself, is PERL_SCRIPTS/test:
> 31 scripts, all OK on i386. I did not run piuparts.
>
> Separately, and not fixed here: the overflow-recovery path at
> CORE/arb_progress.h:188 does `overall_count = 10L*INT_MAX;` to "fake sth
> big", but on ILP32 `long` is 32 bits, so that is -10 and the recovery leaves
> the counter negative. gcc warns 82 times about it during the i386 build. It
> is pre-existing and harmless to the build; I mention it only because it is
> in the same header and someone should know.
>
> Finally, and only as an explanation rather than a complaint: the reason this
> went unnoticed is probably that c43e7f21 set
> SALSA_CI_DISABLE_BUILD_PACKAGE_I386 three weeks ago while debian/control
> stayed `Architecture: any`. The archive buildds still build i386, so the bug
> is live, but the only i386 build in the review loop is switched off. If you
> re-enable that job for this change, it will confirm the last row by itself.
>
> Patches below. The first replaces debian/patches/fix-i386-build.patch as
> committed in 282faf2; the second is new.
>
> Kind regards,
> Cheng Li
>
>
> debian/patches/fix-i386-build.patch (replaces the committed version)
> ====================================================================
>
> Description: Accept 32-bit size_t in the arb_progress constructors
> CORE/arb_progress.h rejects integer types that could overflow in caller code
> by declaring two private constructor templates, and then publishes the wanted
> types explicitly. Only `unsigned long` is published, which on LP64 happens to
> be `size_t` as well. On ILP32 `size_t` is `unsigned int`, a distinct type, so
> an exact match against the private template beats the integral conversion to
> the public overload and every call site that passes a `size_t` fails with
> "is private within this context".
> .
> Publish the `unsigned int` variant of both constructors next to the existing
> `unsigned long` ones. The `unsigned long` overloads must stay: call sites use
> both types, for instance ARB_GDE/GDE_arbdb_io.cxx:236 which passes the
> `unsigned long numberspecies` declared at GDE_arbdb_io.cxx:49.
> Author: Cheng Li <shiptux at gmail.com>
> Bug-Debian: https://bugs.debian.org/1153516
> Forwarded: no
> Last-Update: 2026-11-10
> --- a/CORE/arb_progress.h
> +++ b/CORE/arb_progress.h
> @@ -256,7 +256,9 @@
> // explicitely overload wanted ctors:
> explicit arb_progress(char *title) { setup(title, 0); }
> arb_progress(const char *title, unsigned long overall_count) { arb_assert(overall_count<=LONG_MAX); setup(title, overall_count); }
> + arb_progress(const char *title, unsigned int overall_count) { arb_assert(overall_count<=LONG_MAX); setup(title, overall_count); }
> explicit arb_progress(unsigned long overall_count) { arb_assert(overall_count<=LONG_MAX); setup(NULp, overall_count); }
> + explicit arb_progress(unsigned int overall_count) { arb_assert(overall_count<=LONG_MAX); setup(NULp, overall_count); }
>
> void allow_title_reuse() { used->allow_title_reuse(); }
>
>
> debian/patches/fix-i386-export-sequence-hook.patch (new)
> ========================================================
>
> Description: Declare the export-sequence hook with size_t, as its typedef says
> gb_export_sequence_cb (ARBDB/arbdb.h:134) takes a `size_t *seq_len`, but the
> test hook in AWTI/AWTI_export.cxx declares its second parameter as
> `unsigned long *`. On LP64 the two spellings name the same type, so this is
> invisible on amd64. On ILP32 `size_t` is `unsigned int`, the function pointer
> types are incompatible, and GB_set_export_sequence_hook() is rejected with
> "invalid conversion".
> Author: Cheng Li <shiptux at gmail.com>
> Bug-Debian: https://bugs.debian.org/1153516
> Forwarded: no
> Last-Update: 2026-11-10
> --- a/AWTI/AWTI_export.cxx
> +++ b/AWTI/AWTI_export.cxx
> @@ -205,7 +205,7 @@
> class ExportFieldScanner : public AvailableFieldScanner {
> RefPtr<GBDATA> gb_main;
>
> - static const char* fake_exported_sequence(GBDATA*, unsigned long *len, const char**) {
> + static const char* fake_exported_sequence(GBDATA*, size_t *len, const char**) {
> *len = 5;
> return "faked";
> }
>
> _______________________________________________
> Debian-med-packaging mailing list
> Debian-med-packaging at alioth-lists.debian.net
> https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-packaging
>
--
https://fam-tille.de
More information about the Debian-med-packaging
mailing list