Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#16 closed defect (fixed)

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:
Application: PHP Version:
Other Exts: SAPI:
Probability: Blocked By:
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 (5)

comment:1 Changed 8 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.

comment:2 Changed 8 years ago by anonymous

  • Resolution set to fixed
  • Status changed from assigned to closed

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

comment:3 Changed 8 years ago by moo

  • Milestone milestone3 deleted

comment:4 Changed 8 years ago by moo

  • Milestone set to 1.0.1

comment:5 Changed 8 years ago by moo

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