tsujan / Arqiver

Simple Qt archive manager based on libarchive,...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

File size is determined incorrectly

shlyakpavel opened this issue · comments

Hello. I'm running Arqiver on Mac OS
In some archives file size is set to 0 for all files like on the attached screenshot while on others everything is okay.
image
You can find the problematic archive in the attachment
BullsAndCows.zip
Both archives are extracted correctly. It is so selective only when it comes to file sizes

The same archive is okay on Linux
image
BUT the other archives I could reach were okay on Mac as well as on Linux.
Can you please leave some recommendations on debugging this?

Your attached archive is opened correctly on Linux. This screenshot is taken on Manjaro (ignore the Mac-like Kvantum style):

arqiver

The most important library, based on which Arqiver works, is Linux's libarchive. My guess: libarchive is not the same on Mac

@tsujan I have tested it already on linux as mentioned here #6 (comment)

libarchive is not the same on Mac

But it works most of the time. There must be a bug either in lib archive or in Arqiver. It needs debugging. What should I start with?

Arqiver is surely not free of bugs (actually, a week ago, I found a bug, which I'll fix later) but I think if this was a problem in Arqiver, it should happen on Linux too. So, the problem is either in Mac's libarchive or in Arqiver's Mac support (which is missing. of course).

In backends.cpp, you can see these lines:

#ifdef Q_OS_LINUX
#define TAR_CMD "bsdtar"
#else
#define TAR_CMD "tar"
#endif

They are for Linux and *BSD. There's no Mac support at all.

It needs debugging. What should I start with?

I don't think there's a way: it isn't a crash with a backtrace and I don't think gdb arqiver could reveal anything. If the problem was reproducible here, I could investigate the code.

BTW, your second screenshot shows what happens when the icon set is poor. I might add a workaround for that later, although the problem isn't in the app.

Update:

Arqiver should use tar with Mac, while it uses bsdtar on Linux (which is like tar on BSD). So, it's just by chance that it works with some archives in Mac ;)

I close this because the reported behavior is expected. Tell me if you could find a good Mac support (but I think, in the case of Arqiver, it may be very difficult).

@tsujan Mac shares the same bsdtar with bsd
image
I believe the problem is more general

They are for Linux and *BSD. There's no Mac support at all.

That's what I wanna bring here

I don't think there's a way: it isn't a crash with a backtrace

It is possible to track what functions return and current variable status. I just need to know where to put breakpoints

image

I've made a breakpoint on void Backend::parseLines (QStringList& lines) It looked like wrong size is reported by bsdtar -tv -f path. Tried it manually:

image

So the only idea I have of supporting Mac is bringing new version of libarchive into the package...