Sponsored Content
Top Forums Programming Solaris - BUS error with optimize mode Post 302943454 by revolta25 on Friday 8th of May 2015 01:55:30 PM
Old 05-08-2015
Thanks form the reply.
No, it's just an example. It's a big system so it's hard to present problem detailed.

For some reason, when object from struct is passed by reference to function and we want to manipulate by pointer on this object it cause BUS error.

With test function with param "struct _a *obj" (so pointer to struct is passed) works correctly.

Code:
int f3(struct _a *obj)
{	
printf("%llu", obj->_a2); <--- OK	
return 0;
}

Like I wrote, without optimization works correctly.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Bus Error

This may belong in the C Programming forum, but here goes anyway... What would cause a bus error? I searched google for a cause, but came up with some conflicting reports... Could it be caused by disk space? A lot of the pages I found mentioned linking with the incorrect versions of the... (4 Replies)
Discussion started by: LivinFree
4 Replies

2. UNIX for Dummies Questions & Answers

bus error on solaris

Hi there I am running soalris 9 on a sun fire 480r and all of a sudden (today) whenever the users run the command `top` we get the following message `bus error` does anybody have any information on what this is all about and whether there is a routine i can perform to gather more... (3 Replies)
Discussion started by: hcclnoodles
3 Replies

3. Programming

BUS error

Hi! I've got a program which runs fine under Linux, but I have compiled it to run under SunOS 5.8 in a Sparc computer, and now it sometimes fails with "bus error". Ussing gdb I surfed to the error line, which is *pointer = some_vector; where some_vector is a 16 byte struct (4 integers)... (1 Reply)
Discussion started by: shesatmine
1 Replies

4. Solaris

split bus mode

Hi there, I have two SunBlade 2000s that I want to connect to a single D1000. I am told that I need to do a split bus mode. I don't really understand what that means. Does that mean that half of the storage disks will be assigned to one host and the others to the other host? How do I get... (18 Replies)
Discussion started by: Arkayev
18 Replies

5. UNIX for Dummies Questions & Answers

bus error (coredump)

Hi all, I am getting bus error problem in SunOS. Can you please help me out in this regard. Actually, my entire code till the last line has been executed. But after tht i am getting a bus error. Please help me. Thanks in advance. Charu. (4 Replies)
Discussion started by: charu
4 Replies

6. HP-UX

Bus Error

I am getting bus error when i include "#!/bin/ksh". If i remove interpreter then script is working. Can anyone explain this and how can i avoid this error? Operating System is HP-UX B.11.23 U 9000/800 1091834454 (2 Replies)
Discussion started by: anbu23
2 Replies

7. Programming

Bus error

Hi everyone, I have a GUI project and when I run it and left in idle state for a long time(there is nothing done, just opened GUI, no more actions),I get bus error after trying to do anything with it. I've tried to build it in debug mode and use gdb, but I don't get any error in debug mode.It... (3 Replies)
Discussion started by: sisi
3 Replies

8. Programming

Bus Error: 10...Help please!

Hi all, I am writing a phonebook program to store names and number using a list. Here is the code for the function which allows the user to enter the name and number (where the error occurs). //THIS FUNCTION ADDS A NEW ENTRY TO THE phonebook_list void insert(void){ //variables int... (5 Replies)
Discussion started by: kdejan
5 Replies

9. Solaris

Howto solve this disk error in Solaris in single user mode

Hi all, OS is Solaros 10 Sparc While doing Netbackup upgradation to 7.5 , the server was asked to reboot. But then it came up in single user mode, and after I typed format command it showed some disk error. bash-3.00# format Searching for disks...WARNING:... (2 Replies)
Discussion started by: manalisharmabe
2 Replies
Object::ID(3pm) 					User Contributed Perl Documentation					   Object::ID(3pm)

NAME
Object::ID - A unique identifier for any object SYNOPSIS
package My::Object; # Imports the object_id method use Object::ID; DESCRIPTION
This is a unique identifier for any object, regardless of its type, structure or contents. Its features are: * Works on ANY object of any type * Does not modify the object in any way * Does not change with the object's contents * Is O(1) to calculate (ie. doesn't matter how big the object is) * The id is unique for the life of the process * The id is always a true value USAGE
Object::ID is a role, rather than inheriting its methods they are imported into your class. To make your class use Object::ID, simply "use Object::ID" in your class. package My::Class; use Object::ID; Then write your class however you want. METHODS
The following methods are made available to your class. object_id my $id = $object->object_id; Returns an identifier unique to the $object. The identifier is not related to the content of the object. It is only unique for the life of the process. There is no guarantee as to the format of the identifier from version to version. For example: my $obj = My::Class->new; my $copy = $obj; # This is true, $obj and $copy refer to the same object $obj->object_id eq $copy->object_id; my $obj2 = My::Class->new; # This is false, $obj and $obj2 are different objects. $obj->object_id eq $obj2->object_id; use Clone; my $clone = clone($obj); # This is false, even though they contain the same data. $obj->object_id eq $clone->object_id; object_uuid my $uuid = $object->object_uuid Like "$object->object_id" but returns a UUID unique to the $object. Only works if Data::UUID is installed. See Data::UUID for more details about UUID. FAQ
Why not just use the object's reference? References are not unique over the life of a process. Perl will reuse references of destroyed objects, as demonstrated by this code snippet: { package Foo; sub new { my $class = shift; my $string = shift; return bless {}, $class; } } for(1..3) { my $obj = Foo->new; print "Object's reference is $obj "; } This will print, for example, "Object's reference is Foo=HASH(0x803704)" three times. How much memory does it use? Very little. Object::ID stores the ID and address of each object you've asked the ID of. Once the object has been destroyed it no longer stores it. In other words, you only pay for what you use. When you're done with it, you don't pay for it any more. LICENSE
Copyright 2010, Michael G Schwern <schwern@pobox.com>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/perl/misc/Artistic.html> THANKS
Thank you to Vincent Pit for coming up with the implementation. perl v5.12.4 2011-09-26 Object::ID(3pm)
All times are GMT -4. The time now is 08:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy