Return-Path: X-Original-To: apmail-openoffice-dev-archive@www.apache.org Delivered-To: apmail-openoffice-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B4A4118ED1 for ; Fri, 4 Mar 2016 12:41:24 +0000 (UTC) Received: (qmail 37995 invoked by uid 500); 4 Mar 2016 12:41:19 -0000 Delivered-To: apmail-openoffice-dev-archive@openoffice.apache.org Received: (qmail 37923 invoked by uid 500); 4 Mar 2016 12:41:19 -0000 Mailing-List: contact dev-help@openoffice.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openoffice.apache.org Delivered-To: mailing list dev@openoffice.apache.org Received: (qmail 37911 invoked by uid 99); 4 Mar 2016 12:41:19 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2016 12:41:19 +0000 Received: from mail-oi0-f44.google.com (mail-oi0-f44.google.com [209.85.218.44]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id E66761A010E for ; Fri, 4 Mar 2016 12:41:18 +0000 (UTC) Received: by mail-oi0-f44.google.com with SMTP id d205so36776953oia.0 for ; Fri, 04 Mar 2016 04:41:18 -0800 (PST) X-Gm-Message-State: AD7BkJJjxcIfiSMfVEQeS7om1BDbkimBQ5GWYfWGo21nmtzvaBKq1Luz8wPIeoFvRsDKiuWtZ/PNV4JgOlez/g== X-Received: by 10.202.216.137 with SMTP id p131mr1148208oig.30.1457095278007; Fri, 04 Mar 2016 04:41:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.76.38.168 with HTTP; Fri, 4 Mar 2016 04:40:58 -0800 (PST) In-Reply-To: <56D95C86.5010602@acm.org> References: <003c01d17323$b021a6a0$1064f3e0$@acm.org> <56D72FF5.9090307@acm.org> <00ab01d174bb$a5d0dc90$f17295b0$@acm.org> <005c01d17580$ecab0670$c6011350$@acm.org> <56D8BCC3.4070008@acm.org> <00d801d175b1$4fff2f00$effd8d00$@acm.org> <56D8E840.8050205@acm.org> <56D95C86.5010602@acm.org> From: Damjan Jovanovic Date: Fri, 4 Mar 2016 14:40:58 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Profile.c bugs (was RE: Some thoughts on the learning curve) To: Apache OO Content-Type: text/plain; charset=UTF-8 On Fri, Mar 4, 2016 at 11:59 AM, Patricia Shanahan wrote: > On 3/4/2016 12:54 AM, Damjan Jovanovic wrote: >> >> ELF binaries (Linux, *BSD) fundamentally use one of the worst ideas of >> all time: symbols are process scoped (unlike on Windows and MacOS >> where they're library scoped), meaning that symbols with the same name >> can clash even if in different libraries loaded through arbitrary >> layers of indirection. For example, compiling AOO with GCC on recent >> FreeBSD easily crashes AOO because both GCC's and Clang's C++ runtime >> libraries are loaded, their symbols clash with each other, and their >> ABIs are not fully compatible -> memory corruption -> undebuggable >> crash. Symbol map files are supposed to work around the problem >> because the UDK_3_0_0 becomes part of the symbol name and makes it >> more globally unique. >> >> I don't know if UDK_3_0_0 is correct since we are on AOO version 4 now >> (or do we version UDK differently?). > > > Embedding version numbers in source code should be done very sparingly, > because it grows old fast. > >> >> Also UNO is all good in theory, but in practice plugins can always use >> run-time dynamic linking to load any library and call any exported >> function (which the profile functions are) - even when running in a >> separate process, or written a different language (eg. JNA/BridJ for >> Java). Whether they actually do this in practice is the more important >> question. > > > I have a possibly pathetic hope that the 14 year deprecation of the > functions may have discouraged their direct use in plugins. > > main/sal/rtl/source/bootstrap.cxx uses osl::Profile().readString() in 1 place. osl::Profile found in main/sal/inc/osl/profile.hxx is a thin C++ wrapper around the C API. That seems to be the extent of the usage of the profile API in SVN trunk. I can't remember where else I found them, but on https://wiki.openoffice.org/wiki/Documentation/DevGuide/WritingUNO/Manual_Component_Installation there is a brief mention of these ini/rc files that I suspect are parsed by the profile API. Examples are in the program/ directory of the AOO installation (there is quite a few, all ending in ".ini" on Windows and "rc" elsewhere, eg. uno.ini/unorc). As for locking, all platforms can and do lock the file against access from other processes (LockFileEx on Windows, fcntl+F_SETLKW on *nix) though on *nix it is only *advisory* locking. The pthread API would only be useful to ensure thread safety within the process. I presume "bootstrapping" only happens once per process, so it can't really be multi threaded anyway? --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org For additional commands, e-mail: dev-help@openoffice.apache.org