This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Incompatibility between the Android runtime and Kawa-generated field names
- From: Kay Zheng <l04m33 at gmail dot com>
- To: Per Bothner <per at bothner dot com>
- Cc: Kawa mailing list <kawa at sourceware dot org>
- Date: Thu, 31 Aug 2017 00:41:59 +0800
- Subject: Re: Incompatibility between the Android runtime and Kawa-generated field names
- Authentication-results: sourceware.org; auth=none
- References: <CAJCc8OwZacRwAD_14aWYoTSu=ozXOm5ECYovq_NeOgQ93=n-Cg@mail.gmail.com> <b318001c-6116-e815-d72d-7d67f197449d@bothner.com>
Unfortunately, the verification of the names seems to occur only when
installing an app, and I don't have access to an Android 8 device, nor
can I run an emulator at the moment.
But I did come across the official naming specification for dex files though:
https://source.android.com/devices/tech/dalvik/dex-format#membername
According to the documentation, the limitation still applies.
2017-08-31 0:24 GMT+08:00 Per Bothner <per@bothner.com>:
> On 08/30/2017 09:10 AM, Kay Zheng wrote:
>>
>> 08-30 17:57:28.998 15990 15990 W art : Failure to verify dex
>> file '/data/app/com.theerrorlog.superbapp-1/base.apk': Invalid field
>> name: '1+'
>>
>> It turned out that some class files in Kawa's standard library
>> contained fields with exotic names such as '1+', '1-',
>> '%provide%srfi-41', which seemed to be legal JVM names, but treated as
>> illegal by the ART.
>
>
> Could you check if this limitation has been fixed in the latest Android?
> If so, we could select the old "mangling" style based on a #ifdef JAVA8
> pre-processor directive.
>
>> And I noticed that the 2.4 branch used a different naming scheme that
>> "translates" these exotic names into names with "escape sequences".
>> For example '1+' will be renamed to '$N1$Pl', making the translated
>> names all legal ART names too.
>>
>> So what's the reason for abandoning the "escaping" naming scheme? Can
>> I remedy the incompatibility issue in some way?
>
>
> One reason for avoiding needless escaping is to have more readable stack
> traces.
>
> Another is the new escape scheme (which escapes many fewer characters)
> appears to be somewhat standard, and used by other languages:
> ttps://blogs.oracle.com/jrose/entry/symbolic_freedom_in_the_vm
> That means it is more like to be supported by tools such as IDEs.
> --
> --Per Bothner
> per@bothner.com http://per.bothner.com/