[packagekit] Segmentation fault, help needed

Grzegorz Dąbrowski gdx at o2.pl
Sat Sep 8 05:23:43 PDT 2007


On Sat, 2007-09-08 at 10:23 +0100, Richard Hughes wrote:

> I think you are hitting that. We have to make the registration more
> robust as you are probably hitting a race inbetween the unref and the
> g_idle_add.
> 
> Is the finish signal emmitted in the thread really quickly after
> running the action? You can test this by adding a sleep in the thread
> code for a few ms. If that works then we've got a race and we'll have
> to change the registration code path.

Seems we've got a race.

Original situation with debugs:

...
[pk_backend_package] pk-backend.c:509 (12:20:50):        emit package 1,
util-linux;2.12r;i686;core, 
[pk_engine_package_cb] pk-engine.c:349 (12:20:50):       emitting
package job:2 value=1 util-linux;2.12r;i686;core, 
[pk_engine_reset_timer] pk-engine.c:149 (12:20:50):      reset timer
[find_packages_real] pk-backend-box.c:167 (12:20:50):    before
PK_EXIT_ENUM_SUCCESS
[find_packages_real] pk-backend-box.c:168 (12:20:50):    usleep 0
[find_packages_real] pk-backend-box.c:170 (12:20:50):    after usleep
[pk_backend_finished] pk-backend.c:628 (12:20:50):       adding finished
0x807dc28 to idle loop
[pk_backend_finished_idle] pk-backend.c:612 (12:20:50):  emit finished 0
[pk_engine_finished_cb] pk-engine.c:447 (12:20:50):      task was
running for 0.114475 seconds
[pk_engine_finished_cb] pk-engine.c:449 (12:20:50):      emitting
finished job: 2, 'success', 0
[pk_engine_finished_cb] pk-engine.c:457 (12:20:50):      removed task
0x807dc28
[pk_engine_job_list_changed] pk-engine.c:240 (12:20:50):
emitting job-list-changed
[pk_engine_reset_timer] pk-engine.c:149 (12:20:50):      reset timer
[pk_engine_reset_timer] pk-engine.c:149 (12:20:50):      reset timer
[pk_backend_finalize] pk-backend.c:1003 (12:20:50):      freeing box
[find_packages_real] pk-backend-box.c:172 (12:20:50):    after
PK_EXIT_ENUM_SUCCESS
Segmentation fault

With additional 500ms delay
...
[pk_backend_package] pk-backend.c:509 (12:19:01):        emit package 1,
util-linux;2.12r;i686;core, 
[pk_engine_package_cb] pk-engine.c:349 (12:19:01):       emitting
package job:2 value=1 util-linux;2.12r;i686;core, 
[pk_engine_reset_timer] pk-engine.c:149 (12:19:01):      reset timer
[find_packages_real] pk-backend-box.c:167 (12:19:01):    before
PK_EXIT_ENUM_SUCCESS
[find_packages_real] pk-backend-box.c:168 (12:19:01):    usleep 500000
[find_packages_real] pk-backend-box.c:170 (12:19:01):    after usleep
[pk_backend_finished] pk-backend.c:628 (12:19:01):       adding finished
0x807dc28 to idle loop
[find_packages_real] pk-backend-box.c:172 (12:19:01):    after
PK_EXIT_ENUM_SUCCESS
[pk_backend_finished_idle] pk-backend.c:612 (12:19:01):  emit finished 0
[pk_engine_finished_cb] pk-engine.c:447 (12:19:01):      task was
running for 0.627108 seconds
[pk_engine_finished_cb] pk-engine.c:449 (12:19:01):      emitting
finished job: 2, 'success', 0
[pk_engine_finished_cb] pk-engine.c:457 (12:19:01):      removed task
0x807dc28
[pk_engine_job_list_changed] pk-engine.c:240 (12:19:01):
emitting job-list-changed
[pk_engine_reset_timer] pk-engine.c:149 (12:19:01):      reset timer
[pk_engine_reset_timer] pk-engine.c:149 (12:19:01):      reset timer
[pk_backend_finalize] pk-backend.c:1003 (12:19:01):      freeing box


-- 
Grzegorz Dabrowski
Pingwinek GNU/Linux http://home.gna.org/pingwinek/




More information about the PackageKit mailing list