Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server crashes if parallel run "function" test #500

Closed
2 tasks
saygoodbyye opened this issue Dec 17, 2024 · 2 comments
Closed
2 tasks

Server crashes if parallel run "function" test #500

saygoodbyye opened this issue Dec 17, 2024 · 2 comments
Labels
bug Something isn't working CRASH Postgres crashes pending-close Going to close this "soon"

Comments

@saygoodbyye
Copy link

saygoodbyye commented Dec 17, 2024

What happens?

If we parallel run functon test like below, server will crash
PostgreSQL build:

CFLAGS='-Og' ./configure --enable-tap-tests --with-openssl --enable-debug --enable-cassert --with-icu --with-lz4 --with-libxml

To Reproduce

Patch test/regression/schedule:

test: function function function function function function function function function
test: function function function function function function function function function

Then execute

make installcheck

regression.out:

not ok 1     + function                                   36 ms
not ok 2     + function                                   32 ms
not ok 3     + function                                   37 ms
not ok 4     + function                                   31 ms
not ok 5     + function                                   33 ms
not ok 6     + function                                   31 ms
not ok 7     + function                                   31 ms
not ok 8     + function                                   31 ms
not ok 9     + function                                   31 ms
# parallel group (9 tests):  function function function function function function function function function
not ok 10    + function                                  640 ms
# (test process exited with exit code 2)
not ok 11    + function                                   31 ms
not ok 12    + function                                  643 ms
# (test process exited with exit code 2)
not ok 13    + function                                  644 ms
# (test process exited with exit code 2)
not ok 14    + function                                  644 ms
# (test process exited with exit code 2)
not ok 15    + function                                   31 ms
not ok 16    + function                                  642 ms
# (test process exited with exit code 2)
not ok 17    + function                                  643 ms
# (test process exited with exit code 2)
not ok 18    + function                                  642 ms
# (test process exited with exit code 2)

backtrace:

#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007b310ba4526e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007b310ba288ff in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007b310ba297b6 in __libc_message_impl (fmt=fmt@entry=0x7b310bbce765 "*** %s ***: terminated\n") at ../sysdeps/posix/libc_fatal.c:132
#6  0x00007b310bb36c19 in __GI___fortify_fail (msg=msg@entry=0x7b310bbce77d "stack smashing detected") at ./debug/fortify_fail.c:24
#7  0x00007b310bb37ea4 in __stack_chk_fail () at ./debug/stack_chk_fail.c:24
#8  0x00005f928d97063e in ProcSleep (locallock=0x5f928ea9bd20, lockMethodTable=<optimized out>, dontWait=<optimized out>) at proc.c:1662
#9  0x00005f928d960c41 in WaitOnLock (locallock=0x5f928eaac280, locallock@entry=0x5f928ea9bd20, owner=0x7fff72fb6e20, owner@entry=0x5f928eaac280, dontWait=dontWait@entry=false) at lock.c:1884
#10 0x00005f928d96254b in LockAcquireExtended (locktag=0x5f928dac84b8 <pg_re_throw+32>, locktag@entry=0x7fff72fb6e20, lockmode=lockmode@entry=1, sessionLock=sessionLock@entry=false, dontWait=dontWait@entry=false, reportMemoryError=reportMemoryError@entry=true,
    locallockp=locallockp@entry=0x7fff72fb6e18) at lock.c:1068
#11 0x00005f928d95e70d in LockRelationOid (relid=relid@entry=16500, lockmode=lockmode@entry=1) at lmgr.c:116
#12 0x00005f928d677ced in RangeVarGetRelidExtended (relation=relation@entry=0x5f928eb47f88, lockmode=lockmode@entry=1, flags=flags@entry=1, callback=callback@entry=0x0, callback_arg=callback_arg@entry=0x0) at namespace.c:592
#13 0x00005f928d599da2 in relation_openrv_extended (relation=relation@entry=0x5f928eb47f88, lockmode=lockmode@entry=1, missing_ok=missing_ok@entry=true) at relation.c:185
#14 0x00005f928d61beea in table_openrv_extended (relation=relation@entry=0x5f928eb47f88, lockmode=lockmode@entry=1, missing_ok=missing_ok@entry=true) at table.c:108
#15 0x00005f928d6d8234 in parserOpenTable (pstate=pstate@entry=0x5f928eb486b8, relation=relation@entry=0x5f928eb47f88, lockmode=lockmode@entry=1) at parse_relation.c:1424
#16 0x00005f928d6dbd0e in addRangeTableEntry (pstate=pstate@entry=0x5f928eb486b8, relation=relation@entry=0x5f928eb47f88, alias=0x0, inh=true, inFromCl=inFromCl@entry=true) at parse_relation.c:1501
#17 0x00005f928d6ba3c1 in transformTableEntry (pstate=pstate@entry=0x5f928eb486b8, r=r@entry=0x5f928eb47f88) at parse_clause.c:400
#18 0x00005f928d6bce74 in transformFromClauseItem (pstate=pstate@entry=0x5f928eb486b8, n=0x5f928eb47f88, top_nsitem=top_nsitem@entry=0x7fff72fb70d8, namespace=namespace@entry=0x7fff72fb70e0) at parse_clause.c:1075
#19 0x00005f928d6bdd7e in transformFromClause (pstate=pstate@entry=0x5f928eb486b8, frmList=0x5f928eb47fd8) at parse_clause.c:133
#20 0x00005f928d69c5cd in transformSelectStmt (pstate=0x5f928eb486b8, stmt=stmt@entry=0x5f928eb48528) at analyze.c:1368
#21 0x00005f928d69cf6c in transformStmt (pstate=pstate@entry=0x5f928eb486b8, parseTree=parseTree@entry=0x5f928eb48528) at analyze.c:368
#22 0x00005f928d69e130 in transformOptionalSelectInto (pstate=pstate@entry=0x5f928eb486b8, parseTree=0x5f928eb48528) at analyze.c:303
#23 0x00005f928d69e15e in transformTopLevelStmt (pstate=pstate@entry=0x5f928eb486b8, parseTree=parseTree@entry=0x5f928eb48638) at analyze.c:253
#24 0x00005f928d69e3ab in parse_analyze_withcb (parseTree=parseTree@entry=0x5f928eb48638, sourceText=sourceText@entry=0x5f928ed24098 "SELECT c         FROM tb WHERE a = va and b = vb", parserSetup=parserSetup@entry=0x7b310c0412f1 <plpgsql_parser_setup>,
    parserSetupArg=parserSetupArg@entry=0x5f928ed24008, queryEnv=queryEnv@entry=0x0) at analyze.c:200
#25 0x00005f928d97c310 in pg_analyze_and_rewrite_withcb (parsetree=parsetree@entry=0x5f928eb48638, query_string=query_string@entry=0x5f928ed24098 "SELECT c         FROM tb WHERE a = va and b = vb", parserSetup=0x7b310c0412f1 <plpgsql_parser_setup>, parserSetupArg=0x5f928ed24008,
    queryEnv=0x0) at postgres.c:785
