fixing problem with with studio 11

Hello

I have problems using the fix command in studio 11

when I try to fix my program I get a warning and afterwards dbx crashes:

dbx >fix -v -f

/opt/Sun_Studio11/SUNWspro/prod/bin/cc -g -c -o testinfowin.o -I /v10.0/sources/include -D_POSIX_PTHREAD_SEMANTICS -v -DANSI -DSYS='UNIX_V' test.c -W0,-xp\$XAjQAqAhDgNGnrg.-c -o /tmp/dbx.fix.test.o.24753.464.6.o

"test.c", line 22: warning: Function has no return statement : main

/usr/ccs/bin/ld -G -o /tmp/dbx.fix.test.o.24753.464.5.so /tmp/dbx.fix.test.o.24753.464.6.o

dbx: warning: new function '' found in "test.c"

dbx: warning: new function '' found in "test.c"

handler (2) moved to "test.c":14

dbx: internal error: signal SIGSEGV (no mapping at the fault address)

dbx's coredump will appear in /tmp

Abort (core dumped)

The strange thing with this is, that there is no new function.

The problem doesn't occur with older Verions of dbx

Does any one know this problem or a solution?

Thanks

Clemens

[1068 byte] By [ClemensBrogia] at [2007-11-15]
# 1

Looks like a bug in dbx, which I am not aware of...

It wouldn't hurt however to try to install latest patches (both OS and Sun Studio ones):

http://developers.sun.com/sunstudio/downloads/patches/ss11_patches.html

Maybe it is linker issue?

Could you also post dbx stack trace here? It can be obtained with

$ pstack /tmp/core

right after dbx has crashed. It would also be great to have a reproducible test case if you can manage it, of course.

And by the way, which version of Solaris you are running?

MaximKartasheva at 2007-7-12 > top of java,Development Tools,Solaris and Linux Development Tools...
# 2

Hello Maxim

thanks for your reply.

> Looks like a bug in dbx, which I am not aware of...

> It wouldn't hurt however to try to install latest

> patches (both OS and Sun Studio ones):

> http://developers.sun.com/sunstudio/downloads/patches/

> ss11_patches.html

> Maybe it is linker issue?

>

I have already installed patches

121023-04

109147-43

108434-22

121017-10

121015-04

...

> Could you also post dbx stack trace here? It can be

> obtained with

> $ pstack /tmp/core

> right after dbx has crashed.

here is the output from pstack:

pstack /tmp/core

core '/tmp/core' of 24753:/opt/Sun_Studio11/SUNWspro/bin/../prod/bin/sparcv9/dbx testinfowin

ffffffff7e5a7ed4 _kill (ffffffff7e6b6f60, 60b1, 10052db5d, 1006085c0, 10052d000, 10052d) + 8

00000001000c1fcc ? (b, 100400, 100633, 100400, 100635000, 10053a628)

ffffffff7e5a72f0 sigacthandler (b, ffffffff7fffb020, ffffffff7fffad40, b, 81010100, 10065a2d4) + 2c

called from signal handler with signal 11 (SIGSEGV)

ffffffff7e53c1ec strlen (0, 0, 10062a140, 100549029, 0, 0) + 7c

ffffffff7e591a10 vprintf (0, 10062a0c0, ffffffff7e6c4c90, ffffffff7fffc2a8, 10054901c, 100400) + ec

0000000100332f30 __1cHvprintx6Fpkcpv_i_ (10054901c, ffffffff7fffc2a8, ffffffff7fffc2a8, 0, 1005b7000, 1005b79d8) + 2c

0000000100333210 __1cGprintx6FpkcE_i_ (10054901c, 0, 1016a9950, ee6, 10064de40, 100400) + 1c

00000001001457cc ? (10053a628, 1016a7980, 100633, 1010f6d60, 100548f40, 0)

0000000100146e7c ? (100655ed0, 100736fc0, ffffffff7fffc9a8, 1005493ea, 1, 1005493ce)

000000010014808c ? (100655ed0, 100736fc0, ffffffff7fffc9a8, 100548000, 100548, 100548)

0000000100147118 __1cHfix_cmd6FpnGInterp_ppcbbbbb_v_ (100655ed0, 100a9bdb8, 1, 1, 0, 1) + 68

000000010017d650 ? (100655ed0, 100400, 0, 1, 1, e)

00000001002c67f4 ? (10017d204, 1010f6500, 100a9bda0, 10066b3b0, 0, 100655ef0)

00000001002c55a0 __1cNpdksh_execute6FpnGInterp_pnCop_i_i_ (1010f6540, 1010f8e70, 0, 1002c5, 100655ed0, 10053a) + 1e8

00000001002b2134 __1cLpdksh_shell6FpnGInterp_pnGSource__i_ (100655ed0, 1015ec7c0, 100593679, 100593680, 100655ed9, 1000c19bc) + 4cc

00000001000c5eb4 __1cNmain_cmd_loop6FpnGInterp__v_ (100655ed0, 100400, 10057e000, 100610a60, 10057e358, 10052ec6a) + a8

00000001000c6cd8 main (2, ffffffff7fffdf88, 100655ed0, 8002, 10052de50, 1) + 990

00000001000b84bc _start (0, 0, 0, 0, 0, 0) + 17c

> It would also be great

> to have a reproducible test case if you can manage

> it, of course.

That' s a little bit difficult since I have to link about 11 libraries.

I don't know whether this helps you: I have written a short test program calling a function in a library It look like this

#include "osystem.h"

#include "userwin.h"

extern long InfoWindowInit(int openWindow, WINSRVFKT applMsgServer, CMDDISPATCH cmdWpFkt, ACCDATA *accel, MENUDATA *menu, short *menuRet, char *parFileName, long mode, long helpMsgNr, char *helpString);

intInfoMainMsgServer(long winId, int mode, int par, long lppar)

{

return 0;

}

int main(int argc, char ** argv)

{

char *parFileName = "test";

InfoWindowInit(0, InfoMainMsgServer,

(CMDDISPATCH)0,

(ACCDATA*)0,

(MENUDATA *)0,

(short*)0,

parFileName,

2,0,CNULL);

}

if I omit the declaration, I get a compiler warning, but i can fix.

>

> And by the way, which version of Solaris you are

> running?

I am running Solaris 8

ClemensBrogia at 2007-7-12 > top of java,Development Tools,Solaris and Linux Development Tools...
# 3

Okay, I was able to reproduce the problem on Solaris 8 sparc. The crash does not reproduce with later version of dbx, the one from Sun Studio 12.

Unfortunately, Sun Studio 12 does not officially support Solaris 8; it might work in some areas, but might not in some others. To workaround this issue, you can download Sun Studio 12 EA from http://developers.sun.com/sunstudio/downloads/express.jsp and use dbx 7.6.

If you have a support contract, you can escalate this issue through your support channels and get the fix.

MaximKartasheva at 2007-7-12 > top of java,Development Tools,Solaris and Linux Development Tools...