<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 11, 2013 at 7:33 PM, Chad Versace <span dir="ltr"><<a href="mailto:chad.versace@linux.intel.com" target="_blank">chad.versace@linux.intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On 06/07/2013 02:37 AM, Alexander Monakov wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
<br>
On Thu, 6 Jun 2013, Chad Versace wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Not only is the call to trimDirectory() unnecessary,<br>
</blockquote>
<br>
Agreed, but ...<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
it also returns garbage when there is no path separator.<br>
</blockquote>
<br>
no, this doesn't sound right. Inspection of os::String::trimDirectory does<br>
not suggest anything like that might be possible: if there is no path<br>
separator in the string, rfindSep() returns end() and trimDirectory leaves the<br>
string untouched. FWIW, previous Android users have not seen this problem.<br>
<br>
I guess the patch is fine, but it would be papering over a bigger issue.<br>
</blockquote>
<br></div>
I've instrumented some logging around the call to trimDirectory in the<br>
troublesome location. Here's the code context:<br>
<br>
----<br>
proc_name = getZygoteProcessName();<br>
os::log("apitrace[%d]:%s: proc_name=\"%s\"\n", pid, __PRETTY_FUNCTION__, proc_name.str());<br>
proc_name.trimDirectory();<br>
os::log("apitrace[%d]:%s: proc_name=\"%s\"\n", pid, __PRETTY_FUNCTION__, proc_name.str());<br>
----<br>
<br>
And here's the log:<br>
<br>
----<br>
D/apitrace( 3747): apitrace:void os::String::trimDirectory(): buffer="com.forthblue.pool"<br>
D/apitrace( 3747): apitrace:void os::String::trimDirectory(): buffer="bin"<br>
----<br>
<br>
I agree with you that there exists an undiagnosed problem with trimDirectory, but I have<br>
been unsuccessful diagnosing it. On the other hand, the call to trimDirectory isn't<br>
needed and its removal fixes the bug's symptoms.</blockquote><div><br></div><div style>I pushed this, though I replaced your last paragraph with this one.</div><div style><br></div><div style>I can't see what's wrong with trimDirectory. It has been working and handling paths without separators without issues. I replicated the above case and it works fine too. It worries me that something as basic as this is not working reliably.</div>
<div style><br></div><div style>Jose</div></div></div></div>