You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@teaclave.apache.org by Zha0Chan <no...@github.com.INVALID> on 2021/03/03 14:51:59 UTC

[apache/incubator-teaclave-sgx-sdk] bug fix call sched_getaffinity result segment fault (#320)

test code
 

    from &quot;sgx_sys.edl&quot; import *;

    sgx_libc = { git = &quot;https://github.com/apache/teaclave-sgx-sdk.git&quot; }
    sgx_urts = { git = &quot;https://github.com/apache/teaclave-sgx-sdk.git&quot; }
    
    use sgx_libc::ocall::sched_getaffinity;
    use sgx_libc::cpu_set_t;
    const MAX_CPUS: usize = 64 * 1024;
    let mut buf = [0; MAX_CPUS / 8];
    unsafe {
        sched_getaffinity(0, buf.len(), &amp;mut buf as *mut _ as *mut cpu_set_t)
    };
`
Crash stack
`
(gdb) bt
#0  __memset_avx2_erms () at ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:145
#1  0x00007ffff7ae5ff7 in __GI___sched_getaffinity_new (pid=&lt;optimized out&gt;, cpusetsize=&lt;optimized out&gt;, cpuset=&lt;optimized out&gt;) at ../sysdeps/unix/sysv/linux/sched_getaffinity.c:41
#2  0x00005555555582c6 in u_sched_getaffinity_ocall ()
#3  0x0000555555556528 in Enclave_u_sched_getaffinity_ocall ()
#4  0x00007ffff7fb85cf in CEnclave::ocall(unsigned int, _ocall_table_t const*, void*) () from /usr/lib/x86_64-linux-gnu/libsgx_urts.so
#5  0x00007ffff7fb5916 in stack_sticker () from /usr/lib/x86_64-linux-gnu/libsgx_urts.so
#6  0x00007ffff6821acb in __morestack ()
#7  0x00007ffff6821acb in __morestack ()
#8  0x00007ffff6808dcd in u_sched_getaffinity_ocall ()
#9  0x00007ffff681582d in sgx_libc::linux::x86_64::ocall::sched_getaffinity ()
#10 0x00007ffff680ffde in say_something ()
#11 0x00007ffff680316f in sgx_say_something ()
#12 0x00007ffff680a643 in do_ecall ()
#13 0x00007ffff6821725 in enter_enclave ()
#14 0x00007ffff682193f in enclave_entry ()
#15 0x00007ffff7fb5845 in __morestack () from /usr/lib/x86_64-linux-gnu/libsgx_urts.so
#16 0x0000000000000000 in ?? ()

You can view, comment on, or merge this pull request online at:

  https://github.com/apache/incubator-teaclave-sgx-sdk/pull/320

-- Commit Summary --

  * bug fix

-- File Changes --

    M edl/sgx_sys.edl (4)
    M sgx_edl/edl/sgx_sys.edl (4)

-- Patch Links --

https://github.com/apache/incubator-teaclave-sgx-sdk/pull/320.patch
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/320.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/320

Re: [apache/incubator-teaclave-sgx-sdk] bug fix call sched_getaffinity result segment fault (#320)

Posted by Yu Ding <no...@github.com.INVALID>.
@volcano0dr please help. thanks!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/320#issuecomment-790283537

Re: [apache/incubator-teaclave-sgx-sdk] bug fix call sched_getaffinity result segment fault (#320)

Posted by volcano <no...@github.com.INVALID>.
Merged #320 into master.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/320#event-4406055077

Re: [apache/incubator-teaclave-sgx-sdk] bug fix call sched_getaffinity result segment fault (#320)

Posted by volcano <no...@github.com.INVALID>.
thanks @Zha0Chan  report this issue.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-teaclave-sgx-sdk/pull/320#issuecomment-790369444