0

I have NetBSD5.1 source. I have compiled the kernel and userland with the source. When I native compile a sample C program with pthread_create() in ARM NetBSD5.1, it is crashing. Same program is running successfuly in my Linux PC. Want to know if Pthread is supported in ARM machine which run NetBSD5.1 OS?

Note: other sample C programs native compiled in ARM machine runs successfully.

  • @greg-a-woods I have somehow able to arrive at this bt (gdb) bt #0 0x4003ad5c in pthread_setcancelstate () from /usr/lib/libpthread.so.0 #1 0x400af724 in inet_network () from /usr/lib/libc.so.12 #2 0x400af724 in inet_network () from /usr/lib/libc.so.12 Previous frame identical to this frame (corrupt stack?) also I compiled the program statically and I got this #0 0x000232b4 in __flockfile_internal () #1 0x00022ae0 in fflush () #2 0x00022ae0 in fflush () Any clue to debug this? Moving to the latest NetBSD is not an option for me – Zaid Ibrahime Feb 08 '16 at 13:52

1 Answers1

0

It should work, I think. (I don't have an ARM system running 5.1 at the moment -- mine are running a pre-7.0 -current.)

If you can show some more details about the crash, e.g. stack backtraces from the debugger, then perhaps I or someone else can provide more help.

Greg A. Woods
  • 2,663
  • 29
  • 26
  • @greg-a-woods Thasnks a lot. Program received signal SIGSEGV, Segmentation fault. 0x64aa0640 in ?? () (gdb) bt #0 0x64aa0640 in ?? () #1 0x4003ae64 in ?? () from /usr/lib/libpthread.so.0 #2 0x4003ae64 in ?? () from /usr/lib/libpthread.so.0 Backtrace stopped: previous frame identical to this frame (corrupt stack?)
    Its just a simple program with pthread_create(). the same program is executing successfully in i386.
    – Zaid Ibrahime Feb 01 '16 at 09:33
  • Perhaps if you can compile with `-g` to get debug symbols then the backtrace would be more meaningful. Perhaps you could also edit your question and insert a copy of the full source for your test program. I'm still not sure if pthreads should work on NetBSD/arm-5.1 but I have no problem running test programs with pthreads on NetBSD/arm-7.99.8 on my RPi B+. Perhaps you could upgrade to NetBSD-7. – Greg A. Woods Feb 01 '16 at 22:23
  • I have compiled my program with -g and the libraries are saying "not stripped" as well. Maybe there is some bug with gdb. – Zaid Ibrahime Feb 02 '16 at 09:07