1

I had the issue while running ControlPanelSample binary on intel galileo platform

asked 2015-12-11 05:09:45 -0800

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello,

I had cross compiled alljoyn standard SDK in my host machine. The binaries are also created properly.

I had copied ControlPanelSample binary and library files. (I follow the link https://allseenalliance.org/framework... ).

But when I run the binary - ControlPanelSample, I am getting following error:

ControlPanelSample: common/os/posix/Thread.cc:234: Assertion `thread != __null' failed.

Please help me for solving this issue.

Am I missing something related to thread ?

The issue is with the sigset_t datatype size. The sigset_t is used in Thread.cc file.

The size of sigset_t is 8 bytes on my host PC. But the size of the sigset_t is 128 bytes on the target platform.

The issue raised in this scenario: 1) The Thread.cc file has been compiled on the host machine with consideration of size of sigset_t is 8 bytes (This is the culprit). 2) So while running the sample application on the target platform, the function sigemptyset() takes the parameter sigset_t of 128 byte size. 3) But actual stack size allocation for this parameter (sigset_t) is 8 bytes. 4) So the stack overwriting the memory space occupied by thread variable.

So the issue comes.............

I had checked the header file sigset.h from the target platform tool-chain path. I found 3 files: ./i586-poky-linux/usr/include/bits/sigset.h ./i586-poky-linux/usr/src/debug/glibc/2.20-r0/git/sysdeps/unix/sysv/linux/bits/sigset.h ./i586-poky-linux/usr/src/debug/lib32-uclibc/0.9.33+gitAUTOINC+48a0006012-r9/git/include/bits/sigset.h

Last file is the actual which needs to be include while compiling the code.

So my question is why compiler takes different file path for sigset.h ?

edit retag flag offensive close merge delete

Comments

Please help me out to solve this issue. I had stuck in this issue since last one week.

pinkesh ( 2015-12-12 05:41:37 -0800 )edit

you should ask on the core mailing list: https://lists.allseenalliance.org/mailman/listinfo/allseen-core

ry.jones ( 2015-12-15 07:17:58 -0800 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-12-15 13:27:48 -0800

praveenb gravatar image

Here is the code from allseen/core/alljoyn/common/os/posix/Thread.cc that you are referring to:

Thread* thread(reinterpret_cast<Thread*>(arg));
sigset_t newmask;

sigemptyset(&newmask);
sigaddset(&newmask, SIGUSR1);

QCC_ASSERT(thread != NULL);

As can be seen from above, sigemptyset takes a pointer to sigset_t. Hence, your explanation of the bigger sizeof(sigset_t) doesn't seem to be likely. May be the issue is coming from some other place?

One way to debug this would be to run the unit test binary, cmtest on your target platfrom and see if ThreadTest is passing. To build cmtest binary for your platform, pass the variable GTEST_DIR to SCons, where GTEST_DIR points to unpacked googletest sources from this zip archive.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-12-11 05:09:45 -0800

Seen: 588 times

Last updated: Dec 15 '15