PDA

View Full Version : Bus Error?



taylor34
15th February 2006, 16:38
Hey--

Working on a sun workstation with qt 3.3, I've been getting a random bus error from one of my gui's. I've got a list of 32 buttons, basically clicking the button activates a boolean in an array stored off in some legacy C code. If I switch the checkbox buttons around to activate all 32 at one time, there's no problem. However, just doing it one by one causes it to blow up at some point between 2 and 20 clicks. I deleted all the buttons and redid them, doesn't help. Making the array of 32 booleans in the legacy C code integers only makes the issue worse (1 to 5 clicks to blow up instead of 2 to 20). It definitely has something to do with that array, but doesn't really make any sense why that should be causing the QT stuff to blow up. From the debugger, it appears as though one of the widgets may acquire an invalid address (0x1010101) at some point. Any suggestions? I'm going to try and run it under windows to see if that makes a difference too. Thanks!

Taylor34

jacek
15th February 2006, 16:44
From the debugger, it appears as though one of the widgets may acquire an invalid address (0x1010101) at some point. Any suggestions?
Doesn't it look like the contents of that array?

Do you use threads? Could you post the code which is run after the click?

wysota
15th February 2006, 16:48
The bus error on Solaris is sometimes caused by a bug in the compiler. Take that into consideration when looking for solutions.

taylor34
15th February 2006, 17:07
The bus error on Solaris is sometimes caused by a bug in the compiler. Take that into consideration when looking for solutions.

That's what I was wondering, because where it breaks in the debugger is way down in some of the qt base files, way after the C baseline code has executed. It appears to die because it tries to do qlnode::getData() on an invalid widget address (the 0x1010101) that it gets from "it", some variable inside the qt baseline code.

Taylor34

taylor34
16th February 2006, 00:40
Btw, found out the problem. When I was passing my button number down to lower legacy stuff, it was interpretting it as hex so 24 became 36, blowing out the boundaries of my boolean array. Now why it caused the qt stuff to blow up on the sun, I don't know--it blew up in the correct place on windows. At least this is here for future reference by someone.

Taylor34