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

Bug report, Segmentation fault #1

Open
zzczzc20 opened this issue Aug 19, 2022 · 3 comments
Open

Bug report, Segmentation fault #1

zzczzc20 opened this issue Aug 19, 2022 · 3 comments

Comments

@zzczzc20
Copy link

In slate/tester.cpp "strcpy(mem, "trombone\n");" cause segmentation fault since char* men isn't initialized. Please fix it.

@zzczzc20
Copy link
Author

The reason may be different from what I thought before. It seems that *pointer = 0xffffffffffffffff after code "*pointer = shmat(buf_id, 0, 0);" in slateMalloc function. Do you know the reason?

@zzczzc20
Copy link
Author

zzczzc20 commented Aug 19, 2022

It is because the key of shmget equals 0, which is read from fdin. It indicates that the file it read from is empty.

@zzczzc20
Copy link
Author

zzczzc20 commented Aug 19, 2022

I find the accurate reason. The type of variable "size" in SlateClient::do_malloc() is int, if you change it to size_t, the bug will be solved.

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

No branches or pull requests

1 participant