pombreda / libarchive

Automatically exported from code.google.com/p/libarchive
Other
0 stars 0 forks source link

Stack overflow in test_read_format_rar_binary #321

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build RUN_TESTS using Visual Studio 2012.

What is the expected output? What do you see instead?
All tests should pass.

What version are you using?
3.1.2

On what operating system?
Windows Server 2012

How did you build?  (cmake, configure, or pre-packaged binary)
CMake

What compiler or development environment (please include version)?
Visual Studio 2012 Update 2

Please provide any additional information below.

Running Code Analysis on the libarchive_test project confirms there's a problem 
with stack usage:

"test_read_format_rar.c(661): warning : C6262: Function uses '1081364' bytes of 
stack:  exceeds /analyze:stacksize '16384'.  Consider moving some data to heap."

Original issue reported on code.google.com by bruce.c...@gmail.com on 9 Jun 2013 at 5:49

GoogleCodeExporter commented 9 years ago
Try increasing the linker stack reserve size > 4m example: /stack:5120000000

Original comment by jameshdo...@gmail.com on 29 Dec 2013 at 6:12

GoogleCodeExporter commented 9 years ago
Try the attached patch, which moves the biggest of those buffers onto the heap.

We really shouldn't be using that much stack space, not even in tests.

Similar changes can probably be applied anywhere else we're using more stack 
than we should.

Original comment by kientzle@gmail.com on 29 Dec 2013 at 6:22

Attachments:

GoogleCodeExporter commented 9 years ago
Here's a corrected version of that patch which I've just committed to 
libarchive master.

Let me know what other problems you find and we'll work through them.

Original comment by kientzle@gmail.com on 29 Dec 2013 at 6:35

Attachments: