Меню

Ошибка unable to determine

SQL Server Reporting Services, in SSRS it seems like Schedules never fire, however a look at the SQL Agent reveals a permission issue related to not being able to resolve a user account.

Seems SQL Agent does not rely on caching or whatever voodoo Windows magically works.

link text
Fix is listed here…
edit —

Above is the fix I used to workaround this issue, has any one found any other work arounds or resolutions to this issue?

It seems that by default the SSRS Generated Schedules are run as this phantom user account. How do I change this default? Is SSRS creating the jobs as the user the service runs as?

Thanks Remus

Community's user avatar

asked Dec 15, 2009 at 4:28

john.da.costa's user avatar

john.da.costajohn.da.costa

4,6324 gold badges28 silver badges30 bronze badges

1

I was running into the same issue. Here is how I fixed it.

Problem description
When setting an SSRS report subscription to run at a given time, I would wait for the time to pass and then find that the «Last Run» timestamp did not change. My subscription appears not to have run.

Relevant troubleshooting info

  1. SSRS report subscriptions are executed as SQL Jobs that the Report Server web UI creates for you behind the scenes.

  2. When looking at the job that was created for my report subscription, I saw that it always failed with the error:

    The job failed. Unable to determine if the owner (domainuserName) of job 0814588B-D590-4C45-A304-6086D5C1F559 has server access (reason: Could not obtain information about Windows NT group/user ‘domainuserName’, error code 0x5. [SQLSTATE 42000] (Error 15404)).

  3. In the Sql Server Configuration Manager I could see that the «SQL Server Reporting Services» service was configured to run using an AD user account.

  4. In the Sql Server Configuration Manager I could see that the «SQL Server» service was configured to run using a local Windows account.

  5. As @Remus Resanu pointed out, the SQL error 15404 refers to an exception when EXECUTE AS context cannot be impersonated.

Solution
Bingo! #4 and #5 are the key to the problem. The SQL Server service (a local Windows user account) was trying to authenticate the user «domainuserName» in AD, which it could not do because it does not have the right/permission to access AD resources.

I changed the SQL Server service to us an AD user account, restarted the SQL Server and SQL Server Agent services, re-ran the SQL job and, blamo, success!

answered Jul 30, 2013 at 19:04

Vince Horst's user avatar

15404 is the exception when EXECUTE AS context cannot be impersonated. Reasons for these error are plenty. The most common reasons are:

  • when the SQL Server instance does not have access to the AD server because is running as a local user or as ‘local service’ (this would have an error code 0x5, ACCESS_DENIED)
  • when the SQL Server is asked to impersonate an unknown user, like an user from a domain the SQL Server has not idea about (this would have the error code 0x54b, ERROR_NO_SUCH_DOMAIN)

The proper solution is always dependent on the error code, which is the OS error when trying to obtain the impersonated user identity token: one searches first for the error code in the System Error Codes table (or fires up windbg, does a loopback non-invasive kernel debug connection and goes !error, which is what I prefer cause is faster…).

So, John… do you actually have a question, or just posted a random piece of partial information?

answered Dec 15, 2009 at 5:13

Remus Rusanu's user avatar

Remus RusanuRemus Rusanu

285k40 gold badges429 silver badges564 bronze badges

I did 2 things and it’s now working.

1) Go to «SQL Server Configuration», change the «SQL Server Agent» — «Log On As» to match the «SQL Server» above.

enter image description here

2) Secondly, open «Microsoft SQL Management Studio», at the «SQL Server Agent», expand the «Jobs» and you should be able to see your created job. Right click on it and go to «Properties».
enter image description here

3) Change the owner to also match the «SQL Server Agent» above.
enter image description here

After, I’m able to execute the Maintenance Plan without any issue.

answered Dec 4, 2018 at 4:38

TPG's user avatar

TPGTPG

2,4911 gold badge29 silver badges49 bronze badges

Just follow this steps in images

Just follow this steps in images

answered Mar 8, 2019 at 7:32

TuanDPH's user avatar

TuanDPHTuanDPH

4614 silver badges13 bronze badges

  • Remove From My Forums
  • General discussion

  • I have jobs running on several SQL Serfer 2005 server running at or above build nimber 9.00.4229.  The jobs will run for days with out error and then we will receive the same error reported here.  When the job fails I habe just restarted the job and it will run as normal.  The SQL Server Agent is runnig with a Domain account which is a local Administrator.  The owner account for the jobs in question changes based on the DBA that built the Job/Maintenance Plan.  All DBA have Local Aministrator permissions and are also a SQL admin on the respective server. The OS is at Windows Server 2003 SP1.

    We have even changed the owned of the job to be a differant DBA account and rescheduled the job.  The job will run for a period of time and will fail with the same error for no reason.

    Does anyone have a valid solution for this issue? 

  • Remove From My Forums
  • Question

  • Hello,

    Please help me with following case,

    SQL Server 2008 Web Edition

    SQL Server Service running as -> Local System

    SQL Server Agent Service running as -> Local System

    Login as Administrator on SQL Server with Windows AUTH mode.

    Create maintenance plan called — Backup.

    Just wanted to take one database backup so select Backup Database Task.

    — User predefine -> Local Server Connection

    — Select database which I want to backup

    — Select default backup file path.

    Save plan.

    Get T-SQL and try to run under query analyzer, all working fine.. No error.

    Now I am trying to execute Maintenance Plan and I am getting following error,

    Unable to determine if the owner (x-x-x-xAdministrator) of job Backup.DB Backup has server access (reason: Could not obtain information about Windows NT group/user ‘x-x-x-xAdministrator’, error code 0x534. [SQLSTATE 42000] (Error 15404)).

    Please let me know what could be the reason?

    Thanks,

    BV

Answers

  • Hi,

    I would recommned you drop your lcoal administrator account in SQL Server (<server_instance> ->  Security ->  Logins) and recreate/add it to see if that works.

    Please let me know if that helps.


    Best Regards,
    Chunsong Feng

    Please remember to click «Mark as Answer» on the post that helps you, and to click «Unmark as Answer» if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Marked as answer by

      Sunday, March 20, 2011 9:03 AM

  • Hi,

    Please refer to the
    Pradeep Adiga’s Post that will help you to fix the issue. He has described the same type of issue in his post, as well with work arounds by updating the entry in msdb..sysdtspackages90


    Thanks & Regards, Pramilarani.R

    • Marked as answer by
      Alex Feng (SQL)
      Sunday, March 20, 2011 9:03 AM

November 1, 2013 at 12:55 pm

#300613

I get this error when executing a job on server.

The job failed. Unable to determine if the owner (domainusername) of job jobname has server access (reason: Could not obtain information about Windows NT group/user ‘domainusername’, error code 0x6e. [SQLSTATE 42000] (Error 15404)).

I typed command

EXECUTE AS LOGIN=’domainusername’

user name is a valid user name. sql server agent account not able to impersonate domain loginname to execute job

I also tried

EXECUTE AS LOGIN=SQLagentserviceaccount

This command does not fail.

It was working before till today and one fine day it broke.

Can anybosy shed light on what could have happened?

stevenb 14609

SSCommitted

Points: 1832

I haven’t looked up the error code, but at a guess, I’d say the server was unable to get information from your domain controller.

The best thing to do is to change the job owner to SA. That way, the job will never fail due to permissions like this.

mandavli

SSCrazy

Points: 2117

We have jobs that run get text files or drop text files over the server and those fail. even if I have sa.

stevenb 14609

SSCommitted

Points: 1832

That sounds like a permissions issue with the folder where you’re trying to put the text files. We’re doing something similar and we have a shared folder set up with permissions for the SQL Server agent account to be able to write to that directory. Actually, the network admin has the permissions set to allow everyone to write to the folder, which it probably shouldn’t be set to…

Anyway, take a look at the permissions on that folder. Try changing the permissions to give everyone full control to see if that fixes the problem. If it does, you can dial the permissions back to just the SQL Server account. If it doesn’t, then it’s not a permissions issue on that folder.

SillyDragon

Ten Centuries

Points: 1396

