Good idea, filed RFE https://bugs.openjdk.java.net/browse/JDK-8233533 
<https://bugs.openjdk.java.net/browse/JDK-8233533>

Leonid

> On Nov 4, 2019, at 11:06 AM, Ioi Lam <ioi....@oracle.com> wrote:
> 
> Jaikiran,
> 
> My /core dir is writable by root and admin users. I am running Mojave. Is 
> your user mac ID in the admin group?
> 
> Also, do you have any issues with 
> test/hotspot/jtreg/serviceability/sa/TestJmapCore.java that also tests the 
> use of core files?
> 
> Leonid,
> 
> TestJmapCore.java and ClhsdbCDSCore.java seem to have duplicated code in 
> finding core files. Also, there's some partial logic for looking up core 
> files under test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java. Maybe 
> these should be consolidated into the test library?
> 
> Thanks
> - Ioi
> 
> On 11/4/19 9:46 AM, Leonid Mesnik wrote:
>> Hi
>> 
>> The location of core files depends on system configuration. So test tries to 
>> find core files using test output and searching core files in current 
>> directory. See details here:
>> http://hg.openjdk.java.net/jdk/jdk/file/6f98d0173a72/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java#l206
>>  
>> <http://hg.openjdk.java.net/jdk/jdk/file/6f98d0173a72/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java#l206>
>> 
>> And only if test fails to find core file then it additionally tries to 
>> generate error/skip test checking system configuration. 
>> 
>> The /cores directory usually available for all uses to dump cores like:
>> lmesnik@mymac:~/ws/ks-apps/open/test/lib$ ls -all /cores/
>> total 61448520
>> drwxrwxr-t  11 root     admin         352 Sep  5 00:24 .
>> drwxr-xr-x  34 root     wheel        1088 Oct  4 22:27 ..
>> -r--------   1 lmesnik  admin  2670608384 Aug 25 01:09 core.32410
>> ...
>> 
>> If /cores doesn't have write permissions that it is one of possible reasons 
>> why test can't find core file and fails. It fails even without this check 
>> but just with different exception in
>> http://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java#l135
>>  
>> <http://hg.openjdk.java.net/jdk/jdk/file/tip/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java#l135>
>> 
>> So I suggest you to check where core file is dumped actually, if it dumped 
>> and why test can't find it. 
>> 
>> Leonid
>> 
>>> On Nov 4, 2019, at 8:40 AM, Daniel D. Daugherty 
>>> <daniel.daughe...@oracle.com <mailto:daniel.daughe...@oracle.com>> wrote:
>>> 
>>> Moving this thread over to serviceability-dev@... since this question is
>>> about Serviceability Agent tests... Bcc'ing hotspot-dev@... so folks know
>>> that the thread moved...
>>> 
>>> 
>>> On 11/4/19 9:49 AM, Jaikiran Pai wrote:
>>>> On 04/11/19 8:11 PM, Jaikiran Pai wrote:
>>>>> ...
>>>>> Looking at the testcase itself, I see this
>>>>> http://hg.openjdk.java.net/jdk/jdk/file/6f98d0173a72/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java#l112
>>>>>  
>>>>> <http://hg.openjdk.java.net/jdk/jdk/file/6f98d0173a72/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java#l112>
>>>>> 
>>>>> if (Platform.isOSX()) {
>>>>> 
>>>>>     File coresDir = new File("/cores");
>>>>> 
>>>>>     if (!coresDir.isDirectory() || !coresDir.canWrite()) {
>>>>> 
>>>>>         throw new Error("cores is not a directory or does not have write
>>>>> permissions");
>>>>> 
>>>>> 
>>>>> I'm on OSX. So this test expects a directory called "cores" at the root
>>>>> of the filesystem? That looks odd. I don't have any such directory.
>>>> Correction - I do have that directory (my "ls" command that I previously
>>>> used to check had a typo), but that /cores directory is owned by "root"
>>>> and the test is running as a regular user.
>>>> 
>>>> -Jaikiran
>>> 
>>> $ ls -ld /cores
>>> drwxrwxr-t  2 root  admin  64 Nov  4 09:22 /cores/
>>> 
>>> so the directory on my macOSX machine is writable by group 'admin'
>>> and my login happens to belong to group 'admin'.
>>> 
>>> Dan
>> 
> 

Reply via email to