After migrating from Ubuntu 20 to 24.04.1 mbfido terminates with "buffer overflow"
I tried the 1.0.8.2 mbse (recompiled on Ubuntu 24.04.1) as well as the latest 1.0.9 mbse.
It seems the buffer overflow happens while mbfido tries to communicate with mbtask.
mbtask seems to be running normally.
The strace shows the following:
[,,,]
socket(AF_UNIX, SOCK_DGRAM, 0) = 3
bind(3, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbfido58621"}, 110) = 0
getuid() = 1010
geteuid() = 1010
chmod("/opt/mbse/tmp/mbfido58621", 0775) = 0
ioctl(1, TCGETS, 0x7ffcebfd68a0) = -1 ENOTTY (Inappropriate ioctl for device)
getpid() = 58621
sendto(3, "AINI:5,58621,-,mbse,mbfido,Earth"..., 33, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, 110) = 33
recvfrom(3, "100:1,2;", 1024, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, [110 => 23]) = 8
sendto(3, "ALOG:5,debug.log,mbfido,58621, ,"..., 34, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, 110) = 34
recvfrom(3, "100:0;", 1024, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, [110 => 23]) = 6
sendto(3, "ALOG:5,system.log,mbfido,58621, "..., 35, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, 110) = 35
recvfrom(3, "100:0;", 1024, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, [110 => 23]) = 6
sendto(3, "ALOG:5,debug.log,mbfido,58621, ,"..., 46, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, 110) = 46
recvfrom(3, "100:0;", 1024, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, [110 => 23]) = 6
sendto(3, "ALOG:5,system.log,mbfido,58621, "..., 47, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, 110) = 47
recvfrom(3, "100:0;", 1024, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, [110 => 23]) = 6
sendto(3, "ALOG:5,debug.log,mbfido,58621, ,"..., 49, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, 110) = 49
recvfrom(3, "100:0;", 1024, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, [110 => 23]) = 6
sendto(3, "ALOG:5,system.log,mbfido,58621, "..., 50, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, 110) = 50
recvfrom(3, "100:0;", 1024, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, [110 => 23]) = 6
sendto(3, "DSPC:1,50;", 10, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, 110) = 10
recvfrom(3, "100:2,1,585408;", 1024, 0, {sa_family=AF_UNIX, sun_path="/opt/mbse/tmp/mbtask"}, [110 => 23]) = 15
getpid() = 58621
writev(2, [{iov_base=" ", iov_len=4}, {iov_base="buffer overflow detected", iov_len=24}, {iov_base=" : terminated\
n", iov_len=17}], 3 buffer overflow detected : terminated
) = 45
[...]
What can I do to resolve this problem?
Somebody having the same problem on a reacent Linux distro?
Best regards,
Harald
Please try using 1.1.0 as taken from the GIT code sources and advise.
No mention of code changes to mbfido has been mentioned though.
When building mbse do a make > build.log 2>build.err
checking .err first then look at .log for any errors or significant warnings.
Forgot to say - As I no longer have authority to upload the latest code archives I have not kept the files section up to date.
Thanks for your quick answer - I downloaded 1.1.0 and compiled it, however with the same result. There are lots of warnings "‘warn_unused_result’ [-Wunused-result]" in build.err, and few warnings like:
pktname.c: In function ‘prepbuf’:
pktname.c:113:38: warning: ‘%03x’ directive output may be truncated writing between 3 and 8 bytes into a region of size
7 [-Wformat-truncation=]
113 | snprintf(zpref, 8, ".%03x",addr->zone);
As I'm not a c++ programmer I can't tell if these warnings are relevant for the problem. Please see the attached build.err file ...
Best regards,
Harald
BTW, gcc version is
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
Copyright (C) 2023 Free Software Foundation, Inc.
Yes you can ingore the one's with trying to fit larger source into smaller targets. I get them all the time and doesn't affect the programs working - at least at my end.
I agree that this kind of error/warning should be fixed but all of the coders involved in mbse work mostly full time and for me at 78 in June I am getting too long in the tooth - mentally at least - looking at my own programming even in Cobol - just a lot slower than I used to be, ditto errors in my coding :(
So ignoring that type of message is there anything else that is appearing.
Now, I suggest you look closely at the set up for mbse as done in your current version unbuntu and confirm to yourself that you have not missed out anything that is needed.
And I do mean closely.
It only takes just one thing/problem/error.
There is good news - I found at least a workaround for now.
In Ubuntu 24 they increased security levels a lot, see here:
https://ubuntu.com/blog/whats-new-in-security-for-ubuntu-24-04-lts
One of the issues is preventing buffer overflows.
Setting the compiler flag -D_FORTIFY_SOURCE to "1" instead of default value "3" fixes the problem, mbse is running fine. Of course, this does not fix the root cause of the problem.
However, I fully understand that limited ressources are an obstacle for a quick fix. It's still the same for me - on Monday another working week starts.
Thanks for your support,
best regards,
Harald