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
DWARF_OBJECT_INIT(3)					   BSD Library Functions Manual 				      DWARF_OBJECT_INIT(3)

NAME
dwarf_object_init -- allocate a DWARF debug descriptor with application-specific file access methods LIBRARY
DWARF Access Library (libdwarf, -ldwarf) SYNOPSIS
#include <libdwarf.h> int dwarf_object_init(Dwarf_Obj_Access_Interface *iface, Dwarf_Handler errhand, Dwarf_Ptr errarg, Dwarf_Debug *dbg, Dwarf_Error *err); DESCRIPTION
The dwarf_object_init() function allocates and returns a Dwarf_Debug instance that uses application-supplied access methods to read file con- tent. The argument iface should point to a populated Dwarf_Obj_Access_Interface structure. The contents of the Dwarf_Obj_Access_Interface struc- ture are described in the section Object Access Functions below. The argument errhand should point to a function to be called in case of an error. If this argument is NULL then a default error handling scheme is used. See dwarf(3) for a description of the error handling schemes available. The argument errarg will be passed to the error handler function pointed to by argument errhand. The argument dbg should point to a memory location that will be set to a reference to the returned Dwarf_Debug descriptor. The argument err will be used to return a Dwarf_Error descriptor in case of an error. Object Access Functions The data structures used to specify object access methods are defined in <libdwarf.h>. Dwarf_Obj_Access_Interface This structure bundles together a set of file access methods along with a pointer to application-private state. typedef struct { void *object; const Dwarf_Obj_Access_Methods *methods; } Dwarf_Obj_Access_Interface; object This field points to application-specific state that will be passed as the first parameter to the actual access object meth- ods. methods This structure contains pointers to the functions implementing the access methods, as described below. Dwarf_Obj_Access_Methods This structure specifies the functions implementing low-level access. typedef struct { int (*get_section_info)(void *obj, Dwarf_Half index, Dwarf_Obj_Access_Section *ret, int *error); Dwarf_Endianness (*get_byte_order)(void *obj); Dwarf_Small (*get_length_size)(void *obj); Dwarf_Small (*get_pointer_size)(void *obj); Dwarf_Unsigned (*get_section_count)(void *obj); int (*load_section)(void *obj, Dwarf_Half ndx, Dwarf_Small **ret_data, int *error); } Dwarf_Obj_Access_Methods; get_byte_order This function should return the endianness of the DWARF object by returning one of the constants DW_OBJECT_MSB or DW_OBJECT_LSB. get_length_size This function should return the number of bytes needed to represent a DWARF offset in the object being debugged. get_pointer_size This function should return the size in bytes, in the object being debugged, of a memory address. get_section_count This function should return the number of sections in the object being debugged. get_section_info This function should return information about the section at the index ndx by filling in the structure of type Dwarf_Obj_Access_Section pointed to by argument ret. The Dwarf_Obj_Access_Section structure is described below. load_section This function should load the section specified by argument ndx into memory and place a pointer to the section's data into the location pointed to by argument ret_data. The argument obj passed to these functions will be set to the pointer value in the object field of the associated Dwarf_Obj_Access_Interface structure. The argument error is used to return an error code in case of an error. Dwarf_Obj_Access_Section This structure describes the layout of a section in the DWARF object. typedef struct { Dwarf_Addr addr; Dwarf_Unsigned size; const char *name; } Dwarf_Obj_Access_Section; addr A pointer to the start of the section's data. size The size of the section in bytes. name A pointer to a NUL-terminated string containing the name of the section. RETURN VALUES
On success, the dwarf_object_init() function returns DW_DLV_OK. In case of an error, the function returns DW_DLV_ERROR and sets the argument err. ERRORS
The dwarf_object_init() function may fail with the following errors: [DW_DLE_ARGUMENT] One of the arguments iface or dbg was NULL. [DW_DLE_DEBUG_INFO_NULL] The underlying object did not contain debugging information. [DW_DLE_MEMORY] An out of memory condition was encountered during the execution of the function. SEE ALSO
dwarf(3), dwarf_init(3), dwarf_init_elf(3), dwarf_object_finish(3) BSD
September 29, 2011 BSD
All times are GMT -4. The time now is 03:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy