Opened 5 years ago

#832 new bug

Potential leak in 'radical'

Reported by: Lars Kastner <lars.kastner@…> Owned by: somebody
Priority: dontKnow Milestone: 4-2-0 and higher
Component: dontKnow Version: 4-1-0
Keywords: Cc:

Description

If building Singular with sanitize flags as in ticket:831 (with the fix applied) we get the following:

Input:

ring r = 3,(x_0,x_1,x_2),dp;
ideal i = x_0^2*x_1 + 151*x_0*x_1*x_2^10 + 169*x_1^21,6*x_0^2*x_1^4 + x_0*x_2^14 + 3*x_2^24,11*x_0^3 + 5*x_0*x_1^10*x_2^10 + 2*x_1^20*x_2^10 + x_1^10*x_2^20;
LIB "primdec.lib";
radical(i);
exit;

Output:

kastner@marvin:~/local/asan/installed/singular/bin> ./Singular 
                     SINGULAR                                 /  Development
 A Computer Algebra System for Polynomial Computations       /   version 4.1.1
                                                           0<
 by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann     \   Feb 2018
FB Mathematik der Universitaet, D-67653 Kaiserslautern        \
> ring r = 3,(x_0,x_1,x_2),dp;
> ideal i = x_0^2*x_1 + 151*x_0*x_1*x_2^10 + 169*x_1^21,6*x_0^2*x_1^4 + x_0*x_2^14 + 3*x_2^24,11*x_0^3 + 5*x_0*x_1^10*x_2^10 + 2*x_1^20*x_2^10 + x_1^10*x_2^20;
> LIB "primdec.lib";
// ** loaded /store/marvin/datastore/kastner/asan/installed/singular/bin/../share/singular/LIB/primdec.lib (4.1.1.0,Dec_2017)
// ** loaded /store/marvin/datastore/kastner/asan/installed/singular/bin/../share/singular/LIB/ring.lib (4.1.1.0,Dec_2017)
// ** loaded /store/marvin/datastore/kastner/asan/installed/singular/bin/../share/singular/LIB/absfact.lib (4.1.1.0,Dec_2017)
// ** loaded /store/marvin/datastore/kastner/asan/installed/singular/bin/../share/singular/LIB/triang.lib (4.1.1.0,Dec_2017)
// ** loaded /store/marvin/datastore/kastner/asan/installed/singular/bin/../share/singular/LIB/matrix.lib (4.1.1.0,Dec_2017)
// ** loaded /store/marvin/datastore/kastner/asan/installed/singular/bin/../share/singular/LIB/nctools.lib (4.1.1.0,Dec_2017)
// ** loaded /store/marvin/datastore/kastner/asan/installed/singular/bin/../share/singular/LIB/inout.lib (4.1.1.0,Dec_2017)
// ** loaded /store/marvin/datastore/kastner/asan/installed/singular/bin/../share/singular/LIB/random.lib (4.1.1.0,Dec_2017)
// ** loaded /store/marvin/datastore/kastner/asan/installed/singular/bin/../share/singular/LIB/poly.lib (4.1.1.0,Dec_2017)
// ** loaded /store/marvin/datastore/kastner/asan/installed/singular/bin/../share/singular/LIB/elim.lib (4.1.1.0,Dec_2017)
// ** loaded /store/marvin/datastore/kastner/asan/installed/singular/bin/../share/singular/LIB/general.lib (4.1.1.0,Dec_2017)
> radical(i);
_[1]=x_1
_[2]=x_0
> exit;
Auf Wiedersehen.

