Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#637 - GDB server doesn't work #5652

Closed
openwrt-bot opened this issue Mar 18, 2017 · 2 comments
Closed

FS#637 - GDB server doesn't work #5652

openwrt-bot opened this issue Mar 18, 2017 · 2 comments
Labels

Comments

@openwrt-bot
Copy link

prfi:

I've tried to debug some code using GDB server on target device (Ubiquity AP AC PRO MIPS32r2) and I've found that it doesn't work.

I'm using std command to run GDB server: "gdbserver :9000 <application_to_debug>" and I always get "sigprocmask: Invalid argument.".

I've made short investigation to find root cause of this problem and it seems that problem is located in GDB in file: "gdb/common/signals-state-save-restore.c" in line "res = sigprocmask (0, NULL, &original_signal_mask);". According to linux kernel documentation function "sigprocmask" always return "-EINVAL" when it is called with invalid "how" argument (in this case how == 0). I've fixed GDB by removing "if" statement that checks if "res < 0". After this operation GDB server works properly.

LEDE commit: 08371a2
GDB version: 7.12.1

@openwrt-bot
Copy link
Author

yousong:

I just proposed a patch to musl-libc mailing list: http://www.openwall.com/lists/musl/2017/03/22/1

@openwrt-bot
Copy link
Author

yousong:

For the record, that sigprocmask call only appears in the version bump from gdb 7.11.1 to 7.12.1.

Thanks for taking time to report and narrow the issue down to this level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant