Skip to content
This repository has been archived by the owner on May 18, 2022. It is now read-only.

Error when trying to create a new fd #68

Open
PhenixH opened this issue Jan 17, 2017 · 2 comments
Open

Error when trying to create a new fd #68

PhenixH opened this issue Jan 17, 2017 · 2 comments
Assignees

Comments

@PhenixH
Copy link

PhenixH commented Jan 17, 2017

Hi,
First i want to thank for your amazing work !
I am using simuvex with angr (through Tracer/Driller). I had an issue in a specific testcase.
In this test case, I had the warning "Accessing non-existing file with fd %d. Creating a new file" from posix plugin.
And after that the process crashed because it's trying to access "cache_key" key on a string expression (solver issue).
Thanks to a debugger i found that is was trying to solve "wr" self.open("tmp_%d" % fd, "wr", preferred_fd=fd) . The solver is called here.

I "solved" temporarily my issue by using simuvex.storage.file.Flags.O_CREAT flag (integer -> no need of solving) instead of "wr".

I don't if it's the best thing to do and that is why i am asking for your help.

@rhelmot
Copy link
Member

rhelmot commented Jan 22, 2017

Hey, sorry for not following up on this. Your fix was totally right, and we pushed something along those lines. Can you verity that your issue is resolved?

@PhenixH
Copy link
Author

PhenixH commented Jan 24, 2017

Hi,
Thank you for your answer.
I tested this fix but it's not working yet, the issue is that the Flag RDWR does not allow the creation of a file due to this part of the code :
if mode == Flags.O_RDONLY or (mode & Flags.O_RDWR): try: with open(name, "r") as fp: content = fp.read() except IOError: # if the file doesn't exist return error return -1
It will return -1 and in this case is not the behaviour that I was expecting and it will generate an error instead of creating the file, because it's a read only part.

Moreover, the situation when concrete_fs is set to True, it will generate an Error and stop the process but i think is due to the fact that the error handler is still in progress in read method.

@rhelmot rhelmot assigned rhelmot and salls and unassigned rhelmot Jan 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants