On 14/10/12 21:23, Jaime Oliver wrote:
OK, so I got it running and the crash is always in line 727:
Program received signal SIGSEGV, Segmentation fault. 0x00007fffe18f8418 in pix_mano::processGrayImage (this=<optimized out>, image=...) at pix_mano.cpp:727 727 if (base[chGray + xcoord] == 80) { // if we find a point (gdb) watchdog: signaling pd... watchdog: signaling pd...
Now, I know where that is, but I just don't understand how there can be a problem with this. Or what the problem is for that matter.
base could be null or other invalid memory address or (chGray + xcoord) could be outside valid memory when offset by base.
I mean, I am merely doing a test that the external does all the time.
You're doing several things in that line: computing "(chGray + xcoord) * sizeof(array type of base)" then reading a number of bytes from that memory location, then comparing it to 80, and then testing the result. The "reading from that memory location" part is what generally causes SIGSEGV.
Furthermore, it doesn't crash in earlier linux versions...
Assuming identical Gem version (otherwise it could be internal Gem changes breaking previously sensible code):
Probably coincidence, unless xcoord is coming from some kernel driver, or the memory layout is different in such a way that a previously masked bug now causes problems.
Any suggestions?
first, run with -nrt to avoid watchdog spam.
Then in gdb, "info locals", "print base", "print xcoord", "help", etc