On 2017-11-10 07:58, C Smith wrote: > Agreed the segfault is inside pthread_cond_wait(), the contents of the > args are seen in previous post. > dmesg says this: > app[12316]: segfault at c ip b76fe0db sp b771c268 error 4 in > libpthread-2.15.so <http://libpthread-2.15.so>[b76f4000+16000] > > And gdb shows me the same address. After a segfault generated inside gdb: > p $_siginfo._sifields._sigfault.si_addr > $9 = (void *) 0xc > > I've done further testing and in gdb I found that my app segfaults > before hitting the first line of main(). > Thus I am unable to catch it in gdb with a hardware watchpoint. I > attempted to do so by first making my > app hit a breakpoint on the first line of main(), then I set a > watchpoint on 0xC in > gdb and run, but I never get a segfault after that point, after over 100 > runs.
You can set a breakpoint on __rt_print_init, e.g. > > Note that the app launches only 1 realtime thread now in these tests (in > original tests it had 3 threads). > Here is the one way I was able to get the app to run without > segfaulting, even with multiple real > time threads: I set kernel boot option maxcpus=1. (on a SMP kernel with > 4 cores). I was then able to run > the app over 80 times with no segfault. > > So the segfault is happening on about 10% of runs, in printer_loop(), > apparently before the first line of main(), and I am unable to > catch the bad memory access in a debugger with a watchpoint. > Do you have a suggestion as to how to further debug this? See above. Maybe that alone will give you a hint: if that function, for what ever reason, happens to be called twice, that could explain the issue as well. Then please catch the backtraces of all invocations. Jan -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 181 bytes Desc: OpenPGP digital signature URL: <http://xenomai.org/pipermail/xenomai/attachments/20171110/bfad5d61/attachment.sig> _______________________________________________ Xenomai mailing list Xenomai@xenomai.org https://xenomai.org/mailman/listinfo/xenomai