Ticket #16 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

segfault on startup if readonly protections is disabled

Reported by: jan Owned by: moo
Priority: blocker Milestone: 1.0.1
Component: cacher Version:
Keywords: crash Cc:
Blocked By: PHP Version:
Application: Need User Feedback:
Other Exts: SAPI:
Probability: Blocking:

Description

If readonly protection is disabled a munmap(shm->ptr_ro, ...) is executed with ptr_ro = NULL.

Initializing shm->ptr_ro with XCACHE_MAP_FAILED is skipping the munmap().

--- mmap.c      2006-06-13 21:24:12.000000000 +0200
+++ mmap.c~     2006-06-05 08:43:25.000000000 +0200
@@ -153,7 +153,6 @@

        CHECK(shm = calloc(1, sizeof(xc_shm_t)), "shm OOM");
        shm->size = size;
-       shm->ptr_ro = XCACHE_MAP_FAILED;

        if (path == NULL || !path[0]) {
                static int inc = 0;

Change History

Changed 2 years ago by moo

  • owner changed from somebody to moo
  • status changed from new to assigned

good point. MAP_FAILED isn't NULL on all system, the logic checking shm->ptr shm->ptr_ro is messy. i'll fix it another way.

Changed 2 years ago by anonymous

  • status changed from assigned to closed
  • resolution set to fixed

in [79] (fix+cleanup for trunk), [80] (smallest fix for branch-1.0)

Changed 2 years ago by moo

  • milestone milestone3 deleted

Changed 2 years ago by moo

  • milestone set to 1.0.1

Changed 2 years ago by moo

  • component changed from component1 to cacher
Note: See TracTickets for help on using tickets.