It’s post two years ago, not sure anyone else has this issue recently? I experienced this error couple of days ago but I can’t find any proper answer.

I have two jobs have been running couple of months, but the same error happened last week, I have to change the job owner to ‘sa’, job can run successfully, but it’s not what we want.

After some test and research, I am pretty sure it’s not problem of network or security setting. I found system error on server, see below for details, it’s from source NETLOGON. I believe it’s the reason. the service RPC cannot restart manually, that why we have to restart the box to resolve the problem.

(Sorry don’t know how to change the color for more clear reading)

This computer was not able to set up a secure session with a domain controller in domain XXXXXX due to the following:

The RPC server is unavailable.

This may lead to authentication problems. Make sure that this computer is connected to the network. If the problem persists, please contact your domain administrator.

ADDITIONAL INFO

If this computer is a domain controller for the specified domain, it sets up the secure session to the primary domain controller emulator in the specified domain. Otherwise, this computer sets up the secure session to any domain controller in the specified domain.

And the system error below can be found:

The processing of Group Policy failed. Windows could not obtain the name of a domain controller. This could be caused by a name resolution failure. Verify your Domain Name System (DNS) is configured and working correctly.

@nukedupe

Hi,
I get the following error:

{"type":"error","description":"Error: Unable to determine ClassLinker field offsets",
"stack":"Error: Unable to determine ClassLinker field offsetsn
    at Ye (frida/node_modules/frida-java-bridge/lib/android.js:400:1)n
    at frida/node_modules/frida-java-bridge/lib/memoize.js:4:1n
    at ze (frida/node_modules/frida-java-bridge/lib/android.js:193:1)n
    at Oe (frida/node_modules/frida-java-bridge/lib/android.js:16:1)n
    at _tryInitialize (frida/node_modules/frida-java-bridge/index.js:29:1)n
    at new _ (frida/node_modules/frida-java-bridge/index.js:21:1)n
    at Object.4../lib/android (frida/node_modules/frida-java-bridge/index.js:332:1)n
    at o (frida/node_modules/browser-pack/_prelude.js:1:1)n
    at frida/node_modules/browser-pack/_prelude.js:1:1n
    at Object.22.frida-java-bridge (frida/runtime/java.js:1:1)",
"fileName":"frida/node_modules/frida-java-bridge/lib/android.js",
"lineNumber":400,
"columnNumber":1}

Phone: Poco F3
Rom: crDroidAndroid-12.1-20220715-alioth-v8.7
frida-server version: 15.1.28

Is there a fix to this problem? Or can I somehow help narrow down and solve the problem?

@nukedupe

@xoda

Hello everyone,
Unfortunately I have the same issue here:

  • Model: Samsung Galaxy S20
  • Android: 12
  • Frida Server Version: 15.2.2

@redacted-text

Pixel 6
Android 12
Frida Server Version: 15.2.2
Same for me

@Matelasse

same here, samsung s21, android 12, oneui 4.1, frida server version 15.2.2

it was working fine a few days ago and I haven’t even done any updates, so not sure why frida-server started erroring with this message.

@nukedupe did you figure this out perhaps?

@Matelasse

@esauvisky

Actually the issue is not while getting the ClassLinker field offsets (_getArtClassLinkerSpec), rather the issue happens when getting the ClassLinker offset of the Runtime class (at _getArtRuntimeSpec). Specifically, here:

