- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: weird SIGBUSs
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2006 04:41 AM
тАО10-19-2006 04:41 AM
I got another boring issue that I even do not know why it is happening.
I compiled application in ELF64 mode.
In the middle of application I got 2 cases when I got SIGBUS
1:
Program received signal SIGBUS, Bus error.
0x800003ffff4f8f70 in _XtAddCallback (callbacks=0x8000000100024c78, callback=0x800003ffff44a398, closure=0x0) at Callback.c:128
128 cl->callback = callback;
(gdb)
(gdb) l
123 *callbacks = icl;
124 icl->count = count + 1;
125 icl->is_padded = 0;
126 icl->call_state = 0;
127 cl = ToList(icl) + count;
128 cl->callback = callback;
129 cl->closure = closure;
130 } /* _XtAddCallback */
131
132 void _XtAddCallbackOnce(callbacks, callback, closure)
(gdb) p cl->callback
$1 = (signed char (*)()) 0xc1c6c4800000000
(gdb) p callback
$2 = (signed char (*)()) 0x800003ffff44a398
(gdb) p cl->closure
$3 = (signed char *) 0x448dfcc00000000
(gdb) p closure
$4 = (signed char *) 0x0
All the pointer that are accessed on the time when SIGBUS arrive are valid why this could occur?
2. I have a char* variable that has a value like
0x8000000100006308 "string"
then I invoke the procedure that does nothing and just return this pointer back - something like this
char* Name(name)
{
return name;
}
name=Name(name);
and after that I have name = 0x6308
It just return 4 last digits for some reason. I fill that there is something with data/code alignment but do not know how to fight with this.
Thanks for all advises if any.
Solved! Go to Solution.
- Tags:
- SIGBUS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2006 04:56 AM
тАО10-19-2006 04:56 AM
Solution> {
> return name;
> }
Because "name" is not explicitly typed, it's
an "int", which may be shorter than a
(64-bit) pointer.
The compiler didn't complain?
char* Name( char *name)
Of course, if "like this" really means
"better than this", then the problem could be
somewhere else.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2006 05:02 AM
тАО10-19-2006 05:02 AM
Re: weird SIGBUSs
alp $ type TMP.C
char* Name(name)
{
return name;
}
alp $ cc TMP.C
return name;
.......^
%CC-W-CVTDIFTYPES, In this statement, "name" of type "int", is being converted t
o "pointer to char".
at line number 3 in file ALP$DKA0:[SMS]TMP.C;1
That's with:
alp $ cc /version
HP C V7.1-015 on OpenVMS Alpha V7.3-2
But I'd expect any good compiler to say
something about this usage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2006 05:37 AM
тАО10-19-2006 05:37 AM
Re: weird SIGBUSs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2006 10:40 AM - edited тАО10-23-2011 08:14 PM
тАО10-19-2006 10:40 AM - edited тАО10-23-2011 08:14 PM
Re: weird SIGBUSs
>But I'd expect any good compiler to say something about this usage.
It does:
$ cc -Ae -c type.c +DD64
cc: "type.c", line 2: warning 725: Return converts 32 bit integer to pointer.
If you compile with +We725, you can make it an error.
On IPF or with cadvise you get:
$ cc -Ae -c type.c +wlint
"type.c", line 1: warning #2267-D: old-style parameter list (anachronism)
char* Name(name) {
"type.c", line 1: warning #3051-D: standard requires that parameter "name" be given a type by a subsequent declaration ("int" assumed)
char* Name(name) {
"type.c", line 2: warning #2120-D: return value type does not match the function type
return name;
And there is also +w64bit.
- Tags:
- +wlint
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-19-2006 11:25 PM
тАО10-19-2006 11:25 PM
Re: weird SIGBUSs
Just for the record, it returned the low
_eight_ (hexadecimal) digits (the low 32 bits).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2006 01:20 AM
тАО10-20-2006 01:20 AM
Re: weird SIGBUSs
I just typed example by memory and made mistake. Surely there is type in name variable. Anyway using your logic I have found mistake - there was function declaration beyond scope where it was used. Some compilers understand this but some obviously not.
If some thought could came to you according to situation #1 I described it would be very helpful for me.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2006 01:45 AM
тАО10-20-2006 01:45 AM
Re: weird SIGBUSs
> scope where it was used. Some compilers
> understand this but some obviously not.
Or it matters less when an "int" and a
pointer are the same size.
In any case, I'm glad you figured it out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2006 05:14 AM
тАО10-20-2006 05:14 AM
Re: weird SIGBUSs
~thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2006 03:23 AM
тАО10-26-2006 03:23 AM
Re: weird SIGBUSs
It is just part of the standard Xt library. I have feeling that there is some memory corruption in my application. Is there any tool that could help me to check memory using in run-time on HP-UX 11.11?
I am compiling the code in 64 bit elf mode using gcc.
Thanks.