I am using Windows 10.
I downloaded setup-x86_64.exe from https://cygwin.com/install.html and am selecting the defaults (Install from Internet/Direct Connection/default locations).
I have tried several mirrors including cygwin.mirror.constant.com
I am accepting all the default packages plus some basic developer stuff (gdb, make) and check "Select required packages (RECOMMENDED)".
I get quite a way through the Cygwin Setup and then get the first of many pop-up messages "IO Error Opening file....._autorebase/binutils/cygwin/grep/mintty etc. Do you want to skip this package?"
If I skip the packages, I get a non-working Cygwin install (it can't find mintty). If I don't skip the packages, it hangs when the Cygwin installer hangs when it gets to the first of the problem packages.
Thanks in advance about what part of the setup process I am missing.
A bit late, but anyway: I have stumbled across the same problems yesterday when I tried to install Cygwin on Windows 10 the first time.
I have followed all advice given at various sites (including this one): Disabled antivirus software, followed the Cygwin FAQ, and so on, but to no avail.
Then I studied the setup log and found a line which told something about an address mismatch (sorry that I don't have the exact wording - I surely won't repeat the experiment ...). That lead me to the idea that it might something have to do with ASLR (a technique for hardening the system against malware).
The next step was to turn off ASLR via the UI of Windows Defender. After I had done that, I could install Cygwin without any problems. I have not yet tested if I actually could use Cygwin when I turn on ASLR again; I don't feel very comfortable when having turned it off completely.
The alternative would be to turn off ASLR per executable. This is also possible in Windows Defender's UI. But it could mean adding dozens of exceptions, depending on how many Cygwin packages you have installed.
The technical reason for the problem is how POSIX's fork() works. Basically, it clones the parent process's image, using the same offset addresses. But when ASLR is active, those offsets will change when cloning the process, which will make fork() fail. Since fork() is extensively used by Cygwin, it can't operate as intended when ASLR is active.
Related
Well, this is awkward. I've installed VICE on Gentoo (Commodore 64 emulator), and... can't start it. I've looked into distfiles and I should have "x64" as a starting command (also a bunch of others programs) but there is no such thing.
Here are the USE flags, which I have:
app-emulation/vice-2.4.22 alsa gtk ipv6 lame nls png sdlsound threads vte zlib
Any advice ?
Ok found it. It's in /usr/games/bin/x64
This question, and the answer, ultimately solved my problem, but in reading the question, I think the author may have had the same underlying issue, unknowingly, which could have also been solved unknowingly.
I installed Vice, and initially, could not identify what command to run. A quick internet search lead me to this question.
Once I found the binary, I tried to run it directly, and got "permission denied". I quickly realized I was not in the "games" group.
Once in the "games" group, I simply had to restart my terminal emulator (or for better results, log out of my GUI session, and back in).
If you install cygwin these days it runs "rebaseall" as part of its post installation process. This is apparently to realign dlls in some way so that you don't get errors in fork().
At this point in the process the install looks like it has hung for me, both with 32bit and 64bit cygwin. However, if I wait long enough (say 3 hours) the install will finish. At this point the computer runs like a dog - any new process takes forever to start and I have to reboot. If I do this then all is then fine until I try and install something else at which point the whole process kicks off again.
The install is doing something weird to my computer. I have tried closing all applications, removing software - all yield the same result. I have heard others complaining about this but seen no answers other than it must be some thirdy party software. To me this looks like a bug in cygwin.
Incidentally while the install hang is going on I can see dash processes starting and stopping in task manager - so something is happening but really slowly.
Any ideas?
I'll answer my own question. The issue was Trusteer Rapport. This piece of software beloved by banks, causes all sorts of bad side effects including this one.
This is not a programming question.
It is also borderline on http://superuser.com.
A normal update postinstall autorebase step take few minutes. Likely you have some software interfering like an antivirus.
Further reading:
https://cygwin.com/problems.html
https://cygwin.com/faq/faq.html#faq.using.bloda
and ask support on the cygwin mailing list
https://cygwin.com/lists.html
i'm running raspbian (2015-05-05-raspbian-wheezy.img) in qemu using compiled kernel (https://github.com/dhruvvyas90/qemu-rpi-kernel) on ubuntu 14.04. my final goal is to launch my python script within the emulation.
i'm following manual from http://www.unixmen.com/emulating-raspbian-using-qemu/, though many others suggest very similar sequence of actions.
things i'm trying and issues i'm experiencing:
first boot is more or less ok. i comment the line in /etc/ld.so.preload as suggested and reboot.
on second boot (after i remove init=/bin/bash) and all subsequent boots i get
ERROR ../libkmod/libkmod.c:554 kmod_search_moddep: could not open moddep file '/lib/modules/3.10.25/modules.dep.bin'
some googling suggested to run "sudo rpi-update". it didn't help, same message during boot.
on second boot (after i remove init=/bin/bash) and all subsequent boots i get
fsck died with exit status 6
looking into "/var/log/fsck/checkfs" as suggested tells that some location is not there, but it doesn't say which one
running "startx" produces error message from 1. it loads the UI eventually, but desktop only has "wastebasket" icon. there is also a thick white stripe on top of the screen blinking, like it keeps trying to load a tab but fails everytime. qemu window stops to respond to further interaction after this.
running "sudo apt-get upgrade" installs some packages, but after reboot i can't even get to UI - just blank screen with mouse cursor.
i'm not very experienced with how linux is configured at low level. i understand that i might be doing something completely stoopid.
so, my questions are:
how do i debug? i couldn't figure out the settings for qemu to write logs. i really don't want to fallback to gdb, as i'm not debugging qemu itself, just want to get notification on it's events.
ctrl key doesn't seem to work inside qemu window.
no copy-paste available. or i can't see how to turn it on.
am i missing something? from all the manuals i have seen it seems like this should go much much smoother. like it should "just work".
Since your post many things changed. The most important things is that now using Andrew Baumann GitHub repo you can build QEMU that boots recent Raspbian. I described my experience woth this code here. Instructions are straight forward. Implementation needs polishing but it best compilation of work so far.
To answer your questions:
QEMU have -s and -S options for GDB. First option setup gdb server hook and second freez CPU, so you can connect debugger. This is not for QEMU debugging this for guest system debugging. Default QEMU logging is to stderr, so if something valuable happen you will see it in terminal. You can raise QEMU verbosity by uncommenting various *DEBUG_ statements in source code. Also check help for -d and -D command line flags of QEMU.
Not sure I can help with this. Only thing that I can say is that my QEMU version 2.5.50 reacts to Ctrl+Alt which exits from GUI after capturing cursor, so it looks like QEMU understand Ctrl key. I assume that QEMU do not capture your special keys combination because your window manager do it before passing to QEMU.
This also not work for me, but I see some work was done in this area. Not sure how to enable and use that feature.
Emulating any hardware is very complex and requires a lot of work. All emulated targets are limited to some most important features. BCM2835/BCM2836 (Raspberry Pi/Raspberry Pi 2) SoC are still not accepted by mainline QEMU, so just work will not apply to those platforms.
I am trying to test buffer overflow attacks in virtualbox and have been struggling for the past few weeks due to all the security featrues of various distros.
I have tried following tutorials online step by step with no luck.
Rather than trying to disable all the security features, I tried getting an old linux distro but most of them don't come with gcc and lack working repositories now.
I even found a youtube video going step-by-step on Ubuntu 10.10 (which I downloaded too), including all the commands to disable the various security features and had no luck. I could get the segmentation fault but not the 'illegal instruction'.
Is there an ancient linux distro I could still download with none of this protection, which comes with gcc (or one of those huge dvd isos with a complete repository) so I can test this out?
You don't need to.
Compiling an executable with the GCC flag -fno-stack-protector and turning off ASLR with sudo sh -c "echo 0 > /proc/sys/kernel/randomize_va_space" disables the two main memory corruption attack mitigations in many Linux distributions. (Both of these protection technologies date back enough years to make finding a copy of an old distro time consuming, save Damn Vulnerable Linux)
It's possible on certain distributions that you'll have write xor execute memory pages, which is implemented through a number of different packages which you'll have to disable yourself. That considered, if you're not getting a stack smashing warning it's virtually certain that you don't have an executable with W^X memory pages.
This means if you're getting a segmentation fault, you've probably successfully overwritten the stored EIP on the stack and simply have your shellcode offset wrong or you've made an endianness mistake (some illegal multibyte instructions backwards are no longer illegal!). Examine your program in GDB and I think you'll see where you went wrong.
Exploring The Shellcoder's Handbook may be a profitable use of your time.
I recently read a post (admittedly its a few years old) and it was advice for fast number-crunching program:
"Use something like Gentoo Linux with 64 bit processors as you can compile it natively as you install. This will allow you to get the maximum punch out of the machine as you can strip the kernel right down to only what you need."
can anyone elaborate on what they mean by stripping down the kernel? Also, as this post was about 6 years old, which current version of Linux would be best for this (to aid my google searches)?
There is some truth in the statement, as well as something somewhat nonsensical.
You do not spend resources on processes you are not running. So as a first instance I would try minimise the number of processes running. For that we quite enjoy Ubuntu server iso images at work -- if you install from those, log in and run ps or pstree you see a thing of beauty: six or seven processes. Nothing more. That is good.
That the kernel is big (in terms of source size or installation) does not matter per se. Many of this size stems from drivers you may not be using anyway. And the same rule applies again: what you do not run does not compete for resources.
So think about a headless server, stripped down -- rather than your average desktop installation with more than a screenful of processes trying to make the life of a desktop user easier.
You can create a custom linux kernel for any distribution.
Start by going to kernel.org and downloading the latest source. Then choose your configuration interface (you have the choice of console text, 'config', ncurses style 'menuconfig', KDE style 'xconfig' and GNOME style 'gconfig' these days) and execute ./make whateverconfig. After choosing all the options, type make to create your kernel. Then make modules to compile all the selected modules for this kernel. Then, make install will copy the files to your /boot directory, and make modules_install, copies the modules. Next, go to /boot and use mkinitrd to create the ram disk needed to boot properly, if needed. Then you'll add the kernel to your GRUB menu.lst, by editing menu.lst and copying the latest entry and adding a similar one pointing to the new kernel version.
Of course, that's a basic overview and you should probably search for 'linux kernel compile' to find more detailed info. Selecting the necessary kernel modules and options takes a bit of experience - if you choose the wrong options, the kernel might not be bootable and you'll have to start over, which is a pain because selecting the options and compiling the kernel can take 15-30 minutes.
Ultimately, it isn't going to make a large difference to compile a stripped-down custom kernel unless your given task is very, very performance sensitive. It makes sense to remove things you're never going to use from the kernel, though, like say ISDN support.
I'd have to say this question is more suited to SuperUser.com, by the way, as it's not quite about programming.