-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
palloc address error #4
Comments
Hi yliam, selfie needs to be compiled into a 32-bit executable. I suspect that you are on a 64-bit system and have therefore generated a 64-bit executable. Let me know if this is the case. Please try instead: gcc -w -m32 -D'main(a, b)=main(int argc, char **argv)' selfie.c -o selfie to compile selfie and then see if this solves the problem. I just updated the README.md file with improved build instructions that should make this point easier to understand. Best, |
Hello again Professor Kirsch, I'm sorry to say I had the same results after compiling with: gcc -w -m32 -D'main(a, b)=main(int argc, char **argv)' selfie.c -o selfie I am using Debian GNU/Linux 7 debian-i386 (wheezy) on a 32 bit system. Incidentally, I am able to successfully execute selfie.m by mipster using the version released on November 16, 2015. The changes made during the implementation of hypster are somehow preventing successful emulation/virtualization for me now. See transcript below: ~/selfie ~/selfie ~/selfie You may also be surprised to hear that, in addition to standalone Debian GNU/Linux 7 debian-i386 (wheezy), the same release from November also works just fine for me under Cygwin32 on a 64-bit windows system using just: gcc selfie.c -o selfie for the initial build. I think there may be an issue somewhere in the hypster implementation. Thank you, |
Hi yliam, no worries, I very much appreciate your feedback. The problem is likely due to your system returning addresses through malloc that are negative numbers in 32-bit two's complement representation. Up until now, I had not implemented support of that in selfie. I have now taken the opportunity to do that but cannot test it. Would you be so kind, pull the new version, and try it? Many thanks! Best, |
Hi again Professor Kirsch, Per your request I just pulled cksystemsteaching-selfie-0b1a3a5 and tried it again on both Debian GNU/Linux 7 debian-i386 (wheezy) and Cygwin32, but I got a segmentation fault this time on both platforms. Please see transcript below: ~/selfie ~/selfie ~/selfie The crash under Linux did not create a stackdump file, but the Cygwin crash did: Exception: STATUS_ACCESS_VIOLATION at eip=004090A0 I hope this helps in troubleshooting. Thanks, |
Hi yliam, thank you for your feedback. I ran a few tests with negative addresses but cannot reproduce the problem. Could you please set the flags: debug_exception both to 1, then compile and run, and send me the output? Thanks! Best, |
Hi again, I'm happy to be of assistance in any way I can. Per your request, I set the debug_exception and debug_map flags, and this is what I got running the same commands: ~/selfie ~/selfie ~/selfie Thanks, |
Hi, I have tried the same way of executing selfie, but on a 32 bit Peppermint Six (Ubuntu 14.04) system, and I got the exact same error (segmentation fault) and debugging output as described above with the latest version. I also tried to use different execution sizes for selfie, not just 1 MB, but it didn't make any difference. I have also checked out the version of Feb 3, which led to the palloc address error @yliam described. The version of Dec 17 seemed to work for me, though. |
Hello everybody! Tests: On Debian 8 / gcc49, the program received SIGSEGV signal at line 4641: Program received signal SIGSEGV, Segmentation fault. Greetings, |
Thanks a lot, everyone, for your help! I suspect this is a silent integer overflow problem but I am not sure. One candidate is the address computation in tlb(). I have added additional parentheses to enforce the right order of evaluation and instrumented that with debugging code. Please pull the new version, enable debug_exception, debug_map, and debug_tlb, and rerun. There may be a lot of output now. Please attach that here as text file, if necessary. Many thanks! -ck |
Greetings Professor Kirsch, Here's my output from b977211 with debug_exception, debug_map, and debug_tlb enabled. Same three commands: Thanks, |
Thanks, yliam. I just pushed another version with simplified page frame handling. Can anyone try please? -ck |
Everyone, I finally installed my own copy of a 32-bit Ubuntu Linux system and fixed the bug. In hindsight, Christian's gdb message had all the information needed. In particular, the bug had nothing to do with my new memory management. It is rather due to differences in how compilers treat assignments. Some seem to evaluate lvalues before rvalues which in our case here lead to dereferencing a null pointer, see my comment in the newest version of the code. Please pull and test. Thanks a lot again for your help. From now on I can even do this myself (I will keep the 32-bit system). -ck |
Excellent! Now it works again for me with GCC under both Linux and Cygwin. Thanks for your help Professor Kirsch. yliam |
I am glad to hear that. Thanks a lot for your help! -ck |
Hello,
I get a palloc address error when attempting to execute selfie.m by mipster. See transcript below:
~/selfie
$ gcc selfie.c -o selfie
~/selfie
$ ./selfie -c selfie.c -o selfie.m
./selfie: this is selfie's cstarc compiling selfie.c
./selfie: writing code into output file selfie.m
~/selfie
$ ./selfie -l selfie.m -m 1
./selfie: loading code from input file selfie.m
./selfie: this is selfie's mipster executing selfie.m with 1MB of memory
./selfie: palloc address error
Please advise.
Thank you,
yliam
The text was updated successfully, but these errors were encountered: