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

If search keyword with value 0 exists, awstats freezes #250

Open
hzahradnik opened this issue Jun 20, 2024 · 1 comment
Open

If search keyword with value 0 exists, awstats freezes #250

hzahradnik opened this issue Jun 20, 2024 · 1 comment

Comments

@hzahradnik
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Use default settings for IIS log files
  2. Use this log file: demo.log
  3. awstats.pl -config=demo -update -LogFile="demo.log"
  4. Program freezes. This happens not every time, due to a random insert order.

Expected behavior
Program finishes and statistic is updated.

Screenshots
Not applicable.

Desktop (please complete the following information):

  • OS: Windows Server 2022 (21H2/20348.2402)
  • Perl: StrawberryPerl 5.38.2.2 (x64)
  • Version: 7.9

Additional context
I already analyzed the problem and fixed it for me. The error happens, because awstats detects a search keyword with the value 0. If another keyword has the same number of instances, the check for existance of this key in AddInTree fails and the value is inserted. After that, the nextval hash has an entry with the same value for key and value. If a subsequent insert tries to find the correct position, we are stuck in an infinite loop.

My fix on line 8369 is just using exists for the check, if a key exists.

if ( exists $val{$keyval} ) {    # Val is already in tree
@ShaiMagal
Copy link

ShaiMagal commented Jun 30, 2024

@hzahradnik

Hi, why you didn't make PR for this fix?

EDIT:
I think, it's already fixed by this PR:
https://github.com/eldy/AWStats/pull/247/files

So this (#250) can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants