When doing a large query from /intranet/employees/admin/index.tcl, I
get the following error:
NOTICE: PortalHeapMemoryFree: 0x0x41a37610 not in alloc set!
NOTICE: PortalHeapMemoryFree: 0x0x41a37cc8 not in alloc set!
NOTICE: PortalHeapMemoryFree: 0x0x41a37ca0 not in alloc set!
ERROR: btree scan list trashed; can't find 0x0x41a37bf0
The same thing happens running the query in psql.
The PostgreSQL.org doxlist faq says...
5.2) What does the message "NOTICE:PortalHeapMemoryFree:
0x402251d0 not in alloc set!" mean?
You are pfree'ing something that was not palloc'ed.
Beware of mixing malloc/free and palloc/pfree.
Where should I be looking to solve this?
The postmaster process looks like so
PID TTY STAT TIME COMMAND
476 ? S 0:04 /usr/local/pgsql/bin/postmaster -B 1000 -
S -o -S 8000 -D/usr/local/pgsql/data
Postgres is still accessible from other pages on this and other
OpenACS sites running on the same machine.
Thanks for your help.
The troublesome query (either half of the union can be run
successfully):
select users.user_id , coalesce(info.salary, 0) as salary,
users.last_name || ', ' || users.first_names as name,
info.supervisor_id, info.years_experience as
n_years_experience, info.salary_period, info.referred_by,
to_char(info.start_date,'Mon DD, YYYY') as
start_date_pretty,
(case when info.project_lead_p = 't'
then 'Yes'::varchar else 'No'::varchar end) as project_lead,
(case when info.team_leader_p = 't'
then 'Yes'::varchar else 'No'::varchar end) as team_lead,
(case when supervisor_id is NULL
then 'missing'
else (select s.first_names || ' ' || s.last_name
from users s where s.user_id=supervisor_id) end) as supervisor_name,
(case when info.referred_by is NULL
then 'nobody'
else (select r.first_names || ' ' || r.last_name
from users r where r.user_id=referred_by) end) as referral_name
from users_active users, im_employee_info info,
user_group_map ugm
where users.user_id = ugm.user_id
and ugm.group_id = 8
and users.user_id = info.user_id
union
select users.user_id , 0 as salary, users.last_name || ', ' ||
users.first_names as name,
'' as supervisor_id, '' as n_years_experience, '' as
salary_period, '' as referred_by,
'' as start_date_pretty,
'No'::varchar as project_lead,
'No'::varchar as team_lead,
'missing' as supervisor_name,
'nobody' as referral_name
from users_active users, user_group_map ugm
where users.user_id = ugm.user_id
and ugm.group_id = 8
and not exists (select 1 from im_employee_info
where user_id = users.user_id)
order by upper(users.last_name),upper(users.first_names)