Comments (9)
I can reproduce the problem:
**412225** new/new[] failed and should throw an exception, but Valgrind
**412225** cannot throw exceptions and so is aborting instead. Sorry.
==412225== at 0x483B3CC: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==412225== by 0x483C5F5: operator new[](unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==412225== by 0x1117E0: CopyFiles(DiskImgLib::DiskFS*, int, char**) (MakeDisk.cpp:153)
==412225== by 0x111B81: Process(char const*, char const*, char const*, int, char**) (MakeDisk.cpp:303)
==412225== by 0x11136B: main (MakeDisk.cpp:376)****
The issue occurs if you try to add a directory file, which ftell
claims has a length of 0x7FFFFFFFFFFFFFFF. new[]
throws an exception, which MakeDisk doesn't handle.
The workaround is to use something like "find . -type f" to only find normal files. The proper fix is to have MakeDisk ignore directories. The simple fix is to add a 2GB file size test, which ought to be there anyway:
diff --git a/linux/MakeDisk.cpp b/linux/MakeDisk.cpp
index 38cb505..64c5af5 100644
--- a/linux/MakeDisk.cpp
+++ b/linux/MakeDisk.cpp
@@ -148,6 +148,12 @@ CopyFiles(DiskFS* pDiskFS, int argc, char** argv)
}
len = ftell(fp);
+ if (len >= 1L<<31) { // 2GB
+ fprintf(stderr, "Warning: file '%s' too large, skipping\n", *argv);
+ fclose(fp);
+ argv++;
+ continue;
+ }
rewind(fp);
buf = new char[len];
It's a hack, but MakeDisk is about 70% hack, so I'm not too worried. :-)
from ciderpress.
Yes I am. I build RPMs and DEBs. It's more consistent if I am not publishing as many downstream Patches.
from ciderpress.
I am referring down multiple directories with a wildcard, using the makedisk utility.
from ciderpress.
I am referring down multiple directories with a wildcard, using the makedisk utility.
The makedisk tool does not crash every time, only if the recursion of files are used.
from ciderpress.
I added an explicit test for "is it a regular file", as well as the length check.
from ciderpress.
Cann a micro-release be produced to fix this bug?
from ciderpress.
Sure. This doesn't affect the Windows binary, so I don't need to make a new one of those. I take it you're downloading the tarball from the releases page?
from ciderpress.
Can I contribute somehow to make a diff?
from ciderpress.
https://github.com/fadden/ciderpress/releases/tag/v4.0.5-d1a
from ciderpress.
Related Issues (20)
- Sparse files can be incompatible with GS/OS HOT 7
- Feature Request: Create subdirectory on ProDOS image HOT 2
- ERROR: jump-to-label crosses variable initialization HOT 2
- Linux Utilities / getfile HOT 3
- File Viewer window displays incorrectly on high DPI displays HOT 12
- Feature Request: Overwrite Volume in Partition Map HOT 2
- Volumes can't be unlocked once Ciderpress locks them. HOT 4
- Some HFS timestamps are off by an hour
- Arm32/Arm64 release? HOT 2
- Bad test for end of DOS T/S list
- Stop scanning DOS catalog when unused entry found
- Feature Request: Support for adding AppleSingle files to a disk image HOT 4
- Feature Request: Editing file data in the File Viewer. HOT 6
- Painfully slow access to CF card
- Pascal filesystem adds zero-length files incorrectly
- Double Hi-Res B&W output is shifted
- AppleWorks DB converter misses last record
- AppleWorks SS column generator label is wrong
- Feature Request: allow to specify DOS catalog track HOT 4
- Nibble code doesn't check data epilog bytes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ciderpress.