Discussion:
Bug#1069450: socket_wrapper and the time_t 64-bit is hard
Add Reply
Andrew Bartlett
2024-04-29 01:30:01 UTC
Reply
Permalink
Just a warning that trying to brute force a fix for this is likely to
end badly. A lot of developer time was spent to get to this current
delicate situation, which relied on the narrow behaviour that is now
eliminated by the Debian time_t 64 transition rules.

Socket-wrapper starts with:

/*
* Make sure we do not redirect (f)open(at)() or fcntl() to their 64bit
* variants
*/
#undef _FILE_OFFSET_BITS

This was added in
https://gitlab.com/cwrap/socket_wrapper/-/commit/bbe14cc3200ca553b13ed49357e2e88ba487eeaa

Setting -D_FILE_OFFSET_BITS=64 will break the fcntl64 wrapper and so
break Samba's tests.

I don't know if there is a good fix for this actually.

Andrew Bartlett
Luca Boccassi
2024-07-14 14:30:01 UTC
Reply
Permalink
Post by Andrew Bartlett
Just a warning that trying to brute force a fix for this is likely to
end badly.  A lot of developer time was spent to get to this current
delicate situation, which relied on the narrow behaviour that is now
eliminated by the Debian time_t 64 transition rules.
/*
  * Make sure we do not redirect (f)open(at)() or fcntl() to their
64bit
Post by Andrew Bartlett
  * variants
  */
#undef _FILE_OFFSET_BITS
This was added in
https://gitlab.com/cwrap/socket_wrapper/-/commit/bbe14cc3200ca553b13ed49357e2e88ba487eeaa
Post by Andrew Bartlett
Setting  -D_FILE_OFFSET_BITS=64 will break the fcntl64 wrapper and so
break Samba's tests.
I don't know if there is a good fix for this actually. 
Andrew Bartlett
How about simply dropping armv7 support from socket-wrapper and uid-
wrapper? Having architectures that are actually used being blocked by
these issues is suboptimal at best
--
Kind regards,
Luca Boccassi
Chris Hofstaedtler
2024-09-23 18:00:01 UTC
Reply
Permalink
I am in the process of uploading a new upstream version into unstable
that disables armel+armhf builds.
You don't need to explicitly disable the architecutres, if your
package won't successfully build on them.
Just have the existing binaries removed from unstable and you should
be good. And downgrade this bug's severity, of course.

Chris
Chris Hofstaedtler
2024-09-24 00:10:01 UTC
Reply
Permalink
Post by Chris Hofstaedtler
I am in the process of uploading a new upstream version into unstable
that disables armel+armhf builds.
You don't need to explicitly disable the architecutres, if your
package won't successfully build on them.
Just have the existing binaries removed from unstable and you should
be good. And downgrade this bug's severity, of course.
Thanks. I'm trying to work out what the best way to proceed is. I
believe downgrading this bug report is now okay, since after the recent
1.4.3-1 upload armel/armhf is simply no longer supported, so build
failures on those archs shouldn't happen any more. I chose to keep the
bug report open as a reminder to patch upstream's code to support
armel+armhf.
Makes sense. It's good to have the build failure documented.
I used the 'Build-Depends: not-supported-on [armel armhf]' approach to
disable builds on armel and armhf for 1.4.3-1.
What would you recommend doing now? Is one or more of the following
ideas relevant? Thanks for guidance.
1) Drop the B-D hack so that instead builds on armel+armhf will just
fail forever?
Basically your choice. Some maintainers consider it cleaner to have
the "Architecture:" field list just the supported archs, or use a
"Build-Depends:" variant to fail building, or just fail building.

For architectures that are not armel or armhf I suppose it's nicer
to just fail building, as porters could then work on your package.
For armel and armhf it seems unlikely that such porters would show
up, so I wouldn't spend extra time on it.

