-
Notifications
You must be signed in to change notification settings - Fork 155
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
Out of Memory 2^64 #450
Comments
Does the program crash? I suppose in this case you can enable core dump and ask the stack trace using the debugger. Otherwise I would enable FreeTDS logging and see the previous requests. Surely someone (FreeTDS, DBD::Sybase) is asking too much memory 😄 |
Yes the program immediately ends with "Out of Memory" as my VM has under 16 exoBytes of RAM, but it doesn't crash, it quits politely with exit code 1. I've run strace and this might be helpful?
|
I cannot understand much. The traffic is encrypted (I can see TLS data). There's no "Out of memory!" string in either FreeTDS (there's one but on an application, not a library) or DBD::Sybase source. So I suppose it could be a library (like OpenSSL) or Perl, but I cannot guarantee. Try to use logging https://www.freetds.org/userguide/logging.html. |
Thanks. I've now turned on logging. It appears to do the SELECT and then tries to set up the table in memory using token.c it then tries to allocate an insane amount of memory, fails and exits cleanly. If I remove both TEXT fields from the SELECT query it then works. The TEXT fields are coming out at 2Gb so it's possible this is having some kind of overflow error? I definitely set "text size" in /etc/freetds.conf As the memory it's trying to allocate is roughly 2^64 - 2 x 2^30 , that suggests that something odd's happening and maybe it's overflowing an int field, but my C coding is rusty. token.c:1619: name size/wsize type/wtype utype |
Looking at the code of DBD::Sybase it seems it tries to allocate memory based on |
Ah, those don't work but yes, it sounds like a bug in DBD::Sybase that may have been fixed but RHEL versions lag |
Ah, updating to the latest DBD::Sybase seems to have fixed it. Thanks for your time. Sorry it wasn't actually your problem! |
I've a script that is crashing since our Redhat Enterprise Linux updated FreeTDS to
freetds 1.3.3-1.el7.x86_64
freetds-devel 1.3.3-1.el7.x86_64
freetds-libs 1.3.3-1.el7.x86_64
I'm using it via Perl's DBD::Sybase module.
I'm aware this might be fixed in a future version, but I'm in the world of precanned Redhat packages. I might be able to arrange install-from-source if that's the fix.
The crash is... interesting. It's giving Out of Memory, and running a strace shows it's trying to allocate
18446744071562072064 bytes.
Which is... 2^64 - 2^31 + 2^12
Which is at least interesting! Some of my friends think it might be an issue with casting, but my low level coding is rusty.
The text was updated successfully, but these errors were encountered: