Closed taimurrabuske closed 9 years ago
Could be, what do mean by bigger than determined size? How big is the PSF file? Anyways all offset references in the PSF files are 32bit numbers and I think there is a maximum file size limit of 2^31 bytes.
Try compile it with debug info and run gdb on it: export CXXFLAGS="-O0 -g -pg" export CFLAGS="-O0 -g -pg" ./configure --prefix=$HOME make clean; make install
gdb python
set args yourpythoncode.py break translate_exception run
And hopefully gdb will break when the exception is thrown. And then to see the backtrace, write
bt
Hello, thanks for the help: here is the result of gdb backtrace. I will dive into the details as soon as I have some gap in the schedule.
Have a nice week.
Breakpoint 1, translate_exception (e=...) at psfpython.cc:91 91 void translate_exception(IncorrectChunk const& e) { (gdb) bt
a0=<value optimized out>, a1=<value optimized out>)
at /usr/include/boost/python/detail/translate_exception.hpp:59
boost::python::detail::translate_exception<IncorrectChunk, void
(*)(IncorrectChunk const&)>,
boost::_bi::list2<boost::python::detail::exception_handler const&,
boost::function0
boost::function0
boost::python::detail::translate_exception<IncorrectChunk, void
()(IncorrectChunk const&)>, boost::_bi::list3boost::arg<1,
boost::arg<2>, boost::_bi::value<void ()(IncorrectChunk const&)> > >,
bool, boost::python::detail::exception_handler const&,
boost::function0
boost::python::detail::exception_handler const&,
boost::function0
boost::python::handle_exception_impl(boost::function0
from /usr/lib64/libpython2.6.so.1.0
from /usr/lib64/libpython2.6.so.1.0
from /usr/lib64/libpython2.6.so.1.0
from /usr/lib64/libpython2.6.so.1.0
from /usr/lib64/libpython2.6.so.1.0
On Mon, Apr 4, 2011 at 6:43 AM, henjo reply@reply.github.com wrote:
Could be, what do mean by bigger than determined size? How big is the PSF file? Anyways all offset references in the PSF files are 32bit numbers and I think there is a maximum file size limit of 2^31 bytes.
Try compile it with debug info and run gdb on it: export CXXFLAGS="-O0 -g -pg" export CFLAGS="-O0 -g -pg" ./configure --prefix=$HOME make clean; make install
gdb python
set args yourpythoncode.py break translate_exception run
And hopefully gdb will break when the exception is thrown. And then to see the backtrace, write
bt
Reply to this email directly or view it on GitHub: https://github.com/henjo/libpsf/issues/3#comment_952628
Taimur Gibran Rabuske Kuntz Researcher at Analog and Mixed-Signal Circuits Research Unit INESC-ID - Instituto de Engenharia de Sistemas e Computadores - Investigação e Desenvolvimento
GPG keyID: D4D0FEB8 @ pgp.mit.edu
I couldn't solve the problem, but maybe declaring the offset with uint64_t variables would solve? Maybe use the code snippet below
in place of GET_INT32()?
Hi Henjo,
I played around with libpsf, but taimurgibran is right: it breaks for small to medium sized PSF files with the same bad-chunk error. It is not only files greater than 2^31 bytes (which would be pretty big 2+ GB files). It also breaks for PSF files as small as 20MB. I can send a test file if anyone wants to figure out a solution. It looks like 32-bit datatypes are pretty deeply entwined in the code, so doing something simple like changing 32 to 64 in variable declarations doesn't seem to work. I haven't spent a lot of time trying to understand the problem though.
-Paul
Hi Paul,
32-bit integers are handled by the PSFInt32Scalar class which is using the PSFScalarT template. But it's hard to say what the problem is. Please send me a data file that gives the problem. I guess the file would be small enough to send over email if it's compressed.
/Henrik
Hi Henrik,
Thanks for the response! I tried to send the test file by responding to your github email, but that message exceeded their email server's size limit. The file is 22MB, or about 10MB compressed into a .tar.gz. If you can send me your email address somehow, I can send you the test case.
-Paul
Sure, my email is henrik[@]johome[dot]net.
I finally found this problem and it was quite serious. One could not get any signals from windowed data (such as transient analysis) unless the last signal was requested :). Please try the latest version to see if the latest commit solves the problem.
Seems to work now! Thanks for the help.
Great, thanks for helping with tracking down this bug.
On Friday, October 10, 2014 09:35:41 paulswirhun wrote:
Seems to work now! Thanks for the help.
Reply to this email directly or view it on GitHub:
https://github.com/henjo/libpsf/issues/3#issuecomment-5868 1038
With files bigger than determined size, the lib returns "Invalid chunk 2147483647" when reading the psf. This number is exactly equal to 2^31−1, so maybe this has to do with using 32bit variables in referencing the file chunk pointer.