From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111782 invoked by alias); 12 Oct 2017 13:33:19 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 111773 invoked by uid 89); 12 Oct 2017 13:33:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=drops, immune, Mode, ubuntu X-HELO: EUR02-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr00050.outbound.protection.outlook.com (HELO EUR02-AM5-obe.outbound.protection.outlook.com) (40.107.0.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Oct 2017 13:33:17 +0000 Received: from AM3PR08MB0625.eurprd08.prod.outlook.com (10.163.188.151) by AM3PR08MB0628.eurprd08.prod.outlook.com (10.163.188.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 12 Oct 2017 13:33:13 +0000 Received: from AM3PR08MB0625.eurprd08.prod.outlook.com ([fe80::4cde:e2a8:f358:6844]) by AM3PR08MB0625.eurprd08.prod.outlook.com ([fe80::4cde:e2a8:f358:6844%14]) with mapi id 15.20.0077.019; Thu, 12 Oct 2017 13:33:13 +0000 From: Stephen Roberts To: Pedro Alves , "gdb@sourceware.org" CC: nd Subject: Re: GDB hangs when calling inferior functions Date: Thu, 12 Oct 2017 13:33:00 -0000 Message-ID: References: ,<3b857cc7-e722-f10f-7fea-c3928cc0ac36@redhat.com> In-Reply-To: <3b857cc7-e722-f10f-7fea-c3928cc0ac36@redhat.com> x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM3PR08MB0628;6:zx0GF4VOAN1MP8KazOmoC0d/qvk10huoGjNidCpX/IXoWAYtbIXFGrNznexeyZoiHRc+7vdw3kK6S0qDFqulVanoIl63ttuLq1rBf0VE/hWiL4M66ocwotJOZCcwsE9JG7jmVhFvfbTy58QvjtUu8KMibCmxm/2PP4wJWandQoIDnIgisX+julm28e/4gO3BQF7i3ilog8MrEpqblq9YAOq+rL0ca9kfrQnakl38akRx/FnliSPVHbSV331L9Btling7PKI3kjNe3ZL4mjPUP2SPtMcIx6+Dozmy9sgNwWRxaIh7kRg1bJ1jRLNMUOiOs4yWuPs9nEeoZ6ouliAKgg==;5:/5PqVcvZSrs/icLb8rubqCJvnGGd+eFuAyiuZ+LsUOTJZhpkJmCM1y71gjQiOBfIrgjYkJrzBciKtwc7eS9KktvjACcB5QMF0SwZctvBF0MW809YtHddzfo0ZREHq03lDZ7GLS8/auqbBsI2K55YSw==;24:IrA7mjThFELniIyIwS7jUUNWs8O03Nd4Da42JlqfGawdfRu1kh188vCmrfpykjZMzTI56VycwYjTui0r7rEuoYK1ZCNz6O9fXBGq7e3+W2I=;7:gvdzLE2X9hIsdIh2aNWzR7Ki9diUKIB4Qx2kcU6HxbeLcgv/2Q4JRjnfgB5j0DeJFj49oxzedvsDa+RyVNbsvMDPffSxcNN9Ue0AK1/m2de9nb0f2KmCxUIhFqCC4X3kQqECQLG4ahJ6SUNgMznf78q/WbfPvTAg6dl73vnONHLMeIgRtjtgKJKJ+lhe05/hwxfGL6fqmiTDKLQsIByqlzLXBeJEd1x4BVddn/QmIEs= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 792b4261-4dca-4bb1-3787-08d51175c981 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075);SRVR:AM3PR08MB0628; x-ms-traffictypediagnostic: AM3PR08MB0628: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Stephen.Roberts@arm.com; nodisclaimer: True x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:AM3PR08MB0628;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:AM3PR08MB0628; x-forefront-prvs: 04583CED1A x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(376002)(346002)(189002)(43784003)(199003)(3846002)(9686003)(4326008)(5660300001)(6246003)(53936002)(50986999)(72206003)(76176999)(54356999)(7696004)(2906002)(25786009)(5250100002)(229853002)(316002)(3280700002)(105586002)(3660700001)(110136005)(2950100002)(14454004)(6506006)(55016002)(99286003)(74316002)(2900100001)(68736007)(478600001)(97736004)(101416001)(33656002)(66066001)(106356001)(8936002)(6436002)(6116002)(102836003)(8676002)(2501003)(305945005)(81156014)(81166006)(86362001)(189998001)(7736002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR08MB0628;H:AM3PR08MB0625.eurprd08.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2017 13:33:13.1234 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR08MB0628 X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00034.txt.bz2 Hi Pedro, Thanks for your reply. Any light you could shed on this would be very much = appreciated. I did read the logs but didn't get very far as I'm not very fa= miliar with this code.=20 I've included a gdb testcase below - hopefully this format is acceptable. T= his testcase reproduces the issue around 99% of the time on my ubuntu 16.04= machine. This figure drops closer to 50% when under heavy load, which sugg= ested a race condition. I dug deeper into this and found that the threads w= hich hang are always ones which did not hit the breakpoint but were stoppe= d when another thread did hit a breakpoint. Threads which are stopped at br= eakpoints are immune to this issue. Loading the system allows more threads = to reach the breakpoint before they are stopped by gdb.=20 Thanks again, Stephen Roberts. cat > gdb-hangs-on-infcall.c << SOURCEFILE #include #include #include #define THREADCOUNT 4 pthread_barrier_t barrier; pthread_t threads[THREADCOUNT]; int thread_ids[THREADCOUNT]; // Returns the argument back, within range [0..THREADCOUNT) int get_value(int index) { return thread_ids[index]; } unsigned long fast_fib(unsigned int n) { int a =3D 0; int b =3D 1; int t; for (unsigned int i =3D 0; i < n; ++i) { t =3D b; b =3D a+b; a =3D t; } return a; } void * thread_function(void *args) { int tid =3D get_value(*((int *) args)); (void) args; int status; status =3D pthread_barrier_wait(&barrier); if (status =3D=3D PTHREAD_BARRIER_SERIAL_THREAD) { printf("All threads entering compute region\n"); } unsigned long result =3D fast_fib(100); // testmarker01=20 status =3D pthread_barrier_wait(&barrier); if (status =3D=3D PTHREAD_BARRIER_SERIAL_THREAD) { printf("All threads outputting results\n"); } pthread_barrier_wait(&barrier); printf("Thread %d Result: %lu\n", tid, result); pthread_exit(NULL); } int main(void) { int err =3D pthread_barrier_init(&barrier, NULL, THREADCOUNT);=20 // Create worker threads (main) printf("Spawining worker threads\n"); for (int tid =3D 0; tid < THREADCOUNT; ++tid) { thread_ids[tid] =3D tid; err =3D pthread_create(&threads[tid], NULL, thread_function, (void *) &= thread_ids[tid]); if (err) { fprintf(stderr, "Thread creation failed\n");=20 return EXIT_FAILURE; } } // Wait for threads to complete then exit=20 for (int tid =3D 0; tid < THREADCOUNT; ++tid) { pthread_join(threads[tid], NULL); } pthread_exit(NULL); return EXIT_SUCCESS; } SOURCEFILE $ cat > gdb-hangs-on-infcall.exp << EXPECTFILE standard_testfile .c # What compiler are we using? # if [get_compiler_info] { return -1 } if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" exe= cutable {debug}] !=3D "" } { return -1 } clean_restart ${binfile} if { ![runto main] } then { fail "run to main" return } gdb_breakpoint [gdb_get_line_number "testmarker01"] gdb_continue_to_breakpoint "testmarker01" gdb_test_no_output "set scheduler-locking on" gdb_test "show scheduler-locking" "Mode for locking scheduler during execut= ion is \"on\"." gdb_test "thread 4" "Switching to .*" gdb_test "call get_value(0)" ".* =3D 0" gdb_test "thread 3" "Switching to .*" gdb_test "call get_value(0)" ".* =3D 0" gdb_test "thread 2" "Switching to .*" gdb_test "call get_value(0)" ".* =3D 0" gdb_test "thread 1" "Switching to .*" gdb_test "call get_value(0)" ".* =3D 0" EXPECTFILE >From gdb-return-46107-listarch-gdb=sources.redhat.com@sourceware.org Fri Oct 13 10:39:24 2017 Return-Path: Delivered-To: listarch-gdb@sources.redhat.com Received: (qmail 112834 invoked by alias); 13 Oct 2017 10:39:24 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Delivered-To: mailing list gdb@sourceware.org Received: (qmail 53139 invoked by uid 89); 13 Oct 2017 10:38:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS,T_FILL_THIS_FORM_SHORT autolearn=no version=3.3.2 spammy=H*r:sk:gdb@sou, city, Person X-HELO: mail-lf0-f46.google.com Received: from mail-lf0-f46.google.com (HELO mail-lf0-f46.google.com) (209.85.215.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Oct 2017 10:38:07 +0000 Received: by mail-lf0-f46.google.com with SMTP id b190so9097731lfg.9 for ; Fri, 13 Oct 2017 03:38:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ZE0jBY0kTuzkA9QjbAsaaCANAaXkuC2KWy6tpGvfYYc=; b=SuuVm6lwHNtCDHoe+WfT80ttYbUpJwB91CmQBEkttNRTXyQ0NXXhQNeoUaP7DTLubI c5Xy182g7zyOCEVPpGmwST9mfp5bmDssvm8H2H7W1Bnv+o7Sjo70+LL/YgGeWs+JRzng rwJk1kSqxKLVfbbZt+KLK8aPIRtzyO1vqAwLmoYfw6YwNalTuV8qeXZTeCwJ6MwSjf8v /Rr0mBxv+gz/QvVYNv/5u3rLUuoLyauE3K/88gUtPL/fRf4P0TUFClKFbv2rhxrzuux8 HktBCpKvVphvFLD2ZWjO4mQifZdwBBWVJ5Zqok+IyGs6mr69q+1CmqEYWimiAEg5u3Gb y1tg== X-Gm-Message-State: AMCzsaWwSKX26w3IL+ZsZQAaHEEli93N+UyVDkN70aX9fUWdJiYL08Zw DeaATWxTRU0oCpSQZtXUT9Cxrndd X-Received: by 10.46.81.81 with SMTP id b17mr451272lje.185.1507891084763; Fri, 13 Oct 2017 03:38:04 -0700 (PDT) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com. [209.85.215.51]) by smtp.gmail.com with ESMTPSA id m17sm123915lfm.59.2017.10.13.03.38.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 03:38:04 -0700 (PDT) Received: by mail-lf0-f51.google.com with SMTP id r129so9106696lff.8 for ; Fri, 13 Oct 2017 03:38:04 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SihX79QzdLK/7xv0SxmCwgIyJQxYTuJmiBbx/uHRbpz5jAUP884AxdWP6sWPJZbdKEv2I51GIQ63ONiQOo4eA= X-Received: by 10.46.74.25 with SMTP id x25mr488470lja.83.1507891084505; Fri, 13 Oct 2017 03:38:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.125.68 with HTTP; Fri, 13 Oct 2017 03:38:04 -0700 (PDT) From: Ivo Raisr Date: Fri, 13 Oct 2017 10:39:00 -0000 X-Gmail-Original-Message-ID: Message-ID: Subject: [FOSDEM] Call for Participation: Debugging Tools DevRoom at FOSDEM 2018 To: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00035.txt.bz2 Content-length: 4582 Debugging Tools developer room at FOSDEM 2018 (Brussels, Belgium, February 3th). FOSDEM is a free software event that offers open source communities a place to meet, share ideas and collaborate. It is renown for being highly developer-oriented and brings together 5000+ hackers from all over the world. It is held in the city of Brussels (Belgium). http://fosdem.org/ FOSDEM 2018 will take place during the weekend of Saturday, February 3th and Sunday February 4th 2018. On Saturday we will have a devroom for Debugging Tools, jointly organized by the Valgrind and GDB projects. Devrooms are a place for development teams to meet, discuss, hack and publicly present the project's latest improvements and future directions. We will have a whole day to hang out together as community embracing debugging tools, such as Valgrind, gdb, RR, Infinity, radare... Please join us, regardless of whether you are a core hacker, a plugin hacker, a user, a packager or a hacker on a project that integrates, extends or complements debugging tools. ** Call for Participation We would like to organize a series of talks/discussions on various topics relevant to both core hackers, new developers, users, packagers and cross project functionality. Please do submit a talk proposal by Friday December 1st 2017, so we can make a list of activities during the day. Some possible topics for talks/discussions are: - The recently added functional changes (for users). - Get feedback on what what kinds of new functionality would be useful. Which tools and functionality users would like to see. - Discuss release/bugfixing strategy/policy (core hackers, packagers). - Connecting debugging tools together. - Latest DWARF extensions, going from binary back to source. - Multi, multi, multi... threads, processes and targets. - Debugging anything, everywhere. Dealing with complex systems. - Dealing with the dynamic loader and the kernel. - Intercepting and interposing functions and events. - Adding GDB features, such as designing GDB python scripts for your data structures. - Advances in gdbserver and the GDB remote serial protocol. - Adding Valgrind features (adding syscalls for a platform or VEX instructions for an architecture port). - Infrastructure changes to the Valgrind JIT framework. - Your interesting use case with a debugging tool. ** How to Submit There are two ways. The first one is to use the FOSDEM 'pentabarf' tool to submit your proposal: https://penta.fosdem.org/submission/FOSDEM18 - If necessary, create a Pentabarf account and activate it. Please reuse your account from previous years if you have already created it. - In the "Person" section, provide First name, Last name (in the "General" tab), Email (in the "Contact" tab) and Bio ("Abstract" field in the "Description" tab). - Submit a proposal by clicking on "Create event". - Important! Select the "Debugging Tools devroom" track (on the "General" tab). - Provide the title of your talk ("Event title" in the "General" tab). - Provide a description of the subject of the talk and the intended audience (in the "Abstract" field of the "Description" tab) - Provide a rough outline of the talk or goals of the session (a short list of bullet points covering topics that will be discussed) in the "Full description" field in the "Description" tab The second way is to email your talk proposal to valgrind-devroom-manager@fosdem.org alias. Julian, Philippe, Mark, Ivosh, and Pedro will review the proposals and organize the schedule for the day. Please feel free to suggest or discuss any ideas for the devroom on valgrind-devroom-manager@fosdem.org alias. ** Recording of Talks As usually the FOSDEM organisers plan to have live streaming and recording fully working, both for remote/later viewing of talks, and so that people can watch streams in the hallways when rooms are full. This obviously requires speakers to consent to being recorded and streamed. If you plan to be a speaker, please understand that by doing so you implicitly give consent for your talk to be recorded and streamed. The recordings will be published under the same licence as all FOSDEM content (CC-BY). Important dates: Talk/Discussion Submission deadline: Friday 1 Dec 2017 Devroom Schedule announcement: Friday 15 Dec 2017 Devroom day: Saturday 3 Feb 2018 Hope to see you all at FOSDEM 2018 in the joint Debugging Tools devroom. Brussels (Belgium), Saturday February 3th 2018. On behalf of the devroom committee, Ivo Raisr