=================================================================
==26721==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 23389 byte(s) in 8 object(s) allocated from:
    #0 0x57b658 in __interceptor_malloc /homes/combi/kastner/local/asan/llvm-6.0.0-src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:88
    #1 0xdb4d11 in omAllocFromSystem /homes/combi/kastner/local/asan/singular-sources/omalloc/omAllocSystem.c:188:9
    #2 0x624730 in iiGetLibProcBuffer(procinfo*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:253:31
    #3 0x6257f2 in iiPStart(idrec*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:370:9
    #4 0x62644b in iiMake_proc(idrec*, sip_package*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:532:22
    #5 0x5cedca in jjPROC(sleftv*, sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc
    #6 0x5d2d45 in iiExprArith2TabIntern(sleftv*, sleftv*, int, sleftv*, int, sValCmd2 const*, int, int, sConvertTypes const*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8165:31
    #7 0x5d34aa in iiExprArith2(sleftv*, sleftv*, int, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8306:12
    #8 0x602e15 in jjKLAMMER_PL(sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:7381:7
    #9 0x5d6af6 in iiExprArithM(sleftv*, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8828:13
    #10 0x5c9420 in yyparse() /homes/combi/kastner/local/asan/singular-sources/Singular/grammar.y:480:18
    #11 0x6251be in iiAllStart(procinfo*, char*, feBufferTypes, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:300:15
    #12 0x625921 in iiPStart(idrec*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:402:9
    #13 0x62644b in iiMake_proc(idrec*, sip_package*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:532:22
    #14 0x5cedca in jjPROC(sleftv*, sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc
    #15 0x5d2d45 in iiExprArith2TabIntern(sleftv*, sleftv*, int, sleftv*, int, sValCmd2 const*, int, int, sConvertTypes const*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8165:31
    #16 0x5d34aa in iiExprArith2(sleftv*, sleftv*, int, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8306:12
    #17 0x602e15 in jjKLAMMER_PL(sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:7381:7
    #18 0x5d6af6 in iiExprArithM(sleftv*, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8828:13
    #19 0x5c9420 in yyparse() /homes/combi/kastner/local/asan/singular-sources/Singular/grammar.y:480:18
    #20 0x6251be in iiAllStart(procinfo*, char*, feBufferTypes, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:300:15
    #21 0x625921 in iiPStart(idrec*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:402:9
    #22 0x62644b in iiMake_proc(idrec*, sip_package*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:532:22
    #23 0x5cedca in jjPROC(sleftv*, sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc
    #24 0x5d2d45 in iiExprArith2TabIntern(sleftv*, sleftv*, int, sleftv*, int, sValCmd2 const*, int, int, sConvertTypes const*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8165:31
    #25 0x5d34aa in iiExprArith2(sleftv*, sleftv*, int, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8306:12
    #26 0x602e15 in jjKLAMMER_PL(sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:7381:7
    #27 0x5d6af6 in iiExprArithM(sleftv*, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8828:13
    #28 0x5c9420 in yyparse() /homes/combi/kastner/local/asan/singular-sources/Singular/grammar.y:480:18
    #29 0x6251be in iiAllStart(procinfo*, char*, feBufferTypes, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:300:15

Direct leak of 15465 byte(s) in 3 object(s) allocated from:
    #0 0x57b658 in __interceptor_malloc /homes/combi/kastner/local/asan/llvm-6.0.0-src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:88
    #1 0xdb4d11 in omAllocFromSystem /homes/combi/kastner/local/asan/singular-sources/omalloc/omAllocSystem.c:188:9
    #2 0x624730 in iiGetLibProcBuffer(procinfo*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:253:31
    #3 0x6257f2 in iiPStart(idrec*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:370:9
    #4 0x62644b in iiMake_proc(idrec*, sip_package*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:532:22
    #5 0x5cedca in jjPROC(sleftv*, sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc
    #6 0x5d2d45 in iiExprArith2TabIntern(sleftv*, sleftv*, int, sleftv*, int, sValCmd2 const*, int, int, sConvertTypes const*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8165:31
    #7 0x5d34aa in iiExprArith2(sleftv*, sleftv*, int, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8306:12
    #8 0x602e15 in jjKLAMMER_PL(sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:7381:7
    #9 0x5d6af6 in iiExprArithM(sleftv*, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8828:13
    #10 0x5c9420 in yyparse() /homes/combi/kastner/local/asan/singular-sources/Singular/grammar.y:480:18
    #11 0x6251be in iiAllStart(procinfo*, char*, feBufferTypes, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:300:15
    #12 0x625921 in iiPStart(idrec*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:402:9
    #13 0x62644b in iiMake_proc(idrec*, sip_package*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:532:22
    #14 0x5cedca in jjPROC(sleftv*, sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc
    #15 0x5d2d45 in iiExprArith2TabIntern(sleftv*, sleftv*, int, sleftv*, int, sValCmd2 const*, int, int, sConvertTypes const*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8165:31
    #16 0x5d34aa in iiExprArith2(sleftv*, sleftv*, int, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8306:12
    #17 0x602e15 in jjKLAMMER_PL(sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:7381:7
    #18 0x5d6af6 in iiExprArithM(sleftv*, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8828:13
    #19 0x5c9420 in yyparse() /homes/combi/kastner/local/asan/singular-sources/Singular/grammar.y:480:18
    #20 0x5b7a12 in main /homes/combi/kastner/local/asan/singular-sources/Singular/tesths.cc:232:3
    #21 0x151354487724 in __libc_start_main (/lib64/libc.so.6+0x20724)

