Opened 10 years ago
Closed 7 years ago
#10898 closed bug (fixed)
[package_daemon] crash in Volume::HandleGetLocationInfoRequest()
Reported by: | diver | Owned by: | bonefish |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Servers/package_daemon | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | #11327, #12232, #13539 | |
Platform: | All |
Description
hrev47310, gcc2hybrid.
The crash happened after I have updated the system with pkgman update
and started HaikuDepot.
Attachments (5)
Change History (17)
by , 10 years ago
Attachment: | package_daemon-197-debug-04-06-2014-17-52-59.report added |
---|
comment:1 by , 10 years ago
comment:3 by , 10 years ago
Blocking: | 11327 added |
---|
by , 10 years ago
Attachment: | package_daemon-416-debug-29-12-2014-20-19-25.report added |
---|
puckipedia - report
by , 10 years ago
Attachment: | puckipedia_log added |
---|
puckipedia - logs of the currently active packages and uninstalled / installed packages
comment:4 by , 10 years ago
comment:5 by , 9 years ago
Blocking: | 12232 added |
---|
by , 8 years ago
Attachment: | package_daemon-493-debug-16-01-2017-19-24-37.report added |
---|
Crash after pkgman finished update.
comment:6 by , 7 years ago
Blocking: | 13539 added |
---|
comment:7 by , 7 years ago
patch: | 0 → 1 |
---|
by , 7 years ago
Attachment: | 0001-package_daemon-fix-crash-on-system-update.patch added |
---|
follow-up: 9 comment:8 by , 7 years ago
I'm a bit confused by this patch. Maybe you could explain why it fixes the problem?
- If isActive is true, we will get state == fActiveState when we get to the changed lines. If there is also fLatestState == fActiveState as your patch tests, then the operation results in no change for the latest package (fLatestState == state by transitivity). So, the whole operation should be skipped (no change count, no notification).
- If isActive is false, it means the active state is unchanged, and the latest is being replaced. If the latest was the same as the active, then we can get into a problem (we will delete the active state while it is still referenced).
Being unfamiliar with the code, I don't know if such a situation is expected (latest state changes from "same as active" to "different from active", but active state remains the same). What are the circumstances that lead to this happening?
I find the code a bit hard to follow with all these conditions. Maybe I'm just a little tired today, however.
Overall, +1, but I'd appreciate additional explanations on what is going on (in ticket comments is ok - no need to update the patch itself)
comment:9 by , 7 years ago
This is the problem:
- If isActive is false, it means the active state is unchanged, and the latest is being replaced. If the latest was the same as the active, then we can get into a problem (we will delete the active state while it is still referenced).
If we update system packages, isActive = false. package_daemon deletes fLatestState. If fActiveState == fLatestState, fActiveState = NULL. Next time iterating volume, package_daemon crashing, because it uses fActiveState for iterating volume (start HaikuDepot).
If we restart package_daemon, or reboot haiku, it's not reproduced.
And something more: if package_daemon uses fActiveState (!= fLatestState) before restart, maybe, updating, installing new packages useless. Need to check it..
P.S. sorry for my bad english.
comment:10 by , 7 years ago
And something more: if package_daemon uses fActiveState (!= fLatestState) before restart, maybe, updating, installing new packages useless. Need to check it..
Looks like everything is good. After reboot new installed package exists.
Happened again in hrev47531. Also after
pkgman update
.