Opened 9 months ago

Closed 6 months ago

#28660 closed defect (fixed)

rend_cache_decrement_allocation(): Bug: Underflow in rend_cache_decrement_allocation (On Windows build)

Reported by: rl1987 Owned by:
Priority: Medium Milestone: Tor: 0.3.5.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-test
Cc: Actual Points:
Parent ID: #28668 Points:
Reviewer: asn Sponsor:

Description

https://ci.appveyor.com/project/rl1987/tor/builds/20640384/job/3lk0nnv48m6vc5ni

rend_cache/clean: [forking] Nov 29 09:44:28.993 [warn] rend_cache_decrement_allocation(): Bug: Underflow in rend_cache_decrement_allocation (on Tor 0.4.0.0-alpha-dev 9c90bddc42467396)
OK

Child Tickets

Change History (13)

comment:1 Changed 9 months ago by dgoulet

Oh wow... this actually happens also on Linux:

rend_cache/clean: [forking] Nov 29 09:55:04.024 [warn] rend_cache_decrement_allocation(): Bug: Underflow in rend_cache_decrement_allocation (on Tor 0.4.0.0-alpha-dev 2240fe63feb9a8cf)
OK
1 tests ok.  (0 skipped)

This comes from test_rend_cache_clean() that adds entries to the rend_cache directly by using the strmap_set_lc() instead of rend_cache_store_v2_desc_as_client()­ which does call the increment to the allocation counter.

The fix here is to simply add calls to rend_cache_increment_allocation() before adding an entry.

comment:2 Changed 9 months ago by dgoulet

Keywords: tor-test added; windows removed
Milestone: Tor: 0.4.0.x-final
Status: newneeds_review

Branch: ticket28660_040_01
PR: https://github.com/torproject/tor/pull/553

comment:3 Changed 9 months ago by teor

I thought we made BUG() warnings fail the unit tests?
But I can't find a ticket for that change, so I opened #28668.

comment:4 Changed 9 months ago by nickm

What version is this a bug fix on? Is it a backport candidate?

comment:5 in reply to:  4 Changed 9 months ago by dgoulet

Replying to nickm:

What version is this a bug fix on? Is it a backport candidate?

The test was introduced in 0.2.8 and the log_warn(LD_BUG...) in 0.2.7 so for maintained versions, 0.2.9 is the oldest. I just tested it and indeed we have the Bug: warning...

This only affects the output, the test still is working fine so I'm ok keeping that in 040. If we do backport #28668 then we have to backport this for sure. I think maybe going back to 035 is fine?

comment:6 Changed 9 months ago by dgoulet

Reviewer: asn

comment:7 Changed 9 months ago by asn

Status: needs_reviewmerge_ready

LGTM!

comment:8 Changed 9 months ago by nickm

Resolution: fixed
Status: merge_readyclosed

Okay, merged to master.

comment:9 Changed 7 months ago by nickm

Milestone: Tor: 0.4.0.x-finalTor: 0.3.5.x-final
Parent ID: #28668
Resolution: fixed
Status: closedreopened

comment:10 Changed 7 months ago by nickm

This needs backport for #28668

comment:11 Changed 7 months ago by nickm

Status: reopenedneeds_review

comment:12 Changed 6 months ago by dgoulet

Status: needs_reviewmerge_ready

For 035: https://github.com/torproject/tor/pull/697
Branch: git:ticket28660_035_01

comment:13 Changed 6 months ago by nickm

Resolution: fixed
Status: merge_readyclosed

Okay, backport merged. Thanks!

Note: See TracTickets for help on using tickets.