- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a code block similar to this running on SDK2.13
main()
{
while(1)
{
do_work_inside_sgx()
}
}
do_work_inside_sgx()
{
SGX_FILE *fp1;
open( fp1)
write_something(fp1)
close(fp1)
open(fp1)
read_from(fp1);
use_the _date_read_from_fp1()
close(fp1)
}
The while loop in some arbitrary iteration sometimes says that "error opening file". Do you see anything wrong in the above code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We debugged the code as suggested by you and found one missing OPENSSL_free() API call in the application code which causes the issue.
This issue can be closed.
--Batsayan
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello das_batsayan,
- Did you use the Intel Protected File System Library as described in the Intel SGX Developer Reference Guide for Windows or Linux?
- Which OS are you on?
- Did you capture any returned error codes?
- Send more details on your code so we can more clearly see what it is doing.
Sincerely,
Jesus G.
Intel Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. Yes
2. Ubuntu 18.04
3. Yes, error code is 0x3001. It is SGX_ERROR_MAC_MISMATCH, found this in sgx_error.h
4. The basic code tries to read from a file in a infinite loop. First few iterations of the loop is OK, but after some time ( say after 8000th iteration of the loop) got error code 0x3001
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello das_batsayan,
Your pseudocode shows that you try to open and close the file twice within the loop. Do you know which fopen is causing the error? Have you tried doing only a single open, read, close within the loop without the write?
To aid in your debugging, you can build the SGX SDK with debug symbols and you can step into the SDK code to see exactly where that error gets generated.
It would help if you provided your actual code. If you do not want to provide the code via this public forum, let me know and I can send you a private email where you can send me your code and we can continue this troubleshooting.
Sincerely,
Jesus G.
Intel Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello das_batsayan,
Do you still need help with this issue?
Sincerely,
Jesus G.
Intel Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We debugged the code as suggested by you and found one missing OPENSSL_free() API call in the application code which causes the issue.
This issue can be closed.
--Batsayan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page