broken 32 bit curl

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

broken 32 bit curl

Postby jiml8 » Jul 15th, '22, 22:42

No one here is going to fix this, and I'm about positive it is an upstream problem, so not a mageia bug. I am, however, interested in any ideas people might have.

I have been working on integrating our software package running in OpenWRT onto a 32 bit PC Engines Alix box. The box is old and no longer produced (and yes, I will be posting a similar message on the openwrt forums).

Now, I will begin by saying we are supporting our package in OpenWRT on a variety of 64 bit ARM and x86-64 platforms and in all cases the command I will show here works perfectly on those 64 bit platforms. It is, however, failing on 32 bit...and it fails identically the same way on both OpenWRT 32 bit and on Mageia 8 32 bit. It looks a lot like a buffer overflow in curl.

Basically, this command:
cat /tmp/diag.txt | curl -s -v --retry 1 --max-time 30 -X POST --data-binary '@-' "http:/mydest.com/api/diagnostics/00-0d-b9-3d-43-82"

and variants such as
curl -s -v --retry 1 --max-time 30 -X POST --data-binary "@/tmp/diag.txt" "https://myencrypteddest.com/api/diagnostics/00-0d-b9-3d-43-82"


are failing to send the file /tmp/diag.txt, which is a json file that (in my test case) is about 92K and could be as much as a couple hundred K.

The file is being sent, up to a certain point. I have not counted bytes at this time but it is somewhere around 64K that gets sent, then curl goes off the rails. Watching it in wireshark reveals that, after shipping a certain very specific number of bytes, it then starts resending, and resends a number of times until the other end tells it to shut up.

Running the same commands in a 64 bit system show the entire file being transmitted without issue.

My need to support these Alix systems is only us providing legacy support. I am not sure how many of them we have in the field right now. We are somewhat reluctant to abandon the platform, but this curl problem is critical. Does anyone have any suggestions?
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: broken 32 bit curl

Postby morgano » Jul 16th, '22, 14:56

As a workaround, can something else be used instead, i.e wget?

For the rest, not my cup of tea.

But I know that sometimes curl do not work with some mirrors/router or what the problem is anyway: https://wiki.mageia.org/en/Mageia_8_Err ... g_software, so some users will need to avoid curl for that reason anyway.
At home & work Mandriva since 2006, Mageia 2011. Thinkpad T40, T43, T60, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1489
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: broken 32 bit curl

Postby jiml8 » Jul 19th, '22, 19:12

It turns out that wget shows the identical symptoms. This has caused us to decide to drop support for our 32 bit platforms. We don't really have a choice.

This is a new generation product and a complete refactoring of the codebase, and written for FreeBSD. We had previously dropped support for 32 bit in this new system when a critical feature of FreeBSD broke on 32 bit. But, for a variety of reasons, we subsequently decided to migrate the product to Linux, and picked openwrt as a complete system that did NOT use systemd (our system is based on a controller that would fight with systemd), and then we decided we could pick up support for our oldest 32 bit systems again.

Well, I guess not. This isn't the only problem we have had with 32 bit linux; the stat() command (which, I believe, is in glibc) broke rather badly in a fashion that suggests to me that the CPU is not waiting long enough on memory to respond, or perhaps on a hardware register to report. I was able to deal with this by adding a small delay to my functions that used stat() and that took care of it. But that rather basic problem, combined with this curl problem...nope.

I think what is happening here is that 32 bit is still supported in Linux, but only passively because it "still works". I doubt anyone is testing it anymore, and support for 32 bit will drop when Linux "no longer works".

Looks to me like that time is close.
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: broken 32 bit curl

Postby morgano » Jul 19th, '22, 20:39

Hm. Mageia still runs nicely on i.e Thinkpad T43 laptops. 32 bit intel.
Good choice for dual booting when elder Windows like XP is needed for old programs.
At home & work Mandriva since 2006, Mageia 2011. Thinkpad T40, T43, T60, T400, T510, Dell M4400, M6300, Acer Aspire 7. Workstation using LVM, LUKS, VirtualBox, BOINC
morgano
 
Posts: 1489
Joined: Jun 15th, '11, 17:51
Location: Kivik, Sweden

Re: broken 32 bit curl

Postby jiml8 » Jul 19th, '22, 21:34

I think the stat() had a problem because the PC Engines Alix uses a geode processor with a slow clock. I have not tested, but I suspect the problem won't exist on a faster system.

Beyond that, it would be interesting to try the curl command I used, to upload - say - a 100 KB file to some destination. It should work with any destination, including one that doesn't know what to do with the upload, because the upload should go through completely before the destination chokes on it.

I have tested the curl and the wget on the Alix using Openwrt, and on an old 32 bit dual-core Acer I had in the closet, running Mageia 8. Same identical symptoms...identical down to the byte.

I just looked, and the Acer has an AMD CPU and Radeon graphics. Don't know if that makes any difference though.
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron