PG中文社区 /
mdi-home
首页
社区新闻
中文文档
加入ACE
相关资料
mdi-chevron-down
{{ item.text }}
登录
mdi-home
首页
mdi-chat-processing
社区新闻
mdi-book-open-variant
中文文档
mdi-account-multiple-check
加入ACE
mdi-file-multiple-outline
相关资料
mdi-blank
{{item.text}}
mdi-exit-to-app
退出账号
首页
-->
有问有答
-->
Bug
qill722
PG9.65版本,创建C-function时,出现coredump ...
... 2018-10-21 14:50:07+08...1楼
PG9.65版本,创建C-function时,出现coredump 详细过程如下: pg965@SIA1000103209:~> psql psql (9.6.5) Type "help" for help. postgres=# CREATE OR REPLACE FUNCTION sys_eval(TEXT) RETURNS TEXT postgres-# AS '/home/pg965/tmp/tmp/testeval.so','sys_eval' LANGUAGE C STRICT IMMUTABLE; server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: LOG: server process (PID 63417) was terminated by signal 11: Segmentation fault DETAIL: Failed process was running: CREATE OR REPLACE FUNCTION sys_eval(TEXT) RETURNS TEXT AS '/home/pg965/tmp/tmp/testeval.so','sys_eval' LANGUAGE C STRICT IMMUTABLE; LOG: terminating any other active server processes WARNING: terminating connection because of crash of another server process DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. HINT: In a moment you should be able to reconnect to the database and repeat your command. Failed. !> LOG: all server processes terminated; reinitializing LOG: database system was interrupted; last known up at 2018-10-21 14:39:26 CST LOG: database system was not properly shut down; automatic recovery in progress LOG: invalid record length at 0/8F5BA48: wanted 24, got 0 LOG: redo is not required LOG: MultiXact member wraparound protections are now enabled LOG: database system is ready to accept connections LOG: autovacuum launcher started coredump信息如下: Thread 1 (Thread 0x7f85da97c700 (LWP 72860)): #0 0x00007f85da7a00fe in _dl_relocate_object () from /lib64/ld-linux-x86-64.so.2 #1 0x00007f85da7a7500 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2 #2 0x00007f85da7a2e46 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2 #3 0x00007f85da7a6dfb in _dl_open () from /lib64/ld-linux-x86-64.so.2 #4 0x00007f85da182f9b in dlopen_doit () from /lib64/libdl.so.2 #5 0x00007f85da7a2e46 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2 #6 0x00007f85da18333c in _dlerror_run () from /lib64/libdl.so.2 #7 0x00007f85da182f01 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2 #8 0x00000000007dcd0a in internal_load_library () #9 0x00000000007dd7d1 in load_external_function () #10 0x00000000005203ac in fmgr_c_validator () #11 0x00000000007e0c1a in OidFunctionCall1Coll () #12 0x00000000005218a7 in ProcedureCreate () #13 0x000000000058f76a in CreateFunction () #14 0x00000000006e95b2 in ProcessUtilitySlow () #15 0x00000000006ea1c2 in standard_ProcessUtility () #16 0x00000000006e64b4 in PortalRunUtility () #17 0x00000000006e74a4 in PortalRunMulti () #18 0x00000000006e7be4 in PortalRun () #19 0x00000000006e42ce in exec_simple_query () #20 0x00000000006e5af8 in PostgresMain () #21 0x000000000068366e in ServerLoop () #22 0x0000000000684cae in PostmasterMain () #23 0x000000000060aec3 in main () 通过分析发现,在加载C-function依赖的.so文件时出错: Missing separate debuginfo for /home/pg965/tmp/tmp/testeval.so Try: zypper install -C "debuginfo(build-id)=6d79dbd0be5e5904fa90dfd2110b54477407402b" Error while mapping shared library sections: `/home/pg965/tmp/tmp/testeval.so': not in executable format: File format not recognized C-function的创建,真的这么脆弱吗? 在处理外部.so文件时,需要进行文件解析异常判断吧 ~
我的签名:
qill722
回复: ...
... 2018-10-21 15:01:50+08...2楼
PG9.65版本,创建C-function时,出现coredump 详细过程如下: pg965@SIA1000103209:~> psql psql (9.6.5) Type "help" for help. postgres=# CREATE OR REPLACE FUNCTION sys_eval(TEXT) RETURNS TEXT postgres-# AS '/home/pg965/tmp/tmp/testeval.so','sys_eval' LANGUAGE C STRICT IMMUTABLE; server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: LOG: server process (PID 72860) was terminated by signal 11: Segmentation fault DETAIL: Failed process was running: CREATE OR REPLACE FUNCTION sys_eval(TEXT) RETURNS TEXT AS '/home/pg965/tmp/tmp/testeval.so','sys_eval' LANGUAGE C STRICT IMMUTABLE; LOG: terminating any other active server processes WARNING: terminating connection because of crash of another server process DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. HINT: In a moment you should be able to reconnect to the database and repeat your command. FATAL: the database system is in recovery mode Failed. !> !> LOG: all server processes terminated; reinitializing LOG: database system was interrupted; last known up at 2018-10-21 14:40:04 CST LOG: database system was not properly shut down; automatic recovery in progress LOG: invalid record length at 0/8F5BAB8: wanted 24, got 0 LOG: redo is not required LOG: MultiXact member wraparound protections are now enabled LOG: database system is ready to accept connections LOG: autovacuum launcher started ======================= coredump信息如下: Thread 1 (Thread 0x7f85da97c700 (LWP 72860)): Thread 1 (Thread 0x7f85da97c700 (LWP 72860)): 0 0x00007f85da7a00fe in _dl_relocate_object () from /lib64/ld-linux-x86-64.so.2 1 0x00007f85da7a7500 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2 2 0x00007f85da7a2e46 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2 3 0x00007f85da7a6dfb in _dl_open () from /lib64/ld-linux-x86-64.so.2 4 0x00007f85da182f9b in dlopen_doit () from /lib64/libdl.so.2 5 0x00007f85da7a2e46 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2 6 0x00007f85da18333c in _dlerror_run () from /lib64/libdl.so.2 7 0x00007f85da182f01 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2 8 0x00000000007dcd0a in internal_load_library () 9 0x00000000007dd7d1 in load_external_function () 10 0x00000000005203ac in fmgr_c_validator () 11 0x00000000007e0c1a in OidFunctionCall1Coll () 12 0x00000000005218a7 in ProcedureCreate () 13 0x000000000058f76a in CreateFunction () 14 0x00000000006e95b2 in ProcessUtilitySlow () 15 0x00000000006ea1c2 in standard_ProcessUtility () 16 0x00000000006e64b4 in PortalRunUtility () 17 0x00000000006e74a4 in PortalRunMulti () 18 0x00000000006e7be4 in PortalRun () 19 0x00000000006e42ce in exec_simple_query () 20 0x00000000006e5af8 in PostgresMain () 21 0x000000000068366e in ServerLoop () 22 0x0000000000684cae in PostmasterMain () 23 0x000000000060aec3 in main () =============>>>>>>>>>>>>> 通过分析发现,在加载C-function依赖的.so文件时出错: Missing separate debuginfo for /home/pg965/tmp/tmp/testeval.so Try: zypper install -C "debuginfo(build-id)=6d79dbd0be5e5904fa90dfd2110b54477407402b" Error while mapping shared library sections: `/home/pg965/tmp/tmp/testeval.so': not in executable format: File forma
我的签名:
kmblack1
回复: ...
... 2018-12-03 12:37:20+08...3楼
给你参考,我写的C function没遇到过类似的问题.要遵循规则 https://blog.csdn.net/kmblack1/article/details/80096021
我的签名:
您还没有登录,请您登录后再发表回复
加入我们
QQ群1:5276420
QQ群2:3336901
QQ群3:254622631
文档群:150657323
文档翻译平台:
按此访问
社区邮件列表:
按此订阅
商业支持
成都文武信息技术有限公司
杭州乘数科技有限公司
阿里云
华为云
青云(北京优帆科技有限公司)
扫码关注
加入我们
QQ群1:5276420
QQ群2:3336901
QQ群3:254622631
文档群:150657323
文档翻译平台:
按此访问
社区邮件列表:
按此订阅
商业支持
成都文武信息技术有限公司
杭州乘数科技有限公司
阿里云
华为云
青云(北京优帆科技有限公司)
扫码关注
© PostgreSQL中文社区 ... (自2010年起)