Mark Scott wrote: > Seems I spoke too soon. While the segfault was prevented in test mode > by applying Paul's patch, one occurred at a different place when not > running in test mode. The backtrace doesn't look that helpful - > presumably the ?? in non-radioclkd code indicates library calls for > which debugging info isn't available? The binary used is one compiled > with the patch applied. > > Core was generated by `/usr/sbin/radioclkd ttyS0'. > Program terminated with signal 11, Segmentation fault. > #0 0xfffff525000008b3 in ?? () > (gdb) backtrace > #0 0xfffff525000008b3 in ?? () > #1 0x000008cb000008d6 in ?? () > #2 0xfffff85000000963 in ?? () > #3 0x00000f8e0000098e in ?? () > #4 0xfffff34a000009cc in ?? () > #5 0xffffe0c800000a71 in ?? () > #6 0xfffffdf803b6e03a in ?? () > #7 0xfffffc6a00000ef2 in ?? () > #8 0x00002ba800001128 in ?? () > #9 0x0000400600001128 in ?? () > #10 0xfffff5df000015b2 in ?? () > #11 0x000007b000002c34 in ?? () > #12 0x0000000000003053 in ?? () > #13 0x0000000000004006 in ?? () > #14 0x0000000000004006 in ?? () > #15 0x0000000000400e1b in _init () > #16 0x0000000000402010 in ProcessTimeCode (c=0xb76000006fd, radio=<value > optimized out>) at radioclkd.c:709 > #17 0x00007fffeef10cb8 in ?? () > #18 0x0000000200000000 in ?? () > #19 0x00000000004024e0 in ProcessStatusChange () at radioclkd.c:845 > #20 0x0000000000000000 in ?? () > > > Line 709 in the patched source is: > > if (CalculatePPSAverage(c, &average)<0) { > > and line 845 is: > > c->correct = 0; > > (which seems strange - how can that lead, 3 frames later, to line 845?). > > Commenting out the if block surrounding the call to CalculatePPSAverage > on line 709 and always using the else block instead prevents the > segfault. The preceding comment "if possible use an averaged offset" > suggests this is OK (but perhaps less accurate or less efficient? I'm > making changes now without understanding the implications...). >
I guess the problem is in the libc qsort call, I pass in an array of timediff which is int's but tell qsort that it is of size long. Not a problem on an ia32 machine as the two are the same size. However if they are different it will cause a problem. JAB. -- Jonathan A. Buzzard Email: jonathan (at) buzzard.me.uk Northumberland, United Kingdom. Tel: +44 1661-832195 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]