"not-supported-on" is a bit weird as an invention, but workable. I
would probably have used "architecture-is-64-bit", as that's an
actual virtual package that has defined properties. But as said, it
doesn't really matter.
Won't that stall migration or lead to other problems?
No. A package can fail to build on most architectures, and that's
"just fine". But please see the answer to 4) below.
2) Is requesting removal of libsocket-wrapper from unstable on
armel+armhf necessary?
Yes. You need to request this by filing a bug against
ftp.debian.org.
Or will it happen automatically, since the version in unstable on
those archs are now not the latest? I don't know
the unstable cleanup policy.
It doesn't happen automatically.
3) Should I open bug reports on the packages that Build-Depends on
libsocket-wrapper armel/armhf?
Yes. I'm not sure what the severity for such bugs should be; I think
if you already made the change in unstable, then these bugs can
immediately be release critical.
What should the recommendation be? I suspect most usages of this
package is optional and not required for building, so maybe a
'Build-Depends: libsocket-wrapper [!armel !armhf]' would work?
Yeah, if it is really optional, then that would work. Otherwise the
packages build-depending on libsocket-wrapper will also have to stop
being built; again that could just be because libsocket-wrapper will
be unavailable as a Build-Depends on armel armhf, or by explicitly
failing the build in some way.
4) Are any removal requests of reverse dependencies necessary or
relevant?
Yes. You also should arrange for these removals before (or maybe
together) with the removal of libsocket-wrapper itself. One option
is to file all these bugs and have the bug for ftp.debian.org being
blocked by them.
Will libsocket-wrapper migrate to testing without that?
No.

Testing migration will be blocked upon these things:

1) as long as old versions of your package exist in testing, build
failures are considered blocking. To get rid of the old versions in
testing, you have to ask for removal from unstable (!). (This sounds
weird, but it correct.)

2) if your package has autopkgtests and they previously succeeded on
an arch that you stop building for, the now "failing" autopkgtests
*may* block testing migration. If this happens, you'll have to ask
the release team to help you. The release team documents that they
want bugs to keep track of things, but sometimes asking nicely on
IRC in #debian-release also works.

3) as long as other packages need your package, either as
(Pre-)Depends or Build-Depends, testing migration will be blocked.
These need to be fixed.


Hope that helps!

Chris
Drew Parsons
2024-07-18 15:40:01 UTC
Reply
Permalink
forwarded 1069425 https://bugzilla.samba.org/show_bug.cgi?id=15445
thanks

see also https://bugzilla.samba.org/show_bug.cgi?id=15448

Please skip test_syscall (at least on arm-32) as suggested in the
upstream issue if you think it's not a meaningful test.

This bug is holding up a long chain of packages needed by cluster
installations, which we need to run performance testing of our MPI
libraries.

Drew
Drew Parsons
2024-07-18 15:50:02 UTC
Reply
Permalink
I should be more specific. "long chain" is subjective.

Cluster installations need autofs,
which is blocked by sssd
which is blocked by this arm-32 issue with uid-wrapper.
Drew Parsons
2024-07-18 16:00:01 UTC
Reply
Permalink
Looking more closely at the fine print in the upstream issues, the issue
here refers to a different line number (and in test_syscall not
test_syscall_swap). But I guess the same principle applies for dealing
with it.
Drew Parsons
2024-07-21 21:10:01 UTC
Reply
Permalink
Just to be clear, I'm not supporting dropping armv7 support.

It's only one test that's failing. Skipping the one test (on 32-bit
arm) is all that's needed. It's passing the other tests.
Jeffrey Walton
2024-07-28 12:40:01 UTC
Reply
Permalink
Given the timing of the test failure, my guess is that uid-wrapper is a
casuality of the time_64 transition. It looks like something is amiss
with the __NR_gettimeofday system calls on 32-bit ARM.
cc:ing ARM porters. Can you advise on the 32-bit arm test failure
reported in Bug#1069425 ?
SYS_gettimeofday is returning zero time.
I've uploaded an NMU for uid-wrapper 1.3.0-5.1 to skip the syscall
gettimeofday test on __arm__, since armel and armhf are returning
tv_sec=0 from the syscall. Obviously replace the patch with a better
fix if one is identified later.
I believe that will disable the test on aarch64, too. Is that intended?

If not, then I believe you need to pivot on __arm64__, __aarch32__ and
__aarch64__, too.

Jeff
Simon Josefsson
2025-03-03 10:10:01 UTC
Reply
Permalink
Thanks for working on this! It is a bit delicate issue, and I've been
unable to find the right spell to fix things. Could you propose this as
a Salsa merge request, or at least a concrete patch? It would indeed be
nice to get this fixed and uploaded.

