pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Dmitriy Sarafannikov <dimon99901@mail.ru>
To: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Segfault in MemoryContextAlloc
Date: Wed, 27 Jan 2016 13:24:35 +0300
Message-ID: <1453890275.241158212@f404.i.mail.ru> (raw )
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Hi, i caught segfault with a simple select query (column and table names in query were changed).
select id_pk2 from table1 where id_pk1 = '9751302'
primary key is (id_pk1, id_pk2)
table1 is (id_pk1 bigint, id_pk2 bigint, date_add timestamp)
(gdb) bt full
#0 MemoryContextAlloc (context=0x0, size=120) at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/utils/mmgr/mcxt.c:584
No locals.
#1 0x00007f6ecc5b8eec in AfterTriggerBeginXact () at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/commands/trigger.c:3913
No locals.
#2 0x00007f6ecc4e8c21 in StartTransaction () at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/access/transam/xact.c:1848
s = 0x7f6eccbc4480 <TopTransactionStateData>
#3 StartTransactionCommand () at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/access/transam/xact.c:2534
s = 0x7f6eccbc4480 <TopTransactionStateData>
__func__ = "StartTransactionCommand"
#4 0x00007f6ecc6c452d in start_xact_command () at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/tcop/postgres.c:2412
No locals.
#5 0x00007f6ecc6c8750 in start_xact_command () at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/tcop/postgres.c:1334
No locals.
#6 exec_simple_query (query_string=0x7f6ecceef490 "select id_pk2 from table1 where id_pk1 = '9751302'")
at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/tcop/postgres.c:887
dest = DestRemote
parsetree_list = <optimized out>
save_log_statement_stats = 0 '\000'
was_logged = 0 '\000'
msec_str = "0.515\000\060\000\000\001\000\000\000\000\000\000\210Wk<\375\177\000\000\360\340\352\314n\177\000"
parsetree_item = <optimized out>
isTopLevel = <optimized out>
#7 PostgresMain (argc=<optimized out>, argv=argv@entry=0x7f6ecce6b880, dbname=0x7f6ecce6b850 "dbname", username=<optimized out>)
at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/tcop/postgres.c:4079
query_string = 0x7f6ecceef490 "select id_pk2 from table1 where id_pk1 = '9751302'"
firstchar = 81
input_message = {data = 0x7f6ecceef490 "select id_pk2 from table1 where id_pk1 = '9751302'", len = 70, maxlen = 1024, cursor = 70}
local_sigjmp_buf = {{__jmpbuf = {140725617117552, -4238614924085751285, 1, 140113860802664, 140113861075184, 140113858312064, -4238614923683098101, -4320489016603241973}, __mask_was_saved = 1,
__saved_mask = {__val = {0, 140728898420735, 140113857730256, 140113860681408, 140113822954592, 0, 51, 0, 140725617117920, 140725617117920, 140113854018386, 140113858289216, 0, 140725617117920,
0, 0}}}}
send_ready_for_query = 0 '\000'
__func__ = "PostgresMain"
#8 0x00007f6ecc48e92e in BackendRun (port=0x7f6ecceae0f0) at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/postmaster/postmaster.c:4252
ac = 1
secs = 507195785
usecs = 460872
i = 1
av = 0x7f6ecce6b880
maxac = <optimized out>
#9 BackendStartup (port=0x7f6ecceae0f0) at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/postmaster/postmaster.c:3917
bn = <optimized out>
pid = <optimized out>
#10 ServerLoop () at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/postmaster/postmaster.c:1678
rmask = {fds_bits = {256, 0 <repeats 15 times>}}
selres = <optimized out>
readmask = {fds_bits = {960, 0 <repeats 15 times>}}
now = <optimized out>
last_touch_time = 1453878784
__func__ = "ServerLoop"
#11 0x00007f6ecc67158b in PostmasterMain (argc=5, argv=<optimized out>) at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/postmaster/postmaster.c:1287
opt = <optimized out>
status = <optimized out>
userDoption = <optimized out>
listen_addr_saved = 1 '\001'
i = <optimized out>
output_config_variable = <optimized out>
__func__ = "PostmasterMain"
#12 0x00007f6ecc48fac2 in main (argc=5, argv=0x7f6ecce6a570) at /build/postgresql-9.4-MZhK6O/postgresql-9.4-9.4.5/build/../src/backend/main/main.c:228
No locals. It seems like TopTransactionContext doesn't initialized and is NULL.
(gdb) print TopTransactionContext
$7 = (MemoryContext) 0x0
--
Best regards,
Dmitriy Sarafannikov
view thread (4+ messages) latest in thread
Message-ID: <1453890275.241158212@f404.i.mail.ru>
Permalink: ../1453890275.241158212@f404.i.mail.ru/
Also on: postgresql.org/message-id/1453890275.241158212@f404.i.mail.ru
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: dimon99901@mail.ru
Subject: Re: Segfault in MemoryContextAlloc
In-Reply-To: <1453890275.241158212@f404.i.mail.ru>
References: <1453890275.241158212@f404.i.mail.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox