-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
OOM in Linux Mode #218
Comments
First of all, thank you for trying out the tool and for filing a very detailed issue 🥳 Tagging @jasocrow (one of the coauthor of the Linux mode) in case you've seen this before / you get what's going on. I'll take a look in the next few days - hopefully we can figure out what's going on :) Cheers |
In the case where you don't increase the VM memory, the OOM gets triggered before the breakpoint gets hit? Also, this bit of output seems potentially interesting; do you know where
In the next log, it looks like you do it the breakpoint but it seems to hang after the It looks like I guess one thing you can try is to manually add a Does this make sense? Cheers |
Thank you for your time. It seems that the OOM gets triggered before the breakpoint :
So our breakpoint is at Looking at the proc mapping and the symbol mapping
This is called in the TIFF *
TIFFClientOpen(
const char *name, const char *mode,
thandle_t clientdata,
TIFFReadWriteProc readproc,
TIFFReadWriteProc writeproc,
TIFFSeekProc seekproc,
TIFFCloseProc closeproc,
TIFFSizeProc sizeproc,
TIFFMapFileProc mapproc,
TIFFUnmapFileProc unmapproc)
{
static const char module[] = "TIFFClientOpen";
TIFF *tif;
int m;
const char *cp;
...
m = _TIFFgetMode(mode, module); <----- HERE
if (m == -1)
goto bad2;
tif = (TIFF *)_TIFFmalloc((tmsize_t)(sizeof(TIFF) + strlen(name) + 1));
if (tif == NULL)
{
TIFFErrorExt(clientdata, module, "%s: Out of memory (TIFF structure)", name);
goto bad2;
}
... The int _TIFFgetMode(const char *mode, const char *module)
{
int m = -1;
switch (mode[0])
{
case 'r':
m = O_RDONLY;
if (mode[1] == '+')
m = O_RDWR;
break;
case 'w':
case 'a':
m = O_RDWR | O_CREAT;
if (mode[0] == 'w')
m |= O_TRUNC;
break;
default:
TIFFErrorExt(0, module, "\"%s\": Bad mode", mode);
break;
}
return (m);
} Calling
|
All right - it'll probably easier if I make a repro environment to experiment a bit / see if I run into the same issue. Will follow your instructions. Cheers |
Okay I've successfully set-up an environment and I'm able to see what you're seeing - thanks again for the detailed instructions! Will update this issue when / once I know more. Cheers |
Hello, thanks for the great tool !
I am trying to reproduce a bug in libtiff 4.0.4 with linux mode, but I can't manage to get a proper snapshot of my VM because of an out of memory error.
Target
I downloaded and compiled libtiff with the following commands :
I then created the following GDB QEMU script :
Environment
Tested on main branch version 0.5.5 :
I created two scripts to simplify the snapshotting process :
linux_mode/libtiff/snapshot_client.sh
:linux_mode/libtiff/snapshot_server.sh
:Taking the snapshot
Launching first our server and running our program, we can successfully see our function getting break'ed on :
But then repeating the operation with the client launched :
I tried increasing the VM allocated memory size but the OOM just takes longer to come.
The client just hangs :
This may be related to my binary, but on my host I don't have this problem at all with the same command. I have no idea how to debug this issue, if you could maybe guide me ? Let me know if I forgot some context/details.
Thanks !
The text was updated successfully, but these errors were encountered: