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)

package_daemon-197-debug-04-06-2014-17-52-59.report (24.8 KB ) - added by diver 10 years ago.
package_daemon-416-debug-29-12-2014-20-19-25.report (25.7 KB ) - added by puckipedia 10 years ago.
puckipedia - report
puckipedia_log (17.7 KB ) - added by puckipedia 10 years ago.
puckipedia - logs of the currently active packages and uninstalled / installed packages
package_daemon-493-debug-16-01-2017-19-24-37.report (25.4 KB ) - added by Premislaus 8 years ago.
Crash after pkgman finished update.
0001-package_daemon-fix-crash-on-system-update.patch (846 bytes ) - added by throttle10 7 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 by diver, 10 years ago

Happened again in hrev47531. Also after pkgman update.

comment:2 by diver, 10 years ago

Happened again after pkgman update in hrev47748.

comment:3 by diver, 10 years ago

Blocking: 11327 added

by puckipedia, 10 years ago

puckipedia - report

by puckipedia, 10 years ago

Attachment: puckipedia_log added

puckipedia - logs of the currently active packages and uninstalled / installed packages

comment:4 by puckipedia, 10 years ago

Happend to me too, from hrev48541 to hrev48584. Added report + some logs.

comment:5 by diver, 9 years ago

Blocking: 12232 added

by Premislaus, 8 years ago

Crash after pkgman finished update.

comment:6 by diver, 7 years ago

Blocking: 13539 added

comment:7 by throttle10, 7 years ago

patch: 01

comment:8 by pulkomandy, 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)

in reply to:  8 comment:9 by throttle10, 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.

Last edited 7 years ago by throttle10 (previous) (diff)

comment:10 by throttle10, 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.

comment:11 by axeld, 7 years ago

Patch looks good to me.

comment:12 by waddlesplash, 7 years ago

Resolution: fixed
Status: newclosed

Applied in hrev51233. Thanks!

Note: See TracTickets for help on using tickets.