/Simon
(Resend to BTS only, since my last mail got rejected.)
-----Original Message-----
Hi all,
socket-wrapper still fails its tests on armel and armhf, also blocking its
(and all dependencies') migration to testing. Since trixie freeze is coming
soon, I think we should try to fix this soon.
The failed autopkgtest [1] (take test_swrap_unit as example) actually passes on
build [2]. The offending -D_FILE_OFFSET_BITS=64 (and friends) in the command line
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
execute_process(
COMMAND getconf LFS_CFLAGS
OUTPUT_VARIABLE GETCONF_LFS_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Create a list from the string
set(LFS_CFLAGS)
if (GETCONF_LFS_CFLAGS)
string(REPLACE " " ";" LFS_CFLAGS ${GETCONF_LFS_CFLAGS})
endif()
message(STATUS "Enabling large file support for tests: ${LFS_CFLAGS}")
endif()
And it is inverted (to be confirmed) by -U_FILE_OFFSET_BITS set by dpkg-buildflags
when abi=-time64 is specified when building. They are not set any more when
running autopkgtest, so things would go south.
I would recommend using consistent build flags in autopkgtest script, i.e., adding
export DEB_BUILD_MAINT_OPTIONS=abi=-time64
export CFLAGS=$(dpkg-buildflags --get CFLAGS)
export CPPFLAGS=$(dpkg-buildflags --get CPPFLAGS)
[1]: https://ci.debian.net/packages/s/socket-wrapper/testing/armhf/57471265/
[2]: https://buildd.debian.org/status/fetch.php?pkg=socket-wrapper&arch=armhf&ver=1.4.3-2&stamp=1730834460&raw=0
Simon Josefsson
2025-03-03 21:40:01 UTC
Reply
Permalink
I'm not certain this is the right approach, but we should do what it
takes to get the package into trixie. I started with an upload of
1.4.4-1 that makes the build logs a bit more verbose, which may help to
debug things more. Assuming debci still breaks, let's try your patch.
Salsa pipelines has armhf/armel builders, but not autopkgtest testing --
that would help the patch-test iteration cycle a bit.

/Simon
Hi Simon,
-----Original Message-----
Thanks for working on this! It is a bit delicate issue, and I've been
unable to find the right spell to fix things. Could you propose this as
a Salsa merge request, or at least a concrete patch? It would indeed be
nice to get this fixed and uploaded.
diff --git a/debian/tests/tests b/debian/tests/tests
index e164be5..2931d30 100755
--- a/debian/tests/tests
+++ b/debian/tests/tests
@@ -1,5 +1,10 @@
#!/bin/sh
set -e -u
+
+export DEB_BUILD_MAINT_OPTIONS=abi=-time64
+export CFLAGS=$(dpkg-buildflags --get CFLAGS)
+export CPPFLAGS=$(dpkg-buildflags --get CPPFLAGS)
+
cp -a . "$AUTOPKGTEST_TMP"
cd "$AUTOPKGTEST_TMP"
rm -rf obj debian
P.S I would also suggest using make V=1 where possible to show the actual build commands.
Simon Josefsson
2025-03-04 12:10:02 UTC
Reply
Permalink
The 1.4.4-1 upload fails the same way in debci on armel+armhf, as
expected, but now we got more debug info to look at:

https://ci.debian.net/packages/s/socket-wrapper/testing/armel/58455649/
https://ci.debian.net/packages/s/socket-wrapper/testing/armhf/58455579/

Compare with working amd64 and i386:

https://ci.debian.net/packages/s/socket-wrapper/testing/amd64/58455500/
https://ci.debian.net/packages/s/socket-wrapper/testing/i386/58455619/

I have uploaded 1.4.4-2 with your patch as the only change, let's see
what happens.

/Simon
Post by Simon Josefsson
I'm not certain this is the right approach, but we should do what it
takes to get the package into trixie. I started with an upload of
1.4.4-1 that makes the build logs a bit more verbose, which may help to
debug things more. Assuming debci still breaks, let's try your patch.
Salsa pipelines has armhf/armel builders, but not autopkgtest testing --
that would help the patch-test iteration cycle a bit.
/Simon
Hi Simon,
-----Original Message-----
Thanks for working on this! It is a bit delicate issue, and I've been
unable to find the right spell to fix things. Could you propose this as
a Salsa merge request, or at least a concrete patch? It would indeed be
nice to get this fixed and uploaded.
diff --git a/debian/tests/tests b/debian/tests/tests
index e164be5..2931d30 100755
--- a/debian/tests/tests
+++ b/debian/tests/tests
@@ -1,5 +1,10 @@
#!/bin/sh
set -e -u
+
+export DEB_BUILD_MAINT_OPTIONS=abi=-time64
+export CFLAGS=$(dpkg-buildflags --get CFLAGS)
+export CPPFLAGS=$(dpkg-buildflags --get CPPFLAGS)
+
cp -a . "$AUTOPKGTEST_TMP"
cd "$AUTOPKGTEST_TMP"
rm -rf obj debian
P.S I would also suggest using make V=1 where possible to show the actual build commands.
Simon Josefsson
2025-03-03 21:50:01 UTC
Reply
Permalink
Hi Simon,
-----Original Message-----
Thanks for working on this!  It is a bit delicate issue, and I've
been
unable to find the right spell to fix things.  Could you propose
this as
a Salsa merge request, or at least a concrete patch?  It would
indeed be
nice to get this fixed and uploaded.
As I suggested, the patch should look like (not 100% sure it would
diff --git a/debian/tests/tests b/debian/tests/tests
index e164be5..2931d30 100755
--- a/debian/tests/tests
+++ b/debian/tests/tests
@@ -1,5 +1,10 @@
 #!/bin/sh
 set -e -u
+
+export DEB_BUILD_MAINT_OPTIONS=abi=-time64
+export CFLAGS=$(dpkg-buildflags --get CFLAGS)
+export CPPFLAGS=$(dpkg-buildflags --get CPPFLAGS)
+
 cp -a . "$AUTOPKGTEST_TMP"
 cd "$AUTOPKGTEST_TMP"
 rm -rf obj debian
P.S I would also suggest using make V=1 where possible to show the
actual build commands.
The "will it work" is the key here. Like Simon, I agree it is
delicate, and I'm not entirely convinced there is actually a valid
spell.
One problem with the above is that this is the test will no longer
mimick reality: we cannot really ask that everyone adopts the same
non-time64 CFLAGS for everything they build.

At this point, I would be happy if we just got the package into trixie
and we may realize that it is somehow broken on armel/armhf. That is
better than not having it available on amd64 and arm64 at all.

/Simon
Andrew Bartlett
2025-03-03 22:00:02 UTC
Reply
Permalink
Hi Simon,
-----Original Message-----
Thanks for working on this!  It is a bit delicate issue, and I've
been
unable to find the right spell to fix things.  Could you propose
this as
a Salsa merge request, or at least a concrete patch?  It would
indeed be
nice to get this fixed and uploaded.
As I suggested, the patch should look like (not 100% sure it would
diff --git a/debian/tests/tests b/debian/tests/tests
index e164be5..2931d30 100755
--- a/debian/tests/tests
+++ b/debian/tests/tests
@@ -1,5 +1,10 @@
 #!/bin/sh
 set -e -u
+
+export DEB_BUILD_MAINT_OPTIONS=abi=-time64
+export CFLAGS=$(dpkg-buildflags --get CFLAGS)
+export CPPFLAGS=$(dpkg-buildflags --get CPPFLAGS)
+
 cp -a . "$AUTOPKGTEST_TMP"
 cd "$AUTOPKGTEST_TMP"
 rm -rf obj debian
P.S I would also suggest using make V=1 where possible to show the
actual build commands.
The "will it work" is the key here. Like Simon, I agree it is
delicate, and I'm not entirely convinced there is actually a valid
spell.

Andrew Bartlett
--
Andrew Bartlett (he/him)       https://samba.org/~abartlet/
Samba Team Member (since 2001) https://samba.org
Samba Team Lead                https://catalyst.net.nz/services/samba
Catalyst.Net Ltd

Proudly developing Samba for Catalyst.Net Ltd - a Catalyst IT group
company

Samba Development and Support: https://catalyst.net.nz/services/samba

Catalyst IT - Expert Open Source Solutions
Loading...