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

Panic in Screenshot #631

Closed
yusufozturk opened this issue Jun 21, 2022 · 7 comments · Fixed by #699
Closed

Panic in Screenshot #631

yusufozturk opened this issue Jun 21, 2022 · 7 comments · Fixed by #699
Labels
enhance New feature or request

Comments

@yusufozturk
Copy link

yusufozturk commented Jun 21, 2022

Rod Version: v0.107.2

What you got

page.go:371 throws "invalid memory address or nil pointer deference"

image

I think "metrics" or "CSSContentSize" is nil. This happens in a customer environment, so I can't repro the issue when I want. I see the panic from the logs. I will try to do some debug but maybe you already have an idea which one might be nil?

What you expected to see

Instead of panic, it should return error.

What have you tried to solve the question

I can add nil check for metrics and CSSContentSize.

@yusufozturk yusufozturk added the question Questions related to rod label Jun 21, 2022
@rod-robot
Copy link

Please fix the format of your markdown:

9:244 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]

generated by check-issue

@ysmood
Copy link
Member

ysmood commented Jun 22, 2022

Can we create a fake HTML page to reproduce this?

@yusufozturk
Copy link
Author

So as I understand, I should create a fake HTML page and PageGetLayoutMetricsResult should return nil for it?

I don't know how to do that yet. But I had 2 ideas:

  1. Maybe customer has old Chrome version so only "ContentSize" filled in and not "CSSContentSize" ? It seems like "ContentSize" is deprecated.
  2. Maybe just before PageGetLayoutMetricsResult request, browser process was killed? That can happen sometimes due to antivirus, 3rd party tools etc. In that case, entire "metrics" will be nil.

@ysmood
Copy link
Member

ysmood commented Jun 22, 2022

About 2, it won't panic, because rod has protection for crashing, it will return proper err for it.

About 1, if we can't reproduce it, we won't merge the PR.

@yusufozturk
Copy link
Author

Okay let me test it some more. If I can repro the issue, I can reopen the PR.

Thanks.

@yusufozturk yusufozturk closed this as not planned Won't fix, can't repro, duplicate, stale Jun 22, 2022
@yusufozturk
Copy link
Author

yusufozturk commented Jul 18, 2022

@ysmood customer had an old Chrome version, so data was actually under ContentSize and CSSContentSize was nil.

We upgraded chrome version in that customer to avoid this issue. But there might be other people who has similar problem.
As the package owner, it's up to you if you want to add a nil check or not. I don't know how I can provide a test with an old version of Chrome but at least I can provide you some screenshots of the problematic Chrome.

image

image

PS: Please keep in mind, usually Enterprise has no internet access for internal networks. Chrome installations usually made by system engineers in the beginning of the server installation and no one updates it because nobody uses Chrome in the server and it's not in the patching plan. So it's normal to have old versions in some cases.

@ysmood
Copy link
Member

ysmood commented Jul 19, 2022

Sure, we can make a PR for it, let's reopen it. Can you help to make the PR, thank you so much!

@ysmood ysmood reopened this Jul 19, 2022
@ysmood ysmood added enhance New feature or request and removed question Questions related to rod labels Jul 19, 2022
alexferrari88 added a commit to alexferrari88/rod that referenced this issue Aug 25, 2022
alexferrari88 added a commit to alexferrari88/rod that referenced this issue Aug 28, 2022
ysmood pushed a commit that referenced this issue Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhance New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants