Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in AC1032 with decompression of sections #948

Open
michal-josef-spacek opened this issue Mar 5, 2024 · 8 comments
Open

Issue in AC1032 with decompression of sections #948

michal-josef-spacek opened this issue Mar 5, 2024 · 8 comments

Comments

@michal-josef-spacek
Copy link
Contributor

Reported by @xiuweihan in #946

5172_v2.zip

Error:

=== Data Section (Section Info 2911) @2198900 ===
section_type: 0x4163003b [RLx 0]
decomp_data_size: 47892 [RL 0]
comp_data_size: 31437 [RL 0]
compression_type: 2 [RL 0]
checksum: 0xbf6ece37 [RLx 0]
ERROR: Invalid opcode 0x6 in input stream at pos 35258854
Warning: Failed to find section_info[0] with type 1
ERROR: Failed to read compressed Header section
Found no section_info[0] with type 9
ERROR: Failed to read uncompressed SummaryInfo section
Warning: Failed to find section_info[0] with type 3
ERROR: Failed to read compressed Classes section
Warning: Failed to find section_info[0] with type 7
ERROR: Failed to read compressed AcDbObjects section
Warning: Failed to find section_info[0] with type 2
ERROR: Failed to read uncompressed AuxHeader section
Found no section_info[0] with type 10
ERROR: Failed to read uncompressed Preview section
Found no section_info[0] with type 11
ERROR: Failed to read uncompressed AppInfo section
Found no section_info[0] with type 12
AppInfoHistory section not found
Found no section_info[0] with type 13
FileDepList section not found
Found no section_info[0] with type 14
Security section not found
Found no section_info[0] with type 8
RevHistory section not found
Found no section_info[0] with type 6
ObjFreeSpace section not found
Found no section_info[0] with type 5
ERROR: Template section not found

Issue is with unhandled opcode Invalid opcode 0x6 in input stream at pos 35258854

@rurban
Copy link
Contributor

rurban commented Mar 5, 2024

I think it's rather the usual "large file, section corruption bug", with lots of deleted objects.
Warning: Invalid sections: 0 != numgaps: 0 + numsections: 2910
libdxfrw also cannot read it.
ODA converts it just fine though.

To create a ACadSharp reader/writer executable will be a bit tricky. See ACadSharp.Examples

diff --git ACadSharp.Examples/Program.cs ACadSharp.Examples/Program.cs
index 70a5c9f..baf83aa 100644
--- ACadSharp.Examples/Program.cs
+++ ACadSharp.Examples/Program.cs
@@ -8,11 +8,10 @@ namespace ACadSharp.Examples
 {
 	class Program
 	{
-		const string _file = "../../../../samples/sample_AC1032.dwg";
-
 		static void Main(string[] args)
 		{
 			CadDocument doc;
+			string _file = args[0];
 			using (DwgReader reader = new DwgReader(_file))
 			{
 				doc = reader.Read();
dotnet build
ACadSharp.Examples/bin/Debug/net6.0/ACadSharp.Examples ../libredwg/ti/gh948/5172_v2.dwg

SUMMARY INFO:
	Title: 
	Subject: 
	Author: 
	Keywords: 
	Comments: 
	LastSavedBy: Xiuwe
	RevisionNumber: 
	HyperlinkBase: 
	CreatedDate: 8/24/2023 2:24:44 PM
	ModifiedDate: 3/1/2024 4:08:40 PM
...

@michal-josef-spacek
Copy link
Contributor Author

michal-josef-spacek commented Mar 5, 2024

@rurban I was looking at it.

Warning: Invalid sections: 0 != numgaps: 0 + numsections: 2910 is fixed by my previous commit. Only a bad warning.

I looked at github.com/DomCR/ACadSharp and I compared decompression. I believe that's an issue with decompression.
Yes, I could be wrong. I haven't any other similar DWG file.

@rurban
Copy link
Contributor

rurban commented Mar 5, 2024

ACadSharp

I'll also look into ACadSharp to compare. Either the sections bug or a new decompression bug.
My harddisc still giving me headaches though

@michal-josef-spacek
Copy link
Contributor Author

@rurban Is there a way how to compile and use ACadSharp on Linux?

@rurban
Copy link
Contributor

rurban commented Mar 5, 2024

@rurban Is there a way how to compile and use ACadSharp on Linux?

yes, I've fixed things for linux upstream.
you need a proper dotnet (e.g. ubuntu or fedora, not from microsoft). fc39 has net7, ubuntu22 net6.
but no idea yet how load a file, or how to debug into it

@rurban
Copy link
Contributor

rurban commented Mar 5, 2024

I'm not sure if it's the harddisc, or just too many inodes in my dir. Bigger HD arrives in 1-2 weeks, until then I can only work on small projects. There are no problems at all.
fsck -D was recommended to me for larger dirs.

Copying badblocks to my dracut initramfs, and checking the ext4fs with fsck -cc -D -y didn't help (after 17hrs). No bad disc HW, apparently my RAM upgrade with too fast RAM may corrupt the filesystem.

Update: Bought a new SDD, didn't fit in. Removed a fast DDR slot, didn't help. The BIOS slowed it to the proper speed anyway. Turns out the linux badblocks utility couldn't check for bad blocks timing out, the BIOS diagnostics did find it (after 11 hrs). So I bought a new HDD of the very same type, and will re-add the 2nd DDR slot.

@michal-josef-spacek
Copy link
Contributor Author

dotnet build
ACadSharp.Examples/bin/Debug/net6.0/ACadSharp.Examples ../libredwg/ti/gh948/5172_v2.dwg

Could you share, how to build ACadSharp on Linux?

@michal-josef-spacek
Copy link
Contributor Author

dotnet build
ACadSharp.Examples/bin/Debug/net6.0/ACadSharp.Examples ../libredwg/ti/gh948/5172_v2.dwg

Could you share, how to build ACadSharp on Linux?

Ach.. dotnet supports this .sln files, ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants