From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3573 invoked by alias); 23 May 2013 10:49:48 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 3564 invoked by uid 89); 23 May 2013 10:49:48 -0000 X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from relay04.alfahosting-server.de (HELO relay04.alfahosting-server.de) (109.237.142.240) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 23 May 2013 10:49:45 +0000 Received: by relay04.alfahosting-server.de (Postfix, from userid 1001) id 7AE0C32C23BF; Thu, 23 May 2013 12:49:42 +0200 (CEST) X-Spam-DCC: : Received: from alfa3017.alfahosting-server.de (alfa3017.alfahosting-server.de [109.237.140.28]) by relay04.alfahosting-server.de (Postfix) with ESMTP id 9281B32C23FD for ; Thu, 23 May 2013 12:49:40 +0200 (CEST) Received: from itrrrauch (p578a450a.dip0.t-ipconnect.de [87.138.69.10]) by alfa3017.alfahosting-server.de (Postfix) with ESMTPA id 7593429345D2 for ; Thu, 23 May 2013 12:49:40 +0200 (CEST) From: "Richard Rauch" To: Date: Thu, 23 May 2013 10:49:00 -0000 Message-ID: <001701ce57a3$3e98cc50$bbca64f0$@itrgmbh.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Virus-Checker-Version: clamassassin 1.2.4 with ClamAV 0.97.3/17262/Wed May 22 23:01:36 2013 Subject: [ECOS] Found problem in Thread class implementation X-SW-Source: 2013-05/txt/msg00044.txt.bz2 Hi, maybe I found a problem in schedulers code.... For debugging purposes I enabled some options: - CYGVAR_KERNEL_THREADS_LIST - CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT On application startup some threads should be created, but I am running in an exception. The reason of exception is located here: inline void Cyg_Thread::add_to_list( void ) { // Add thread to housekeeping list Cyg_Scheduler::lock(); if( thread_list == 0 ) list_next = this; else { Cyg_Thread *prev = thread_list; do { if ( this == prev ) break; // found it already! prev = prev->list_next; } while ( prev != thread_list ); if ( this != prev ) { // insert it in the list: list_next = thread_list->list_next; thread_list->list_next = this; } } thread_list = this; Cyg_Scheduler::unlock(); } In this loop prev becomes NULL, but there is no test on NULL, so the statement ->list_next causes an exception! Should there a test on NULL pointer only? I do not understand the reason for while loop condition: while (prev != thread_list). Should I compare to NULL here or is it more complex? Thanks Richard ITR GmbH web: http://www.itrgmbh.com email: info@itrgmbh.com -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss