Re: Xoscope nuisance console messages on Pi4 running -current

Mark Millard via freebsd-arm <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm,gmane.os.freebsd.devel.ports
Message-ID <[email protected]>

On 2021-May-3, at 08:23, bob prohaska <fbsd at www.zefox.net> wrote:

> On Mon, May 03, 2021 at 01:00:03AM -0700, Mark Millard via freebsd-ports wrote:
> [detailed code tour omitted]
> 
>> 
>> My guess would be xoscope used a signed 32-bit type
>> that got a value with sign extension to 64 bits
>> before the value started being treated as unsigned.
>> If it had used an unsigned type instead, the padding
>> would have been a zero fill instead (presuming that
>> I've guessed right).
>> 
> 
> So this was an artifact of compiling a 32 program on a 64 bit machine?

I've no evidence that you were building the port for armv7
instead of aarch64. If you were, it would be good to report
that.

Otherwise, I expect the code produced was 64-bit (aarch64)
and the rest is just how the program's source code is set
up.

> And, perhaps unnecessary use of signed versus unsigned integers? 

That is what I expect is going on in the xoscope source code.
(I've not looked.)

> This begs two more questions: It is harmless (seemingly not always), 

I doubt that it is a problem (other than the messages). As I
wrote:

QUOTE
While I do not know the specifics for the command
and command group encoding, the truncated value
seems coherent with the code that is using it.
END QUOTE

> and would it go away if compiled and run on a 32 bit machine, say armv7?

"long int" and "int" are both 32-bits on armv7 (unsigned
or signed) so no extra 1-bits would be produced by sign
extension.

So I do not expect the messages would be generated when
executed via armv7 code.

As far as I can tell, the program likely works (ignoring
the messages) for aarch64. The messages are from the
FreeBSD you are using being a debug build with INVARIANTS
enabled. A non-debug FreeBSD build would not report the
messages.

(It is possible to buildworld for armv7 and install it
into a directory tree and use chroot into that directory
tree to run armv7 code on the RPi4's. This should not
produce the messages --and if it did then there would
be FreeBSD code to change for that kind of context.)

> Many thanks for the detailed explanation, but I'll admit not understanding
> much more than the quoted part above 8-(



===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)

_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.