Direct leak of 4151 byte(s) in 1 object(s) allocated from:
    #0 0x57b658 in __interceptor_malloc /homes/combi/kastner/local/asan/llvm-6.0.0-src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:88
    #1 0xdb4d11 in omAllocFromSystem /homes/combi/kastner/local/asan/singular-sources/omalloc/omAllocSystem.c:188:9
    #2 0x624730 in iiGetLibProcBuffer(procinfo*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:253:31
    #3 0x6257f2 in iiPStart(idrec*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:370:9
    #4 0x62644b in iiMake_proc(idrec*, sip_package*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:532:22
    #5 0x5cedca in jjPROC(sleftv*, sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc
    #6 0x5d2d45 in iiExprArith2TabIntern(sleftv*, sleftv*, int, sleftv*, int, sValCmd2 const*, int, int, sConvertTypes const*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8165:31
    #7 0x5d34aa in iiExprArith2(sleftv*, sleftv*, int, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8306:12
    #8 0x602e15 in jjKLAMMER_PL(sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:7381:7
    #9 0x5d6af6 in iiExprArithM(sleftv*, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8828:13
    #10 0x5c9420 in yyparse() /homes/combi/kastner/local/asan/singular-sources/Singular/grammar.y:480:18
    #11 0x5b7a12 in main /homes/combi/kastner/local/asan/singular-sources/Singular/tesths.cc:232:3
    #12 0x151354487724 in __libc_start_main (/lib64/libc.so.6+0x20724)

Direct leak of 1768 byte(s) in 1 object(s) allocated from:
    #0 0x57b658 in __interceptor_malloc /homes/combi/kastner/local/asan/llvm-6.0.0-src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:88
    #1 0xdb4d11 in omAllocFromSystem /homes/combi/kastner/local/asan/singular-sources/omalloc/omAllocSystem.c:188:9
    #2 0x624730 in iiGetLibProcBuffer(procinfo*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:253:31
    #3 0x6257f2 in iiPStart(idrec*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:370:9
    #4 0x62644b in iiMake_proc(idrec*, sip_package*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:532:22
    #5 0x5cedca in jjPROC(sleftv*, sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc
    #6 0x5d2d45 in iiExprArith2TabIntern(sleftv*, sleftv*, int, sleftv*, int, sValCmd2 const*, int, int, sConvertTypes const*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8165:31
    #7 0x5d34aa in iiExprArith2(sleftv*, sleftv*, int, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8306:12
    #8 0x602e15 in jjKLAMMER_PL(sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:7381:7
    #9 0x5d6af6 in iiExprArithM(sleftv*, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8828:13
    #10 0x5c9420 in yyparse() /homes/combi/kastner/local/asan/singular-sources/Singular/grammar.y:480:18
    #11 0x6251be in iiAllStart(procinfo*, char*, feBufferTypes, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:300:15
    #12 0x625921 in iiPStart(idrec*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:402:9
    #13 0x62644b in iiMake_proc(idrec*, sip_package*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:532:22
    #14 0x5cedca in jjPROC(sleftv*, sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc
    #15 0x5d2d45 in iiExprArith2TabIntern(sleftv*, sleftv*, int, sleftv*, int, sValCmd2 const*, int, int, sConvertTypes const*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8165:31
    #16 0x5d34aa in iiExprArith2(sleftv*, sleftv*, int, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8306:12
    #17 0x602e15 in jjKLAMMER_PL(sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:7381:7
    #18 0x5d6af6 in iiExprArithM(sleftv*, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8828:13
    #19 0x5c9420 in yyparse() /homes/combi/kastner/local/asan/singular-sources/Singular/grammar.y:480:18
    #20 0x6251be in iiAllStart(procinfo*, char*, feBufferTypes, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:300:15
    #21 0x625921 in iiPStart(idrec*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:402:9
    #22 0x62644b in iiMake_proc(idrec*, sip_package*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iplib.cc:532:22
    #23 0x5cedca in jjPROC(sleftv*, sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc
    #24 0x5d2d45 in iiExprArith2TabIntern(sleftv*, sleftv*, int, sleftv*, int, sValCmd2 const*, int, int, sConvertTypes const*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8165:31
    #25 0x5d34aa in iiExprArith2(sleftv*, sleftv*, int, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8306:12
    #26 0x602e15 in jjKLAMMER_PL(sleftv*, sleftv*) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:7381:7
    #27 0x5d6af6 in iiExprArithM(sleftv*, sleftv*, int) /homes/combi/kastner/local/asan/singular-sources/Singular/iparith.cc:8828:13
    #28 0x5c9420 in yyparse() /homes/combi/kastner/local/asan/singular-sources/Singular/grammar.y:480:18
    #29 0x5b7a12 in main /homes/combi/kastner/local/asan/singular-sources/Singular/tesths.cc:232:3

SUMMARY: AddressSanitizer: 44773 byte(s) leaked in 13 allocation(s).

It seems also to occur for char=0. Furthermore the number of leaks varies with every call. This is with the current spielwiese branch. Can you reproduce?

Change History (0)

Note: See TracTickets for help on using tickets.