Unix Technical Forum

postgres database crashed

This is a discussion on postgres database crashed within the pgsql Hackers forums, part of the PostgreSQL category; --> We have a following table xyz( id int , fname varchar(50), img image) where image is a data type ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 05:15 AM
Ashish Goel
 
Posts: n/a
Default postgres database crashed

We have a following table xyz( id int , fname varchar(50), img image)
where image is a data type we have created similar to lo.

so when we executed an insert query on the following table :-

insert into xyz VALUES (2541, '/home/ravi/jdbc/2_down/76.jpg', '76.jpg');

It works well for nearly 2500 images but from there onwards we obtained the following error and the database crashes.

this is the bt we obtained on using gdb with the postgres process

#0 0x00313bbc in memcpy () from /lib/libc.so.6
#1 0x0819496d in datumCopy ()
#2 0x0812d202 in copyObject ()
#3 0x08151c49 in eval_const_expressions_mutator ()
#4 0x08150c2f in expression_tree_mutator ()
#5 0x08151c49 in eval_const_expressions_mutator ()
#6 0x08150ece in expression_tree_mutator ()
#7 0x08151c49 in eval_const_expressions_mutator ()
#8 0x08152818 in eval_const_expressions ()
#9 0x081487d8 in preprocess_expression ()
#10 0x08149a04 in subquery_planner ()
#11 0x08149e56 in planner ()
#12 0x0817c25c in pg_plan_query ()
#13 0x0817c8d2 in pg_plan_queries ()
#14 0x0817e135 in PostgresMain ()
#15 0x0815b6e5 in ServerLoop ()
#16 0x0815c459 in PostmasterMain ()
#17 0x08128f48 in main ()


this is the LOG obtained

LOG: server process (PID 2499) was terminated by signal 11
(gdb) LOG: terminating any other active server processes
LOG: all server processes terminated; reinitializing
LOG: database system was interrupted at 2006-10-10 23:40:05 IST
LOG: checkpoint record is at 0/14B37B98
LOG: redo record is at 0/14B37B98; undo record is at 0/0; shutdown FALSE
LOG: next transaction ID: 210546; next OID: 851968; next MultiXactId: 1
LOG: database system was not properly shut down; automatic recovery in progress
FATAL: the database system is starting up
LOG: record with zero length at 0/14B37BD8
LOG: redo is not required
LOG: database system is ready
LOG: transaction ID wrap limit is 1073952152, limited by database "benchmark"


Can somebody suggest us what might be the cause of error and what can we do to resolve it ?

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2008, 05:16 AM
Tom Lane
 
Posts: n/a
Default Re: postgres database crashed

Ashish Goel <postgres_help@yahoo.com> writes:
> We have a following table xyz( id int , fname varchar(50), img image)
> where image is a data type we have created similar to lo.
> ...
> Can somebody suggest us what might be the cause of error and what can we do to resolve it ?


Incorrect code in your custom datatype, almost certainly. Check
computations of memory size allocations, for example. Test it in
a backend compiled with --enable-cassert.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-12-2008, 05:19 AM
Ashish Goel
 
Posts: n/a
Default Re: postgres database crashed

But the same code worked when I inserted around 2500 images in the database. After that it started crashing. So , I don't think it's because of error in the code. Can u suggest some other possible reasons and also why is it crashing at call to memcpy(). I have also checked the memory allocations , and i don't find problem there.



Tom Lane <tgl@sss.pgh.pa.us> wrote: Ashish Goel
writes:
> We have a following table xyz( id int , fname varchar(50), img image)
> where image is a data type we have created similar to lo.
> ...
> Can somebody suggest us what might be the cause of error and what can we do to resolve it ?


Incorrect code in your custom datatype, almost certainly. Check
computations of memory size allocations, for example. Test it in
a backend compiled with --enable-cassert.

regards, tom lane




---------------------------------
How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-12-2008, 05:19 AM
Andrew Dunstan
 
Posts: n/a
Default Re: postgres database crashed



Did you follow Tom's suggestion of trying with a postgres configured with
--enable-cassert ?

cheers

andrew

Ashish Goel wrote:
> But the same code worked when I inserted around 2500 images in the
> database. After that it started crashing. So , I don't think it's because
> of error in the code. Can u suggest some other possible reasons and also
> why is it crashing at call to memcpy(). I have also checked the memory
> allocations , and i don't find problem there.
>
>
>
> Tom Lane <tgl@sss.pgh.pa.us> wrote: Ashish Goel
> writes:
>> We have a following table xyz( id int , fname varchar(50), img image)
>> where image is a data type we have created similar to lo.
>> ...
>> Can somebody suggest us what might be the cause of error and what can we
>> do to resolve it ?

>
> Incorrect code in your custom datatype, almost certainly. Check
> computations of memory size allocations, for example. Test it in
> a backend compiled with --enable-cassert.
>




---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:03 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com