Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] Counter aggregation query crash on Autopush & Canary #980

Closed
cphlipot1 opened this issue Jan 7, 2025 · 3 comments
Closed

[UI] Counter aggregation query crash on Autopush & Canary #980

cphlipot1 opened this issue Jan 7, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@cphlipot1
Copy link
Contributor

I'm seeing a crash when aggregating some, but not all, counter tracks on the Canary & Autopush channels

How to reproduce

  1. open large_power_rail_trace.pftrace.gz in the perfetto UI using the auto push channel. Unlike other traces, this one reliably reproduces the issue.
  2. Expand power rail tracks
  3. Click and drag over an arbitrary region of one or more tracks.
  4. observe crash popup
Image

Full error:

UI: https://ui.perfetto.dev/v49.0-19792a991

Traceback (most recent call last):
  File "stdin" line 5 col 16
              from counter_leading_intervals!((
                   ^
no such macro defined
Query:
CREATE OR REPLACE PERFETTO TABLE counter_aggregation AS
      WITH
        res AS (
          select c.*
          from counter_leading_intervals!((
            SELECT counter.*
            FROM counter
            WHERE counter.track_id = 0
              AND counter.ts <= 1027063462979
          )) c
          WHERE c.ts + c.dur >= 288340322553
        ),
        aggregated AS (
          SELECT
            COUNT(1) AS count,
            ROUND(SUM(
              (MIN(ts + dur, 1027063462979) - MAX(ts,288340322553))*value)/738723140426,
              2
            ) AS avg_value,
            (SELECT value FROM counter WHERE track_id = 0
              AND ts + dur >= 288340322553
              AND ts <= 1027063462979 ORDER BY ts DESC LIMIT 1)
              AS last_value,
            (SELECT value FROM counter WHERE track_id = 0
              AND ts + dur >= 288340322553
              AND ts <= 1027063462979 ORDER BY ts ASC LIMIT 1)
              AS first_value,
            MIN(value) AS min_value,
            MAX(value) AS max_value
          FROM res
        )
      SELECT
        (SELECT name FROM counter_track WHERE id = 0) AS name,
        *,
        MAX(last_value) - MIN(first_value) AS delta_value,
        ROUND((MAX(last_value) - MIN(first_value))/738.723140426, 2) AS rate
      FROM aggregated
 -  (Error: Traceback (most recent call last):)
 - WasmEngineProxy.query (frontend_bundle.js:80597:14)
 - async EngineProxy.query (frontend_bundle.js:80700:17)
 - async CounterSelectionAggregator.createAggregateView (frontend_bundle.js:94706:10)
 - async SelectionAggregationManager.runAggregator (frontend_bundle.js:83167:29)
 - async Object.work (frontend_bundle.js:83112:31)
 - async AsyncLimiter.runTaskQueue (frontend_bundle.js:82558:22)

Trace: not available (ARRAY_BUFFER). Provide repro steps.
UA: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Referrer: 
@cphlipot1 cphlipot1 changed the title [UI] counter aggregation query crash on Autopush & Canary [UI] Counter aggregation query crash on Autopush & Canary Jan 7, 2025
@cphlipot1
Copy link
Contributor Author

I've also noticed this reproduces with test/data/power_rails.pb, which may be simpler to test against.

@LalitMaganti LalitMaganti added the bug Something isn't working label Jan 7, 2025
@LalitMaganti LalitMaganti self-assigned this Jan 7, 2025
@LalitMaganti
Copy link
Collaborator

Thanks for filing. https://r.android.com/3441062 should fix!

@cphlipot1
Copy link
Contributor Author

Thanks for the quick fix!

I noticed this one when trying to find a simple reproducer for #981

jrguzman-ms pushed a commit to msft-mirror-aosp/platform.external.perfetto that referenced this issue Jan 15, 2025
Fixes: google/perfetto#980
Change-Id: I388b52f78ada058a49212600d0fb7619b0fb20d4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants