[Coin-discuss] writesol.c problem on Linux AMPL-callable cbc

Derek G Jones scunacc at yahoo.com
Mon Jul 31 12:11:27 EDT 2006


Dear folks,

Wondered if anyone had had a problem (and subsequently a solution!
:-) with AMPL-callable cbc crashing in writesol.c?

>From the latest SVN sources, I can build the AMPL-callable solver
just fine, but, if I give it a small sample .nl file to solve, it
does indeed run, but, the writesol.c routine bombs out.

Here's the message from a debug version in xxgdb:


Program received signal SIGSEGV, Segmentation fault.
0x08341bcf in getsufhead (asl=0x8456d48, d=0x84572e4, sh=0xbfff8d30,
np=0xbfff8e48, zp=0xbfff8e1c) at writesol.c:73
73      writesol.c: No such file or directory.
        in writesol.c
Current language:  auto; currently c
(xxgdb) where
#0  0x08341bcf in getsufhead (asl=0x8456d48, d=0x84572e4,
sh=0xbfff8d30, np=0xbfff8e48, zp=0xbfff8e1c) at writesol.c:73
#1  0x08342f01 in write_solx_ASL (asl=0x8456d48, msg=0xbfff8eb0 "Cbc
1.01 optimal, objective 2e+11\n0 nodes, 0 iterations", x=0x4109a008,
y=0x8607a88, oi=0x8440360, fw_d=0x835e680 <fwrite>, fw_i=0x835e680
<fwrite>, fw_s=0x835e680 <fwrite>) at writesol.c:456
#2  0x08343241 in write_sol_ASL (asl=0x8456d48, msg=0xbfff8eb0 "Cbc
1.01 optimal, objective 2e+11\n0 nodes, 0 iterations", x=0x4109a008,
y=0x8607a88, oi=0x8440360) at writesol.c:526
#3  0x08084a1b in writeAmpl (info=0xbfffed80) at Cbc_ampl.cpp:555
#4  0x08050556 in main (argc=4, argv=0x8457168) at CoinSolve.cpp:1255
(xxgdb)


And here is the piece from writesol.c (I know that's solvers.tar
code, but I'm asking here in case this is an obvious thing).


getsufhead(ASL *asl, SufDesc *d, SufHead *sh, int *np, int **zp)
{
        int i, *ip, *ipe, n, nz;
        real *rp, *rpe;

        memcpy(sh->sufid, "\nSuffix\n", 8);
        sh->kind = d->kind &
                (ASL_Sufkind_mask | ASL_Sufkind_real |
ASL_Sufkind_iodcl);
        *np = n = (&asl->i.n_var_)[i = d->kind & ASL_Sufkind_mask];
        *zp = i < 2 ? asl->i.z[i] : 0;
        nz = 0;
        if (d->kind & ASL_Sufkind_real) {
                rp = d->u.r;
                rpe = rp + n;
                while(rp < rpe)
                        if (*rp++)
                                nz++;
                }
        else {
                ip = d->u.i;
                ipe = ip + n;
                while(ip < ipe)
LINE 73 ->              if (*ip++)
                                nz++;
                }
        sh->n = nz;
        sh->namelen = strlen(d->sufname) + 1;
        sh->tablen = 0;
        if (d->table)
                sh->tablen = strlen(d->table) + 1;
        }

Any help much appreciated.

Kind regards

Derek Jones.



More information about the Coin-discuss mailing list