perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

Strange perfetto crash with enough memory available

Open rohanaggarwal7997 opened this issue 3 years ago • 18 comments

Hi I generally hit this error when i do not have enough memory available, but I am seeing it even with a small 1.57 GB file. When it loads at peak capacity I still have around 8gb of memory left.

[122.331] trace_sorter_queue.h:44 PERFETTO_CHECK(mem_blocks_.size() == 1) (errno: 0, Undefined error: 0)

-----BEGIN PERFETTO PRE-CRASH LOG----- trace_uuid: 00000000-0000-0000-9992-8b745ad [122.331] trace_sorter_queue.h:44 PERFETTO_CHECK(mem_blocks_.size() == 1) (errno: 0, Undefined error: 0)

-----END PERFETTO PRE-CRASH LOG----- Illegal instruction

Is there any way to avoid this ?

rohanaggarwal7997 avatar Jan 27 '23 01:01 rohanaggarwal7997

If i understand correctly, this is happening because of the following in my perf.data file.

instruction trace error type 1 time 2511250.194562356 cpu 26 pid 12975 tid 13594 ip 0x7fbfa0be98b6 code 7: Overflow packet

Is there a way to avoid this check in perfetto ?

rohanaggarwal7997 avatar Jan 27 '23 06:01 rohanaggarwal7997

Actually no it happens even without that

perf script -i file.data --itrace=e Warning: Processed 850658 events and lost 52 chunks!

Check IO/CPU overload!

[615.259] trace_sorter_queue.h:44 PERFETTO_CHECK(mem_blocks_.size() == 1) (errno: 0, Undefined error: 0)

-----END PERFETTO PRE-CRASH LOG----- Illegal instruction

rohanaggarwal7997 avatar Jan 27 '23 07:01 rohanaggarwal7997

We are investigating this issue. It shouldn't have happened even for not sufficient memory.

On Fri, Jan 27, 2023 at 7:43 AM Rohan Aggarwal @.***> wrote:

Actually no it happens even without that

perf script -i file.data --itrace=e Warning: Processed 850658 events and lost 52 chunks!

Check IO/CPU overload!

[615.259] trace_sorter_queue.h:44 PERFETTO_CHECK(mem_blocks_.size() == 1) (errno: 0, Undefined error: 0)

-----END PERFETTO PRE-CRASH LOG----- Illegal instruction

— Reply to this email directly, view it on GitHub https://github.com/google/perfetto/issues/435#issuecomment-1406130884, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ3CHTVBGMOFNPW4BRHRNW3WUN4ADANCNFSM6AAAAAAUIFMOMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

aMayzner avatar Jan 27 '23 10:01 aMayzner

It would help us greatly if you would be able to upload the trace, in whatever way (email, drive).

aMayzner avatar Jan 27 '23 10:01 aMayzner

Unfortunately I cannot upload the trace. While you guys investigate this, is there a way to bypass this error ?

rohanaggarwal7997 avatar Jan 27 '23 16:01 rohanaggarwal7997

We've managed to find a repro. I'm looking into sending a fix. For a bypass, try setting the environment variable TRACE_PROCESSOR_NO_MMAP=1 before running trace processor

LalitMaganti avatar Jan 27 '23 17:01 LalitMaganti

[rohaagga-mac:~/Desktop] rohaagga% echo $SHELL /bin/csh [rohaagga-mac:~/Desktop] rohaagga% echo $TRACE_PROCESSOR_NO_MMAP 1 [rohaagga-mac:~/Desktop] rohaagga% ./trace_processor -D trace.fxt [039.792] trace_sorter_queue.h:44 PERFETTO_CHECK(mem_blocks_.size() == 1) (errno: 0, Undefined error: 0)

-----BEGIN PERFETTO PRE-CRASH LOG----- trace_uuid: 00000000-0000-0000-5672-22a9cd5 [039.792] trace_sorter_queue.h:44 PERFETTO_CHECK(mem_blocks_.size() == 1) (errno: 0, Undefined error: 0)

-----END PERFETTO PRE-CRASH LOG----- Illegal instruction [rohaagga-mac:~/Desktop] rohaagga%

rohanaggarwal7997 avatar Jan 27 '23 18:01 rohanaggarwal7997

Yeah was worth a shot but otherwise I think it's just a matter of waiting for the fix. I'll treat this as a P0 and get to this asap.

LalitMaganti avatar Jan 27 '23 18:01 LalitMaganti

Small update - even on a 128 GB machine where the percentage used memory by trace processor was only 15 percent, the issue reproduces, as already mentioned by lalit in the thread.

rohanaggarwal7997 avatar Jan 30 '23 03:01 rohanaggarwal7997

@LalitMaganti Hi Lalit any update on this ? I am blocked by this for some important performance analysis expt. I would be really grateful if this could be fixed. Also on a side note, if the fix is small could you tell me what it is, I can do it locally and build myself for the time being.

rohanaggarwal7997 avatar Jan 31 '23 23:01 rohanaggarwal7997

The fix is not simple which is why it's not already landed.

If you're in a rush, you can patch https://r.android.com/2411705 (and the parent CL) which should fix the issue (I tested on a large multi-GB trace which failed previously and now works).

LalitMaganti avatar Feb 01 '23 01:02 LalitMaganti

Hi @LalitMaganti Sorry to bother you again and again. Any ETA on the fix to be merged ? Thanks Rohan.

rohanaggarwal7997 avatar Feb 06 '23 05:02 rohanaggarwal7997

No ETA I can provide sorry.

LalitMaganti avatar Feb 06 '23 09:02 LalitMaganti

Hi @LalitMaganti How have you been ? Has there been any update on this PR. I would be really grateful if we could get this functionality.

rohanaggarwal7997 avatar Feb 13 '23 07:02 rohanaggarwal7997

I haven't forgotten about this. Updates will be posted when available.

LalitMaganti avatar Feb 13 '23 13:02 LalitMaganti

thank you

rohanaggarwal7997 avatar Feb 13 '23 17:02 rohanaggarwal7997

https://r.android.com/2424192 will fix this. Should land very soon.

LalitMaganti avatar Feb 21 '23 06:02 LalitMaganti

awesome thanx....!

rohanaggarwal7997 avatar Feb 21 '23 18:02 rohanaggarwal7997