#26 0x00005f928d7dcbac in _SPI_prepare_plan (src=src@entry=0x5f928ed24098 "SELECT c         FROM tb WHERE a = va and b = vb", plan=plan@entry=0x7fff72fb7290) at spi.c:2271
#27 0x00005f928d7ddba2 in SPI_prepare_extended (src=0x5f928ed24098 "SELECT c         FROM tb WHERE a = va and b = vb", options=options@entry=0x7fff72fb7300) at spi.c:927
#28 0x00007b310c048929 in exec_prepare_plan (estate=estate@entry=0x7fff72fb7590, expr=expr@entry=0x5f928ed24008, cursorOptions=cursorOptions@entry=2048) at pl_exec.c:4195
#29 0x00007b310c04a7b9 in exec_stmt_execsql (estate=estate@entry=0x7fff72fb7590, stmt=stmt@entry=0x5f928ed240e8) at pl_exec.c:4235
#30 0x00007b310c04c5e9 in exec_stmts (estate=estate@entry=0x7fff72fb7590, stmts=0x5f928ed24138) at pl_exec.c:2092
#31 0x00007b310c04cca8 in exec_stmt_block (estate=estate@entry=0x7fff72fb7590, block=block@entry=0x5f928ed24330) at pl_exec.c:1943
#32 0x00007b310c04cd8e in exec_toplevel_block (estate=estate@entry=0x7fff72fb7590, block=0x5f928ed24330) at pl_exec.c:1634
#33 0x00007b310c04d08b in plpgsql_exec_function (func=0x5f928eaac690, fcinfo=0x7fff72fb7890, simple_eval_estate=<optimized out>, simple_eval_resowner=<optimized out>, procedure_resowner=0x0, atomic=<optimized out>) at pl_exec.c:623
#34 0x00007fff72fb7c20 in ?? ()
#35 0x0000000000002ea3 in ?? ()
#36 0x00007fff72fb7764 in ?? ()
#37 0x00007fff72fb7760 in ?? ()
#38 0x00005f928d6a1359 in base_yyparse (yyscanner=0x5f928ea63cf0) at /home/test/postgrespro/src/backend/parser/gram.y:975
#39 0x00005f928ea64058 in ?? ()
#40 0x5f7de29c9530fd8e in ?? ()
#41 0x1fa61c5b9df6fd8e in ?? ()
#42 0x00005f9200000000 in ?? ()
#43 0x00005f928daebbff in AllocSetAllocChunkFromBlock (context=context@entry=0x5f928ea633d0, block=block@entry=0x5f928ea64468, size=140735122474096, size@entry=112, warning: left shift count >= width of type
chunk_size=2280539016407350670, chunk_size@entry=0, fidx=fidx@entry=-1901707152) at aset.c:788
#44 0x00005f928daec443 in AllocSetAlloc (context=0x5f928ea633d0, size=112, flags=0) at aset.c:1054
#45 0x00005f928daf5957 in palloc0 (size=112) at mcxt.c:1357
#46 0x700d3693ae049300 in ?? ()
#47 0x00005f928eaed2a0 in ?? ()
#48 0x00005f928d97c988 in exec_simple_query (query_string=query_string@entry=0x5f928ea634d0 "DROP TABLE ta, tb;") at postgres.c:1278
#49 0x00005f928d97e8ac in PostgresMain (dbname=<optimized out>, username=<optimized out>) at postgres.c:4767
#50 0x00005f928d977ec6 in BackendMain (startup_data=<optimized out>, startup_data_len=<optimized out>) at backend_startup.c:105
#51 0x00005f928d8d2530 in postmaster_child_launch (child_type=child_type@entry=B_BACKEND, startup_data=startup_data@entry=0x7fff72fb85c4 "", startup_data_len=startup_data_len@entry=4, client_sock=client_sock@entry=0x7fff72fb8600) at launch_backend.c:277
#52 0x00005f928d8d6c20 in BackendStartup (client_sock=client_sock@entry=0x7fff72fb8600) at postmaster.c:3592
#53 0x00005f928d8d6e9a in ServerLoop () at postmaster.c:1674
#54 0x00005f928d8d850c in PostmasterMain (argc=argc@entry=8, argv=argv@entry=0x5f928ea1d320) at postmaster.c:1372
#55 0x00005f928d7f990d in main (argc=8, argv=0x5f928ea1d320) at main.c:199

OS:

Ubuntu 24.04

pg_duckdb Version (if built from source use commit hash):

eb2c6bb

Postgres Version (if built from source use commit hash):

ff9dc96f370aa33a5c1c578c43c598473705d82f

Hardware:

No response

Full Name:

Egor Chindyaskin

Affiliation:

Postgres Professional

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a source build

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?

  • Yes, I have
@JelteF JelteF added bug Something isn't working CRASH Postgres crashes labels Dec 18, 2024
@JelteF
Copy link
Collaborator

JelteF commented Feb 26, 2025

@saygoodbyye are you still able to reproduce this? I cannot on my machine. And we fixed a bunch of crashes in the last release.

@JelteF JelteF added the pending-close Going to close this "soon" label Feb 26, 2025
@saygoodbyye
Copy link
Author

@JelteF, thank you! Now I can’t repeat the fall either, I think we can close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CRASH Postgres crashes pending-close Going to close this "soon"
Projects
None yet
Development

No branches or pull requests

2 participants