Operating System - HP-UX
1751720 Members
3108 Online
108781 Solutions
New Discussion юеВ

Debugging a program, error with XMapWindow function.

 
Eder Urruela
Frequent Advisor

Debugging a program, error with XMapWindow function.

Hello I have copiled rencently an old program from a version 10 of the HPUX to the 11.11.

The program crashes and when I'm debugging it resturns me the following messege in the line which causes the failure.

Program received signal SIGBUS, Bus error.
0x7adf99a8 in XMapWindow () from /usr/lib/X11R6/libX11.3

I have been trying to find the line where the function XMapWindow is called. But after a long search under the call from one c file to another I have not get anything.

The probles is located in a function called ZtDo but in the body of this function I have not found the XMapWindow.

Anyone could give a clue about how to search the problem?

I Know I am not very especific, but I can't access to the body of the function with the debugger.

I link the function code here if it can help.

Thanks!
5 REPLIES 5
Dennis Handly
Acclaimed Contributor

Re: Debugging a program, error with XMapWindow function.

Where is your full stack trace?
Have you compiled with -g? That should give the line number.

>The problem is located in a function called ZtDo but in the body of this function I have not found the XMapWindow.

Perhaps there is an evil macro that expands to XMapWindow?
Compile with -E and save stdout.
Eder Urruela
Frequent Advisor

Re: Debugging a program, error with XMapWindow function.

>Where is your full stack trace?
>Have you compiled with -g? That should give the line number.

It was compiled with -g? but the call and I dont Know why, but I can not access to the code of the ZtDo function in debugging mode.

The trace is the following.

Debuggind fist at all the program ivibuild calls to a funci├Г┬│n DzRestoreStatWindow()
This function has the body in the liberror.c
and the problems and the line in CDzRestoreStatWindow() who causes de failure is the following "rtn &= CustomStatText(MsgWinID);"

CustomStatText is called in othe program called libIVI. and calls the following function "DzFByObjName(baseObject, objName)" and this function is in other program statwidow.c
An in this last function is where is called the ZtDo function from do.c, but the debugger does not open do.c and I cant follow with the search.

When I do a a new compilation of do.c with -E I haven't found any XMapWindow function.

It's so confusing.

Thanks!
Dennis Handly
Acclaimed Contributor

Re: Debugging a program, error with XMapWindow function.

>I can not access to the code of the ZtDo function in debug mode.

Any particular messages?
What compiler version are you using? What gdb version?

>The trace is the following.

Please provide the gdb bt output.

>And in this last function is where is called the ZtDo function from do.c, but the debugger does not open do.c

You can use the "dir" command to add the source path.

>When I do a a new compilation of do.c with -E I haven't found any XMapWindow function.

Then one way of calling XMapWindow would be through a pointer to a function, an indirect call.
Eder Urruela
Frequent Advisor

Re: Debugging a program, error with XMapWindow function.

>Any particular messages?

I upload a txt where are all the messeges the gdb returns in the debugging process.

>Please provide the gdb bt output.

I don't know what is the gdb bt output. I hope it were the file I have uploaded.

>Then one way of calling XMapWindow would be through a pointer to a function, an indirect call.

I'm thinking about the call to the ZtDo function, this function comes from another libary, and the parameter of the function call could be mistaken.

ZtDo(MsgWinID,ZtUPDATE,NULL);

ZtUPDATE parametes comes from extern and I thinks is possible that this parameter cotains data that could provoque the error.

Thank you for your time.
Dennis Handly
Acclaimed Contributor

Re: Debugging a program, error with XMapWindow function.

>I don't know what is the gdb bt output.

You execute the "bt" command to get a stack trace.

You are also using an obsolete gdb, the latest is 6.0. You can download it from:
http://www.hp.com/go/wdb