if (apiLevel >= 33 || getAndroidCodename() === 'Tiramisu') {
  classLinkerOffset = offset - (4 * pointerSize);
  jniIdManagerOffset = offset - pointerSize;
} else if (apiLevel >= 30 || getAndroidCodename() === 'R') {
  classLinkerOffset = offset - (3 * pointerSize);
  jniIdManagerOffset = offset - pointerSize;

The solution is pretty straightforward, there is a new field on the class between the ClassLinker pointer and the JavaVM used to count backwards to grab the former, therefore, it’s required to count backwards for a total amount of 4 pointer sizes instead of 3 for the devices affected, the same way it’s being done at SDK 33 or Tiramisu.

The biggest issue however, is how to / what to use for distinguishing if the device requires this new approach. At first it was assumed that the culprit would’ve been a security patch update, but in fact the issue arose alongside a «Google Play system update» dated July 1. I have seen devices from both SDK 31 and SDK 32 with and without the issue, therefore I doubt that’s any useful for deciding which of the two alternatives should be used. Also looked at most of the system props and couldn’t spot anything in particular that would make it possible to determine.

So far, I have no idea what these «Google Play system updates» really are, and if is there any programmatic way of checking it’s version or date.

@nukedupe

@esauvisky Thanks for the hint. With the small patch it works now at least until a proper solution is found but crash now with same error on injecting a script. Will try again later when I have time.

For the others who also have the problem. You can patch file with editor. In two places, the «3» must be made into a «4».

Here is my diff.

--- frida-server-15.2.2-android-arm64   2022-08-13 10:13:39.214699943 +0200
+++ frida-server-15.2.2-android-arm64-patched   2022-08-13 10:15:35.170981910 +0200
@@ -39840,7 +39840,7 @@
   for (let e = r; e !== o; e += l) {
     if (n.add(e).readPointer().equals(t)) {
       let t = null, n = null;
-      a >= 33 || "Tiramisu" === ge() ? (t = e - 4 * l, n = e - l) : a >= 30 || "R" === ge() ? (t = e - 3 * l,
+      a >= 33 || "Tiramisu" === ge() ? (t = e - 4 * l, n = e - l) : a >= 30 || "R" === ge() ? (t = e - 4 * l,
       n = e - l) : t = a >= 29 ? e - 2 * l : a >= 27 ? e - oe - 3 * l : e - oe - 2 * l;
       const r = t - l, o = r - l;
       let s;
@@ -170264,7 +170264,7 @@
   for (let e = r; e !== o; e += l) {
     if (n.add(e).readPointer().equals(t)) {
       let t = null, n = null;
-      a >= 33 || "Tiramisu" === ge() ? (t = e - 4 * l, n = e - l) : a >= 30 || "R" === ge() ? (t = e - 3 * l,
+      a >= 33 || "Tiramisu" === ge() ? (t = e - 4 * l, n = e - l) : a >= 30 || "R" === ge() ? (t = e - 4 * l,
       n = e - l) : t = a >= 29 ? e - 2 * l : a >= 27 ? e - oe - 3 * l : e - oe - 2 * l;
       const r = t - l, o = r - l;
       let s;

@ridafkih

Getting this issue as well, is there no way to rollback the Google Play Store update?

@nukedupe

@ridafkih

Does anyone here have a non-affected device that could help me test a potential identifier for this issue with?

@redacted-text

@ridafkih I found that pixel 6 flashed with earliest stock ROM does not have this issue initially, but breaks after some time. I guess, I could help

@radubogdan2k

@shinil35

Same for me, with:

Pixel 4a, Android 12 (SP2A.220505.002)
Frida client&server version 15.2.2

$ frida-ps -Ua
Failed to enumerate applications: unable to determine ClassLinker field offsets

$ frida-ps -U
Failed to enumerate processes: cannot read property 'getRunningAppProcesses' of undefined

@lucas7conta

@radubogdan2k

@esauvisky Hi, any luck with finding a way to determine if a device has this new update or not?

@ridafkih

@radubogdan2k Looking into it, I’m at a developer’s conference at the moment but will be back tomorrow. I failed to build Frida without an x86 system, so I dug up my old x86 machine and set it up before I left for the conference, once I get back I will be able to see.

Once again, if anyone has an unaffected device please let me know so we can sync-up and run some quick tests.

@SafaSafari

@bluewave41

@esauvisky

@esauvisky Hi, any luck with finding a way to determine if a device has this new update or not?

Hi, no unfortunately not, I spent quite some time on it but found nothing to distinguish. I did do several tests with affected devices of all sorts, API levels and brands, ending up on this solution:

First try an offset of 4 if «the device SDK >= 33» or if «this is the first pass/time the func was called and the SDK >= 31». Then wrap the non-memoized _getArtRuntimeSpec at the top up to the line that throws the ClassLinker error into a try/catch.

If it throws it means it’s not one of the new devices and you can assume the next pass will work as long as it uses the different offset, so immediately call the memoized getArtRuntimeSpec from the catch block but skip the offset of 4. If it doesn’t throw, just make sure you memoize it afterwards and life carries on.

This workaround is being used in production for around 2 weeks w/o any issue or regressions. I can make a PR if @oleavr wants but we both kinda agreed it’s a bit ugly and probably worth putting some time on it to find a more elegant solution.

@nukedupe

@bluewave41 Downloading binaries from an unknown dude off the internet and running as root isn’t the best idea, so I didn’t upload any binaries.
Attached are the two patches I used and the commands to compile them. I’m not saying it’s the right way, but at least it works for me.
The first attempt to compile it on Ubuntu 22.04 produced a binary that was 20MB smaller so I’m using Ubuntu 20.04. I did not investigate further the reason for the difference.
I hope I could help.

Clone frida and frida-java-bridge
Apply patches to frida-java-bridge and frida-gum
cd frida-java-bridge
npm install
cd frida
make build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc

diff --git a/bindings/gumjs/generate-runtime.py b/bindings/gumjs/generate-runtime.py
index 13d0a3f2..e2ad3e06 100755
--- a/bindings/gumjs/generate-runtime.py
+++ b/bindings/gumjs/generate-runtime.py
@@ -16,7 +16,6 @@ RELAXED_DEPS = {
 }

 EXACT_DEPS = {
-    "frida-java-bridge": "6.2.2",
     "frida-objc-bridge": "7.0.2",
     "frida-swift-bridge": "2.0.6"
 }
@@ -48,6 +47,10 @@ def generate_runtime(arch, endian, input_dir, gum_dir, capstone_incdir, libtcc_i
                            capture_output=True,
                            cwd=output_dir,
                            check=True)
+            subprocess.run([npm, "link", "frida-java-bridge"] ,
+                           capture_output=True,
+                           cwd=output_dir,
+                           check=True)
         except Exception as e:
             message = "n".join([
                 "",
diff --git a/lib/android.js b/lib/android.js
index 0ab4b5e..0cbb8cc 100644
--- a/lib/android.js
+++ b/lib/android.js
@@ -625,7 +625,7 @@ function _getArtRuntimeSpec (api) {
         classLinkerOffset = offset - (4 * pointerSize);
         jniIdManagerOffset = offset - pointerSize;
       } else if (apiLevel >= 30 || getAndroidCodename() === 'R') {
-        classLinkerOffset = offset - (3 * pointerSize);
+        classLinkerOffset = offset - (4 * pointerSize);
         jniIdManagerOffset = offset - pointerSize;
       } else if (apiLevel >= 29) {
         classLinkerOffset = offset - (2 * pointerSize);

@bluewave41

@bluewave41 Downloading binaries from an unknown dude off the internet and running as root isn’t the best idea, so I didn’t upload any binaries. Attached are the two patches I used and the commands to compile them. I’m not saying it’s the right way, but at least it works for me. The first attempt to compile it on Ubuntu 22.04 produced a binary that was 20MB smaller so I’m using Ubuntu 20.04. I did not investigate further the reason for the difference. I hope I could help.

Clone frida and frida-java-bridge Apply patches to frida-java-bridge and frida-gum cd frida-java-bridge npm install cd frida make build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc

diff --git a/bindings/gumjs/generate-runtime.py b/bindings/gumjs/generate-runtime.py
index 13d0a3f2..e2ad3e06 100755
--- a/bindings/gumjs/generate-runtime.py
+++ b/bindings/gumjs/generate-runtime.py
@@ -16,7 +16,6 @@ RELAXED_DEPS = {
 }

 EXACT_DEPS = {
-    "frida-java-bridge": "6.2.2",
     "frida-objc-bridge": "7.0.2",
     "frida-swift-bridge": "2.0.6"
 }
@@ -48,6 +47,10 @@ def generate_runtime(arch, endian, input_dir, gum_dir, capstone_incdir, libtcc_i
                            capture_output=True,
                            cwd=output_dir,
                            check=True)
+            subprocess.run([npm, "link", "frida-java-bridge"] ,
+                           capture_output=True,
+                           cwd=output_dir,
+                           check=True)
         except Exception as e:
             message = "n".join([
                 "",
diff --git a/lib/android.js b/lib/android.js
index 0ab4b5e..0cbb8cc 100644
--- a/lib/android.js
+++ b/lib/android.js
@@ -625,7 +625,7 @@ function _getArtRuntimeSpec (api) {
         classLinkerOffset = offset - (4 * pointerSize);
         jniIdManagerOffset = offset - pointerSize;
       } else if (apiLevel >= 30 || getAndroidCodename() === 'R') {
-        classLinkerOffset = offset - (3 * pointerSize);
+        classLinkerOffset = offset - (4 * pointerSize);
         jniIdManagerOffset = offset - pointerSize;
       } else if (apiLevel >= 29) {
         classLinkerOffset = offset - (2 * pointerSize);

Yes that’s very helpful. Thank you!

I’ve been pulling my hair out trying to figure out how to compile this correctly and this is exactly what I need for now to get it working. 🙂

@lbbboy

I make this patch and put it on my website

https://safasafari.ir/frida-server-arm https://safasafari.ir/frida-server-arm64

Enjoy!!

Error: Unable to determine ClassLinker field offsets
    at Ye (frida/node_modules/frida-java-bridge/lib/android.js:400)
    at <anonymous> (frida/node_modules/frida-java-bridge/lib/memoize.js:4)
    at ze (frida/node_modules/frida-java-bridge/lib/android.js:193)
    at Oe (frida/node_modules/frida-java-bridge/lib/android.js:16)
    at _tryInitialize (frida/node_modules/frida-java-bridge/index.js:29)
    at _ (frida/node_modules/frida-java-bridge/index.js:21)
    at <anonymous> (frida/node_modules/frida-java-bridge/index.js:332)
    at call (native)
    at o (/_java.js)
    at <anonymous> (/_java.js)
    at <anonymous> (frida/runtime/java.js:1)
    at call (native)
    at o (/_java.js)
    at r (/_java.js)
    at <eval> (frida/runtime/java.js:3)
    at _loadJava (native)
    at get (frida/runtime/core.js:130)
    at <anonymous> (/frida/repl-2.js:366)
```

@bluewave41

I make this patch and put it on my website
https://safasafari.ir/frida-server-arm https://safasafari.ir/frida-server-arm64
Enjoy!!

Error: Unable to determine ClassLinker field offsets
    at Ye (frida/node_modules/frida-java-bridge/lib/android.js:400)
    at <anonymous> (frida/node_modules/frida-java-bridge/lib/memoize.js:4)
    at ze (frida/node_modules/frida-java-bridge/lib/android.js:193)
    at Oe (frida/node_modules/frida-java-bridge/lib/android.js:16)
    at _tryInitialize (frida/node_modules/frida-java-bridge/index.js:29)
    at _ (frida/node_modules/frida-java-bridge/index.js:21)
    at <anonymous> (frida/node_modules/frida-java-bridge/index.js:332)
    at call (native)
    at o (/_java.js)
    at <anonymous> (/_java.js)
    at <anonymous> (frida/runtime/java.js:1)
    at call (native)
    at o (/_java.js)
    at r (/_java.js)
    at <eval> (frida/runtime/java.js:3)
    at _loadJava (native)
    at get (frida/runtime/core.js:130)
    at <anonymous> (/frida/repl-2.js:366)

You shouldn’t be downloading and executing random files. Build it with the steps provided in #2176 (comment)

@Eltion

@esauvisky , @oleavr
I think we can make the difference by checking the versionCode for the module com.android.art which can be found in /apex/apex-info-list.xml

Google Play system update: May 1, 2022

<!-- /apex/apex-info-list.xml-->
<?xml version="1.0" encoding="utf-8"?>
<apex-info-list>
    ...
    <apex-info moduleName="com.android.art" modulePath="/data/apex/decompressed/com.android.art@311713000.decompressed.apex" preinstalledModulePath="/system/apex/com.google.android.art_compressed.apex" versionCode="311713000" versionName="" isFactory="true" isActive="true" lastUpdateMillis="1516806435">
    </apex-info>
    ...
</apex-info-list>

Google Play system update: July 1, 2022

<!-- /apex/apex-info-list.xml-->
<?xml version="1.0" encoding="utf-8"?>
<apex-info-list>
    ...
    <apex-info moduleName="com.android.art" modulePath="/data/apex/active/com.android.art@330443060.apex" preinstalledModulePath="/system/apex/com.google.android.art_compressed.apex" versionCode="330443060" versionName="" isFactory="false" isActive="true" lastUpdateMillis="1661986983">
    </apex-info>
    ...
    <apex-info moduleName="com.android.art" modulePath="/system/apex/com.google.android.art_compressed.apex" preinstalledModulePath="/system/apex/com.google.android.art_compressed.apex" versionCode="311713000" versionName="" isFactory="true" isActive="false" lastUpdateMillis="1230735600">
    </apex-info>
    ...
</apex-info-list>

You can see that the new version 330443060 is now active. And the old version 311713000 is not.

Also I believe we could use functions exported from libart.so like:

_ZN3com7android4apex16readApexInfoListEPKc,
_ZNK3com7android4apex8ApexInfo14getVersionCodeEv

To read the current version code.

@spbananas

Hi, invalid address, any idea where it can come from? (with your package)

I make this patch and put it on my website

https://safasafari.ir/frida-server-arm https://safasafari.ir/frida-server-arm64

Enjoy!!

{"type":"error","description":"Error: invalid address","stack":"Error: invalid addressn at Object.value [as patchCode] (frida/runtime/core.js:203:1)n at dn (frida/node_modules/frida-java-bridge/lib/android.js:1195:1)n at un.activate (frida/node_modules/frida-java-bridge/lib/android.js:1261:1)n at _n.replace (frida/node_modules/frida-java-bridge/lib/android.js:1309:1)n at Function.set [as implementation] (frida/node_modules/frida-java-bridge/lib/class-factory.js:1017:1)n at Function.set [as implementation] (frida/node_modules/frida-java-bridge/lib/class-factory.js:932:1)n at installLaunchTimeoutRemovalInstrumentation (/internal-agent.js:435:37)n at init (/internal-agent.js:51:3)n at c.perform (frida/node_modules/frida-java-bridge/lib/vm.js:12:1)n at _performPendingVmOps (frida/node_modules/frida-java-bridge/index.js:250:1)","fileName":"frida/runtime/core.js","lineNumber":203,"columnNumber":1}

@redacted-text

make build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc

Still having same issue. Do I need to replace only server, or use patched client as well?

@knowanegg

Pixel3
Android12
same Issue

@zhouyunao

@bluewave41 Downloading binaries from an unknown dude off the internet and running as root isn’t the best idea, so I didn’t upload any binaries. Attached are the two patches I used and the commands to compile them. I’m not saying it’s the right way, but at least it works for me. The first attempt to compile it on Ubuntu 22.04 produced a binary that was 20MB smaller so I’m using Ubuntu 20.04. I did not investigate further the reason for the difference. I hope I could help.

Clone frida and frida-java-bridge Apply patches to frida-java-bridge and frida-gum cd frida-java-bridge npm install cd frida make build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc

diff --git a/bindings/gumjs/generate-runtime.py b/bindings/gumjs/generate-runtime.py
index 13d0a3f2..e2ad3e06 100755
--- a/bindings/gumjs/generate-runtime.py
+++ b/bindings/gumjs/generate-runtime.py
@@ -16,7 +16,6 @@ RELAXED_DEPS = {
 }

 EXACT_DEPS = {
-    "frida-java-bridge": "6.2.2",
     "frida-objc-bridge": "7.0.2",
     "frida-swift-bridge": "2.0.6"
 }
@@ -48,6 +47,10 @@ def generate_runtime(arch, endian, input_dir, gum_dir, capstone_incdir, libtcc_i
                            capture_output=True,
                            cwd=output_dir,
                            check=True)
+            subprocess.run([npm, "link", "frida-java-bridge"] ,
+                           capture_output=True,
+                           cwd=output_dir,
+                           check=True)
         except Exception as e:
             message = "n".join([
                 "",
diff --git a/lib/android.js b/lib/android.js
index 0ab4b5e..0cbb8cc 100644
--- a/lib/android.js
+++ b/lib/android.js
@@ -625,7 +625,7 @@ function _getArtRuntimeSpec (api) {
         classLinkerOffset = offset - (4 * pointerSize);
         jniIdManagerOffset = offset - pointerSize;
       } else if (apiLevel >= 30 || getAndroidCodename() === 'R') {
-        classLinkerOffset = offset - (3 * pointerSize);
+        classLinkerOffset = offset - (4 * pointerSize);
         jniIdManagerOffset = offset - pointerSize;
       } else if (apiLevel >= 29) {
         classLinkerOffset = offset - (2 * pointerSize);

the issue seems to solved with the solution above on Pixel 6 android 12 and the google play system update is dated July 1st ,2022.

(btw maybe add -g after npm install could help.)

@sonofphoon

Hi Guys,

Please find below the commands I used to generate a build.
It took almost 7 man hours to complete this step since there was a lack of documentation w.r.t to the building process.

Requirement:
To build a frida-server for android 12 arm64 to bypass the following error on
Error: Unable to determine ClassLinker field offsets

Reference:
#2176 (comment)

Pre-requisite:

Ubuntu 20.04.4 LTS x64

sudo apt-get install build-essential curl git lib32stdc++-9-dev 
    libc6-dev-i386 nodejs npm python3-dev python3-pip gperf

Commands:

wget https://dl.google.com/android/repository/android-ndk-r24-linux.zip
unzip android-ndk-r24-linux.zip
export ANDROID_NDK_ROOT=$(pwd)/android-ndk-r24
export PATH=$PATH:$ANDROID_NDK_ROOT
git clone https://github.com/frida/frida.git
git clone https://github.com/frida/frida-java-bridge.git
cd frida/
git submodule update --init releng/meson/
git submodule update --init frida-gum/
cd frida-gum/
sudo npm link ../../frida-java-bridge/
cd ../../frida-java-bridge
npm install
cd ..
sed -i '628s/3/4/' ./frida-java-bridge/lib/android.js
sed -i '19d' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '50i\            subprocess.run([npm, "link", "frida-java-bridge"] ,' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '51i\                           capture_output=True,' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '52i\                           cwd=output_dir,' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '53i\                           check=True)' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '1s/20220905/20220827/' ./frida/releng/deps.mk
cd frida/
make -f Makefile.sdk.mk FRIDA_HOST=android-arm64
make build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc
cd ..
ls -lh ./frida/build/frida-android-arm64/bin/frida-server
cp ./frida/build/frida-android-arm64/bin/frida-server .
adb push frida-server /data/local/tmp/
adb shell "chmod 755 /data/local/tmp/frida-server"
adb shell
su
/data/local/tmp/frida-server &
exit
pip install frida-tools
frida-ps -Ua

@ibadfawa

@knowanegg

Hi Guys,

Please find below the commands I used to generate a build. It took almost 7 man hours to complete this step since there was a lack of documentation w.r.t to the building process.

Requirement: To build a frida-server for android 12 arm64 to bypass the following error on Error: Unable to determine ClassLinker field offsets

Reference: #2176 (comment)

Pre-requisite:

Ubuntu 20.04.4 LTS x64

sudo apt-get install build-essential curl git lib32stdc++-9-dev 
    libc6-dev-i386 nodejs npm python3-dev python3-pip gperf

Commands:

git clone https://github.com/frida/frida.git
git clone https://github.com/frida/frida-java-bridge.git
cd frida/
git submodule update --init releng/meson/
git submodule update --init frida-gum/
cd frida-gum/
sudo npm link ../../frida-java-bridge/
cd ../../frida-java-bridge
npm install
cd ..
sed -i '628s/3/4/' ./frida-java-bridge/lib/android.js
sed -i '19d' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '50i\            subprocess.run([npm, "link", "frida-java-bridge"] ,' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '51i\                           capture_output=True,' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '52i\                           cwd=output_dir,' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '53i\                           check=True)' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '1s/20220905/20220827/' ./frida/releng/deps.mk
cd frida/
make -f Makefile.sdk.mk FRIDA_HOST=android-arm64
make build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc
cd ..
ls -lh ./frida/build/frida-android-arm64/bin/frida-server
cp ./frida/build/frida-android-arm64/bin/frida-server .
adb push frida-server /data/local/tmp/
adb shell "chmod 755 /data/local/tmp/frida-server"
adb shell
su
/data/local/tmp/frida-server &
exit
pip install frida-tools
frida-ps -Ua

谢谢兄弟!
Add some steps to resolve issue I met:

SyntaxError: Unexpected token ‘.’
at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)

use:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

@sh4dowb

Hi Guys,

Please find below the commands I used to generate a build. It took almost 7 man hours to complete this step since there was a lack of documentation w.r.t to the building process.

Requirement: To build a frida-server for android 12 arm64 to bypass the following error on Error: Unable to determine ClassLinker field offsets

Reference: #2176 (comment)

Pre-requisite:

Ubuntu 20.04.4 LTS x64

sudo apt-get install build-essential curl git lib32stdc++-9-dev 
    libc6-dev-i386 nodejs npm python3-dev python3-pip gperf

Commands:

git clone https://github.com/frida/frida.git
git clone https://github.com/frida/frida-java-bridge.git
cd frida/
git submodule update --init releng/meson/
git submodule update --init frida-gum/
cd frida-gum/
sudo npm link ../../frida-java-bridge/
cd ../../frida-java-bridge
npm install
cd ..
sed -i '628s/3/4/' ./frida-java-bridge/lib/android.js
sed -i '19d' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '50i\            subprocess.run([npm, "link", "frida-java-bridge"] ,' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '51i\                           capture_output=True,' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '52i\                           cwd=output_dir,' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '53i\                           check=True)' ./frida/frida-gum/bindings/gumjs/generate-runtime.py
sed -i '1s/20220905/20220827/' ./frida/releng/deps.mk
cd frida/
make -f Makefile.sdk.mk FRIDA_HOST=android-arm64
make build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc
cd ..
ls -lh ./frida/build/frida-android-arm64/bin/frida-server
cp ./frida/build/frida-android-arm64/bin/frida-server .
adb push frida-server /data/local/tmp/
adb shell "chmod 755 /data/local/tmp/frida-server"
adb shell
su
/data/local/tmp/frida-server &
exit
pip install frida-tools
frida-ps -Ua

thanks, really helpful instructions. I had to also install android ndk 24r. note that v8 engine takes ~45 mins to build, and total is around 60-70 minutes on a ubuntu 20 vm with 4 cores

will try building frida-gadget now, and might upload as well since your link is down, but still it’s gonna be untrusted. do you think the builds are re-something that produces same hash everytime?
sha256 hash:
66439bcd78528a6f4bcd964d54dfcbfae4fc7d32f43ac10fb60d7d66692426f1 build/frida-android-arm64/bin/frida-server

I’ll also try submitting a pullrequest

@Eltion

@sh4dowb before trying to do a pull request please read the comment #2176 (comment). where @esauvisky does a great job at explaining the problem.

The biggest issue however, is how to / what to use for distinguishing if the device requires this new approach. At first it was assumed that the culprit would’ve been a security patch update, but in fact the issue arose alongside a «Google Play system update» dated July 1. I have seen devices from both SDK 31 and SDK 32 with and without the issue, therefore I doubt that’s any useful for deciding which of the two alternatives should be used. Also looked at most of the system props and couldn’t spot anything in particular that would make it possible to determine.

So the patch that you’re using to build frida will only work for the devices that require this new approach and it will break it for the other ones.

@sh4dowb

@sh4dowb before trying to do a pull request please read the comment #2176 (comment). where @esauvisky does a great job at explaining the problem.

The biggest issue however, is how to / what to use for distinguishing if the device requires this new approach. At first it was assumed that the culprit would’ve been a security patch update, but in fact the issue arose alongside a «Google Play system update» dated July 1. I have seen devices from both SDK 31 and SDK 32 with and without the issue, therefore I doubt that’s any useful for deciding which of the two alternatives should be used. Also looked at most of the system props and couldn’t spot anything in particular that would make it possible to determine.

So the patch that you’re using to build frida will only work for the devices that require this new approach and it will break it for the other ones.

yeah I know, on getArtRuntimeSpec I’ll make it try with index 3, and if it throws a classlinker error, i’ll try 4. compiling now to see if it works

@sh4dowb

@sonofphoon

thanks, really helpful instructions. I had to also install android ndk 24r. note that v8 engine takes ~45 mins to build, and total is around 60-70 minutes on a ubuntu 20 vm with 4 cores

I have updated the commands in my previous comment to include the ndk 24r installation step too.
Thanks for pointing it out & thanks for the PR.

wget https://dl.google.com/android/repository/android-ndk-r24-linux.zip
unzip android-ndk-r24-linux.zip
export ANDROID_NDK_ROOT=$(pwd)/android-ndk-r24
export PATH=$PATH:$ANDROID_NDK_ROO

@Yogehi

unfortunately #2176 (comment) doesn’t work for the korean variant of the samsung s22. after running the compiled frida-server as root, the phone freezes, followed by soft rebooting. so far this has happened 100% of the time after 8 attempts.

google play system update: august 1, 2022
security patch level: august 1, 2022
build number: SP1A.210812.016.S901NKSU2AVHB
android version: 12
one ui version: 4.1

@Yogehi

I should mention that when building frida, I had to:

When pulling the frida repo, I had to specify branch version 15.2.2. when pulling the master repo, it complains that I’m not using NDK v25 / am using NDK v24.

When pulling frida-java-bridge, I had to specify branch version v6.2.2

@bigTuxer

when i try to compile the code with the commands above i run into the following error:

user@fridacompile:~/github/frida$ make build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc
make[1]: Entering directory '/home/user/github/frida'
. build/frida-env-android-arm64.rc && python3 /home/user/github/frida/releng/meson/meson.py install -C build/tmp-android-arm64/frida-core
ninja: Entering directory `/home/user/github/frida/build/tmp-android-arm64/frida-core'
[3/84] Generating src/compiler/frida-compiler-agent with a custom command
FAILED: src/compiler/agent.zip 
/home/user/github/frida/frida-core/src/compiler/generate-agent.py /home/user/github/frida/frida-core/src/compiler /home/user/github/frida/build/tmp-android-arm64/frida-core/src/compiler

> frida-compiler-agent@1.0.0 build /home/user/github/frida/build/tmp-android-arm64/frida-core/src/compiler
> frida-compile agent.ts -S -o dist/agent.js

/home/user/github/frida/build/tmp-android-arm64/frida-core/src/compiler/node_modules/frida-compile/dist/cli.js:2
import { program } from "commander";
       ^

SyntaxError: Unexpected token {
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frida-compiler-agent@1.0.0 build: `frida-compile agent.ts -S -o dist/agent.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the frida-compiler-agent@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2022-09-15T09_10_48_128Z-debug.log
Command '['npm', 'run', 'build']' returned non-zero exit status 1.
ninja: build stopped: subcommand failed.
Could not rebuild /home/user/github/frida/build/tmp-android-arm64/frida-core
make[1]: *** [Makefile.linux.mk:267: build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc] Error 255
make[1]: Leaving directory '/home/user/github/frida'
make: *** [Makefile:4: build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc] Error 2

This is a fresh installed and patched ubuntu 20.04 LTS

as mentioned by @Yogehi i’ve used the r24 of the ndk and the branch 15.2.2 of frida and v6.2.2 of frida-java-bridge

@doktorburski

My error is:
~/frida$ make build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc
[…]
glib| Dependency libffi found: YES 3.3 (overridden)
glib| Run-time dependency zlib found: YES 1.2.8
glib| Checking for function «strlcpy» : NO
glib| Program python3 found: YES (/usr/bin/python3)
glib| Program bash found: YES (/usr/bin/bash)
glib| Run-time dependency bash-completion found: NO (tried pkgconfig and cmake)
glib| Program sh found: YES (/usr/bin/sh)
glib| Program env found: YES (/usr/bin/env)
glib| Configuring glibconfig.h using configuration
glib| Dependency sysprof-capture-4 skipped: feature sysprof disabled
glib| Fetching value of define «arm» :
glib| Fetching value of define «__arm» : 1
glib| Compiler for C supports arguments -Wno-format-nonliteral: YES
glib| Compiler for C supports arguments -Wno-duplicated-branches: NO

frida-gum/subprojects/glib/glib/gnulib/meson.build:306:2: ERROR: Problem encountered: frexp() is missing or broken beyond repair, and we have nothing to replace it with

@bluewave41

when i try to compile the code with the commands above i run into the following error:

user@fridacompile:~/github/frida$ make build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc
make[1]: Entering directory '/home/user/github/frida'
. build/frida-env-android-arm64.rc && python3 /home/user/github/frida/releng/meson/meson.py install -C build/tmp-android-arm64/frida-core
ninja: Entering directory `/home/user/github/frida/build/tmp-android-arm64/frida-core'
[3/84] Generating src/compiler/frida-compiler-agent with a custom command
FAILED: src/compiler/agent.zip 
/home/user/github/frida/frida-core/src/compiler/generate-agent.py /home/user/github/frida/frida-core/src/compiler /home/user/github/frida/build/tmp-android-arm64/frida-core/src/compiler

> frida-compiler-agent@1.0.0 build /home/user/github/frida/build/tmp-android-arm64/frida-core/src/compiler
> frida-compile agent.ts -S -o dist/agent.js

/home/user/github/frida/build/tmp-android-arm64/frida-core/src/compiler/node_modules/frida-compile/dist/cli.js:2
import { program } from "commander";
       ^

SyntaxError: Unexpected token {
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frida-compiler-agent@1.0.0 build: `frida-compile agent.ts -S -o dist/agent.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the frida-compiler-agent@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2022-09-15T09_10_48_128Z-debug.log
Command '['npm', 'run', 'build']' returned non-zero exit status 1.
ninja: build stopped: subcommand failed.
Could not rebuild /home/user/github/frida/build/tmp-android-arm64/frida-core
make[1]: *** [Makefile.linux.mk:267: build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc] Error 255
make[1]: Leaving directory '/home/user/github/frida'
make: *** [Makefile:4: build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc] Error 2

This is a fresh installed and patched ubuntu 20.04 LTS

as mentioned by @Yogehi i’ve used the r24 of the ndk and the branch 15.2.2 of frida and v6.2.2 of frida-java-bridge

Are you sure you’re using the newest node.js? Do a node -v and compare the output to whats displayed on the site: https://nodejs.org/en/

If you did sudo apt-get nodejs you’ve almost certainly got a version that’ too old.

sudo apt-get install from a fresh install isn’t enough. It links to a really old package. You should find a better tutorial on Google for installing node.js on Linux.

@zikmirpassiv

frida-gum/subprojects/glib/glib/gnulib/meson.build:306:2: ERROR: Problem encountered: frexp() is missing or broken beyond repair, and we have nothing to replace it with

A full log can be found at /home/zikmr/frida/build/tmp-android-arm/frida-gum/meson-logs/meson-log.txt
make[1]: *** [Makefile.linux.mk:111: build/frida-android-arm/lib/pkgconfig/frida-gum-1.0.pc] Error 1
make[1]: Leaving directory ‘/home/zikmr/frida’
make: *** [Makefile:4: build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc] Error 2

Seems to break down here. Any clues?

@zikmirpassiv

My error is: ~/frida$ make build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc […] glib| Dependency libffi found: YES 3.3 (overridden) glib| Run-time dependency zlib found: YES 1.2.8 glib| Checking for function «strlcpy» : NO glib| Program python3 found: YES (/usr/bin/python3) glib| Program bash found: YES (/usr/bin/bash) glib| Run-time dependency bash-completion found: NO (tried pkgconfig and cmake) glib| Program sh found: YES (/usr/bin/sh) glib| Program env found: YES (/usr/bin/env) glib| Configuring glibconfig.h using configuration glib| Dependency sysprof-capture-4 skipped: feature sysprof disabled glib| Fetching value of define «arm» : glib| Fetching value of define «__arm» : 1 glib| Compiler for C supports arguments -Wno-format-nonliteral: YES glib| Compiler for C supports arguments -Wno-duplicated-branches: NO

frida-gum/subprojects/glib/glib/gnulib/meson.build:306:2: ERROR: Problem encountered: frexp() is missing or broken beyond repair, and we have nothing to replace it with

Same issue, frexp() is missing or something.

@bigTuxer

@bluewave41 Thanks a lot 🙂 that was the hint i needed
My mistake was to follow blind the instructions from above.

That was a stoneage version: 10.19.0.
I’ve just uninstalled it and installed the LTS version with snap and now i was able to compile it.

I had also a look into the Makefiles and as i just needed the patched frida-server that make was the trick to reduce the build time under 5 mins: make core-android-arm64

@sh4dowb

applying this patch, frida-gadget does not work. any ideas?

Abort message: 'Check failed: old_state_and_flags.GetState() != ThreadState::kRunnable (old_state_and_flags.GetState()=Runnable, ThreadState::kRunnable=Runnable) Native Thread[1,tid=28224,Runnable,Thread*=0xe82cxxxx,peer=0x731fxxxx,"main"] Thread[1,tid=28224,Runnable,Thread*=0xe82cxxxx,peer=0x731fxxxx,"main"]'

patched frida-server works just fine.

@amitalokbera

@sh4dowb if possible can you please share the patch frida-server file

@esauvisky

applying this patch, frida-gadget does not work. any ideas?

Abort message: 'Check failed: old_state_and_flags.GetState() != ThreadState::kRunnable (old_state_and_flags.GetState()=Runnable, ThreadState::kRunnable=Runnable) Native Thread[1,tid=28224,Runnable,Thread*=0xe82cxxxx,peer=0x731fxxxx,"main"] Thread[1,tid=28224,Runnable,Thread*=0xe82cxxxx,peer=0x731fxxxx,"main"]'

patched frida-server works just fine.

This is most likely a completely different issue, because we are yet again getting several reports in an upward trend of this GetState() error, even for users in which the patch for the ClassLinker did solve it for some time. Moreover, we don’t even use frida-gadget.

I’ve seen at least another two new different issues on the java bridge as well (besides the two above). It feels like Google has been doing several changes on the art runtime lately and pushing them via these «Google Play Services updates. @oleavr if this trend continues maybe we should rethink how we get these offsets, at the very least do something more robust like @Eltion suggested or we might end up with a try/catch rabbit hole 😅

@sh4dowb I’d open a separate issue on the GetState error for the time being. Once I get ahold of some tech savy user that has a device with it, I might be able to investigate further.

@brunomcuesta

Hi!
I had the same error when using frida-server on Android 12.
I’m trying to compile following the tips posted in this open issue, but I get this Typescript error. Compilation fails due to this error.

[!] Error: Cannot load plugin "typescript": Not supported.

frida-core 1.0.0

  User defined options
    Cross files    : build/frida-android-arm64.txt
    Native files   : build/frida-linux-x86_64.txt
    default_library: static
    libdir         : /home/bruno/Pentest/Frida/frida/build/frida-android-arm64/lib
    optimization   : s
    prefix         : /home/bruno/Pentest/Frida/frida/build/frida-android-arm64
    strip          : True
    b_ndebug       : true
    agent_legacy   : /home/bruno/Pentest/Frida/frida/build/tmp-android-arm/frida-core/lib/agent/frida-agent.so
    agent_modern   : /home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core/lib/agent/frida-agent.so
    connectivity   : enabled
    helper_legacy  : /home/bruno/Pentest/Frida/frida/build/tmp-android-arm/frida-core/src/frida-helper
    helper_modern  : /home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core/src/frida-helper
    mapper         : auto

Found ninja-1.10.2 at /home/bruno/Pentest/Frida/frida/build/toolchain-linux-x86_64/bin/ninja
. build/frida-env-android-arm64.rc && ninja -C build/tmp-android-arm64/frida-core src/frida-helper lib/agent/frida-agent.so
ninja: Entering directory `build/tmp-android-arm64/frida-core'
[51/51] Generating lib/agent/frida-agent with a custom command
. build/frida-env-android-arm64.rc && python3 /home/bruno/Pentest/Frida/frida/releng/meson/meson.py install -C build/tmp-android-arm64/frida-core
ninja: Entering directory `/home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core'
[16/97] Generating src/compiler/frida-compiler-agent with a custom command
FAILED: src/compiler/agent.js src/compiler/snapshot.bin 
/home/bruno/Pentest/Frida/frida/frida-core/src/compiler/generate-agent.py /home/bruno/Pentest/Frida/frida/frida-core/src/compiler /home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core/src/compiler linux 64 ''

> frida-compiler-agent@1.0.0 build:typescript /home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core/src/compiler
> rollup --config rollup.config.typescript.ts --configPlugin typescript "--environment" "FRIDA_HOST_OS_FAMILY:linux,FRIDA_HOST_CPU_MODE:64" "--silent"

[!] Error: Cannot load plugin "typescript": Not supported.
Error: Cannot load plugin "typescript": Not supported.
    at loadAndRegisterPlugin (/home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core/src/compiler/node_modules/rollup/dist/shared/loadConfigFile.js:515:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frida-compiler-agent@1.0.0 build:typescript: `rollup --config rollup.config.typescript.ts --configPlugin typescript "--environment" "FRIDA_HOST_OS_FAMILY:linux,FRIDA_HOST_CPU_MODE:64" "--silent"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the frida-compiler-agent@1.0.0 build:typescript script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/bruno/.npm/_logs/2022-09-23T16_24_05_442Z-debug.log
Command '['npm', 'run', 'build:typescript', '--', '--environment', 'FRIDA_HOST_OS_FAMILY:linux,FRIDA_HOST_CPU_MODE:64', '--silent']' returned non-zero exit status 1.
ninja: build stopped: subcommand failed.
Could not rebuild /home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core
make[1]: *** [Makefile.linux.mk:279: build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc] Erro 255
make[1]: Exiting directory '/home/bruno/Pentest/Frida/frida'
make: *** [Makefile:4: build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc] Erro 2
ls: could not access './frida/build/frida-android-arm64/bin/frida-server': Non-existent file or directory
cp: unable to obtain status './frida/build/frida-android-arm64/bin/frida-server': Non-existent file or directory

Any idea what it could be?
Thanks!

@brunomcuesta

Hi! I had the same error when using frida-server on Android 12. I’m trying to compile following the tips posted in this open issue, but I get this Typescript error. Compilation fails due to this error.

[!] Error: Cannot load plugin "typescript": Not supported.

frida-core 1.0.0

  User defined options
    Cross files    : build/frida-android-arm64.txt
    Native files   : build/frida-linux-x86_64.txt
    default_library: static
    libdir         : /home/bruno/Pentest/Frida/frida/build/frida-android-arm64/lib
    optimization   : s
    prefix         : /home/bruno/Pentest/Frida/frida/build/frida-android-arm64
    strip          : True
    b_ndebug       : true
    agent_legacy   : /home/bruno/Pentest/Frida/frida/build/tmp-android-arm/frida-core/lib/agent/frida-agent.so
    agent_modern   : /home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core/lib/agent/frida-agent.so
    connectivity   : enabled
    helper_legacy  : /home/bruno/Pentest/Frida/frida/build/tmp-android-arm/frida-core/src/frida-helper
    helper_modern  : /home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core/src/frida-helper
    mapper         : auto

Found ninja-1.10.2 at /home/bruno/Pentest/Frida/frida/build/toolchain-linux-x86_64/bin/ninja
. build/frida-env-android-arm64.rc && ninja -C build/tmp-android-arm64/frida-core src/frida-helper lib/agent/frida-agent.so
ninja: Entering directory `build/tmp-android-arm64/frida-core'
[51/51] Generating lib/agent/frida-agent with a custom command
. build/frida-env-android-arm64.rc && python3 /home/bruno/Pentest/Frida/frida/releng/meson/meson.py install -C build/tmp-android-arm64/frida-core
ninja: Entering directory `/home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core'
[16/97] Generating src/compiler/frida-compiler-agent with a custom command
FAILED: src/compiler/agent.js src/compiler/snapshot.bin 
/home/bruno/Pentest/Frida/frida/frida-core/src/compiler/generate-agent.py /home/bruno/Pentest/Frida/frida/frida-core/src/compiler /home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core/src/compiler linux 64 ''

> frida-compiler-agent@1.0.0 build:typescript /home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core/src/compiler
> rollup --config rollup.config.typescript.ts --configPlugin typescript "--environment" "FRIDA_HOST_OS_FAMILY:linux,FRIDA_HOST_CPU_MODE:64" "--silent"

[!] Error: Cannot load plugin "typescript": Not supported.
Error: Cannot load plugin "typescript": Not supported.
    at loadAndRegisterPlugin (/home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core/src/compiler/node_modules/rollup/dist/shared/loadConfigFile.js:515:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frida-compiler-agent@1.0.0 build:typescript: `rollup --config rollup.config.typescript.ts --configPlugin typescript "--environment" "FRIDA_HOST_OS_FAMILY:linux,FRIDA_HOST_CPU_MODE:64" "--silent"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the frida-compiler-agent@1.0.0 build:typescript script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/bruno/.npm/_logs/2022-09-23T16_24_05_442Z-debug.log
Command '['npm', 'run', 'build:typescript', '--', '--environment', 'FRIDA_HOST_OS_FAMILY:linux,FRIDA_HOST_CPU_MODE:64', '--silent']' returned non-zero exit status 1.
ninja: build stopped: subcommand failed.
Could not rebuild /home/bruno/Pentest/Frida/frida/build/tmp-android-arm64/frida-core
make[1]: *** [Makefile.linux.mk:279: build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc] Erro 255
make[1]: Exiting directory '/home/bruno/Pentest/Frida/frida'
make: *** [Makefile:4: build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc] Erro 2
ls: could not access './frida/build/frida-android-arm64/bin/frida-server': Non-existent file or directory
cp: unable to obtain status './frida/build/frida-android-arm64/bin/frida-server': Non-existent file or directory

Any idea what it could be? Thanks!

This error was resolved by updating nodejs to the latest version.
Now this other error has appeared, which has already been reported, but a solution has not yet been published:

frida-gum/subprojects/glib/glib/gnulib/meson.build:306:2: ERROR: Problem encountered: frexp() is missing or broken beyond repair, and we have nothing to replace it with

Any predictions to release a new frida-server release?
Thanks!

@zerotypic

This error was resolved by updating nodejs to the latest version. Now this other error has appeared, which has already been reported, but a solution has not yet been published:

frida-gum/subprojects/glib/glib/gnulib/meson.build:306:2: ERROR: Problem encountered: frexp() is missing or broken beyond repair, and we have nothing to replace it with

I was facing the same error, and compiling my own toolchain and SDK solved it. See here: https://frida.re/docs/building/#unix-toolchain-and-sdk

@linuxct

Hi,

Meanwhile we wait for @oleavr to release a version of Frida with the patch integrated, please be aware that it is possible to rollback the Google Play System Update ART APEX module to the system’s prebuilt version (which may be just old enough to not contain the change in ART. If this is not the case, consider flashing an older firmware onto the device). This should allow you to continue using the latest pre-built versions of Frida without issues.

In order to rollback the ART APEX module, simply run this in an adb shell:

$ pm uninstall com.google.android.art

After doing so, reboot the phone.

In order to verify it worked, you can check the path of the APEX module before and after running the pm uninstall command.
Before:

$ pm path com.google.android.art
package:/data/apex/active/com.android.art@330443060.apex

After:

$ pm path com.google.android.art
package:/system/apex/com.google.android.art.apex

Hope this helps!

@dee-see

I upgraded my frida server and frida tools to 16.0 and it fixed the issue! Seems like it’s not announced yet on https://frida.re/news/ but it’s available on the GitHub releases page.

@WindySha

I was working alot on the security of my Zimbra server

Something I changed along the way started causing this ERROR 100% of the time

Search error: Unable to determine enabled services from ldap.
Unable to determine enabled services. Cache is out of date or doesn’t exist.

I fixed it. Maybe this info will help somebody else too.

But I want to know if I can, WHAT parameter forces me to change the ldap:// -> ldaps:// below manually, and not automatically?

Is it one of these?

zmlocalconfig -e ldap_starttls_supported=1
zmlocalconfig -e ldap_starttls_required=true
zmlocalconfig -e ldap_common_require_tls=128
zmlocalconfig -e zimbra_require_interprocess_security=1

For information T=this ERROR happened when

zmcontrol restart
Host mx.MYDOMAIN.com
Stopping vmware-ha…skipped.
/opt/zimbra/bin/zmhactl missing or not executable.
Stopping zmconfigd…Done.
Stopping zimlet webapp…Done.
Stopping zimbraAdmin webapp…Done.
Stopping zimbra webapp…Done.
Stopping service webapp…Done.
Stopping stats…Done.
Stopping mta…Done.
Stopping spell…Done.
Stopping snmp…Done.
Stopping cbpolicyd…Done.
Stopping archiving…Done.
Stopping opendkim…Done.
Stopping amavis…Done.
Stopping antivirus…Done.
Stopping antispam…Done.
Stopping proxy…Done.
Stopping memcached…Done.
Stopping mailbox…Done.
Stopping logger…Done.
Stopping dnscache…Done.
Stopping ldap…Done.
Host mx.MYDOMAIN.com
Starting ldap…Done.
Search error: Unable to determine enabled services from ldap.
Unable to determine enabled services. Cache is out of date or doesn’t exist.

This and a bunch of other posts

http://forums.zimbra.com/showthread.php?t=47631&s=14b2384dd837b122d3014db872cecbf8

say to

chown -R zimbra:zimbra /opt/zimbra
/opt/zimbra/libexec/zmfixperms -verbose

su — zimbra -c «zmcontrol restart»

But that doesn’t help

Host mx.MYDOMAIN.com
Stopping vmware-ha…skipped.
/opt/zimbra/bin/zmhactl missing or not executable.
Stopping zmconfigd…Done.
Stopping zimlet webapp…Done.
Stopping zimbraAdmin webapp…Done.
Stopping zimbra webapp…Done.
Stopping service webapp…Done.
Stopping stats…Done.
Stopping mta…Done.
Stopping spell…Done.
Stopping snmp…Done.
Stopping cbpolicyd…Done.
Stopping archiving…Done.
Stopping opendkim…Done.
Stopping amavis…Done.
Stopping antivirus…Done.
Stopping antispam…Done.
Stopping proxy…Done.
Stopping memcached…Done.
Stopping mailbox…Done.
Stopping logger…Done.
Stopping dnscache…Done.
Stopping ldap…Done.
Host mx.MYDOMAIN.com
Starting ldap…Done.
Search error: Unable to determine enabled services from ldap.
Unable to determine enabled services. Cache is out of date or doesn’t exist.

Also checking the installed SSL cert which is a real and valid commercial cert that I always have been using

Doing this anyway

cd /opt/zimbra/bin
whoami
root
./zmcertmgr verifycrt comm /opt/zimbra/ssl/zimbra/commercial/commercial.key /tmp/ssl.crt /tmp/ca_bundle.crt
** Verifying /tmp/ssl.crt against /opt/zimbra/ssl/zimbra/commercial/commercial.key
Certificate (/tmp/ssl.crt) and private key (/opt/zimbra/ssl/zimbra/commercial/commercial.key) match.
Valid Certificate: /tmp/ssl.crt: OK
./zmcertmgr deploycrt comm /tmp/ssl.crt /tmp/ca_bundle.crt
** Verifying /tmp/ssl.crt against /opt/zimbra/ssl/zimbra/commercial/commercial.key
Certificate (/tmp/ssl.crt) and private key (/opt/zimbra/ssl/zimbra/commercial/commercial.key) match.
Valid Certificate: /tmp/ssl.crt: OK
** Copying /tmp/ssl.crt to /opt/zimbra/ssl/zimbra/commercial/commercial.crt
** Appending ca chain /tmp/ca_bundle.crt to /opt/zimbra/ssl/zimbra/commercial/commercial.crt
** Importing certificate /opt/zimbra/ssl/zimbra/commercial/commercial_ca.crt to CACERTS as zcs-user-commercial_ca…done.
** NOTE: mailboxd must be restarted in order to use the imported certificate.
** Saving server config key zimbraSSLCertificate…done.
** Saving server config key zimbraSSLPrivateKey…done.
** Installing mta certificate and key…done.
** Installing slapd certificate and key…done.
** Installing proxy certificate and key…done.
** Creating pkcs12 file /opt/zimbra/ssl/zimbra/jetty.pkcs12…done.
** Creating keystore file /opt/zimbra/mailboxd/etc/keystore…done.
** Installing CA to /opt/zimbra/conf/ca…done.

Then

/opt/zimbra/bin/zmcertmgr viewdeployedcrt
::service mta::
notBefore=Jul 31 00:00:00 2014 GMT
notAfter=Aug 22 23:59:59 2015 GMT
subject= /OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*.MYDOMAIN.com
issuer= /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA
SubjectAltName= *.MYDOMAIN.com, MYDOMAIN.com
::service proxy::
notBefore=Jul 31 00:00:00 2014 GMT
notAfter=Aug 22 23:59:59 2015 GMT
subject= /OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*.MYDOMAIN.com
issuer= /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA
SubjectAltName= *.MYDOMAIN.com, MYDOMAIN.com
::service mailboxd::
notBefore=Jul 31 00:00:00 2014 GMT
notAfter=Aug 22 23:59:59 2015 GMT
subject= /OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*.MYDOMAIN.com
issuer= /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA
SubjectAltName= *.MYDOMAIN.com, MYDOMAIN.com
::service ldap::
notBefore=Jul 31 00:00:00 2014 GMT
notAfter=Aug 22 23:59:59 2015 GMT
subject= /OU=Domain Control Validated/OU=EssentialSSL Wildcard/CN=*.MYDOMAIN.com
issuer= /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA
SubjectAltName= *.MYDOMAIN.com, MYDOMAIN.com

It’s OK but after

chown -R zimbra:zimbra /opt/zimbra
/opt/zimbra/libexec/zmfixperms -verbose
su — zimbra -c «zmcontrol restart»

Still doesn’t help I get the same error

Also nothing here has changed

cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.1.115 mx.MYDOMAIN.com mx

::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

host `hostname`
mx.MYDOMAIN.com has address 192.168.1.115
mx.MYDOMAIN.com mail is handled by 5 mx.MYDOMAIN.com.

dig mx.MYDOMAIN.com any

; <<>> DiG 9.9.5-3ubuntu0.1-Ubuntu <<>> mx.MYDOMAIN.com any
;; global options: +cmd
;; Got answer:
;; ->>HEADER< ldaps://

zmlocalconfig -e ldap_master_url=»ldaps://mx.MYDOMAIN.com:389″
zmlocalconfig -e ldap_url=»ldaps://mx.MYDOMAIN.com:389″

Now

chown -R zimbra:zimbra /opt/zimbra
/opt/zimbra/libexec/zmfixperms -verbose
su — zimbra -c «zmcontrol restart»

looks OK and

su — zimbra -c «zmcontrol status»

says OK

zmcontrol status
Host mx.MYDOMAIN.com
amavis Running
antispam Running
antivirus Running
ldap Running
logger Running
mailbox Running
memcached Running
mta Running
opendkim Running
proxy Running
service webapp Running
snmp Running
spell Running
stats Running
zimbra webapp Running
zimbraAdmin webapp Running
zimlet webapp Running
zmconfigd Running

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка u2250 geely emgrand ec7
  • Ошибка u2100 форд эксплорер