This is the mail archive of the ecos-bugs@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 1002144] New: pthread created from eCos thread have all signals disabled


Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1002144

            Bug ID: 1002144
           Summary: pthread created from eCos thread have all signals
                    disabled
           Product: eCos
           Version: 3.0
            Target: All
 Architecture/Host_ Other
                OS:
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: low
         Component: POSIX
          Assignee: unassigned@bugs.ecos.sourceware.org
          Reporter: ehoffman@positronaccess.com
        QA Contact: ecos-bugs@ecos.sourceware.org
                CC: ecos-bugs@ecos.sourceware.org

When creating a POSIX thread from an eCos thread (by specifying
PTHREAD_EXPLICIT_SCHED attribute and filling the appropriate attribute fields),
the pthread is created with all signals blocked.

externC void cyg_posix_thread_siginit( pthread_info *thread,
                                       pthread_info *parentthread )
{
    // Clear out signal masks
    sigemptyset( &thread->sigpending );
    // but threads inherit signal masks
    if ( NULL == parentthread ) {
        //sigemptyset( &thread->sigmask );
        // Block all the signals if thread don't use signal
                sigfillset( &thread->sigmask );
    }
    else
        thread->sigmask = parentthread->sigmask;

    cyg_pthread_exception_init( thread );
}

when parent thread is NULL (which is the case when parent is eCos thread),
sigmask is filled to "all blocked".

This probably is not in line with what a user would expect, and make porting
existing code error-prone.  User (programmer) could have some hard figuring why
the thread is not responding to signals unless explicitly unmasking them..

I would suggest using sigemptyset instead of sigfillset.

Regards,
Eric Hoffman

-- 
You are receiving this mail because:
You are the assignee for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]