OWELLThe answer is where are you from?
I do wish that people who know nothing wouldn't give advice which gets other people into trouble.
No it is not legal to take a train ride to the Ukraine in order to get another 90 day-visa. Once you have been inside the Schengen Zone for 90 days in any 180 day period, you must either have a valid residency permit or leave the zone and stay out for 90 days.
If anything, leaving Poland is worse than staying here: all you do is twice expose yourself to people who will take an interest in your passport.
More and more Americans are learning this the hard way every month.
what happens for instance if I overstay in Poland ,
If you get caught, you'll be deported. When you try to leave Poland, you may be fined and banned from the Schengen zone for a number of years.
can I begin some voluntary work , study or whatever?
Not legally you can't. If you are not in Poland legally (which you are not if you have been in the Schengen zone for more than 90 days in any 180-day period and you do not have a residency permit), you can not do anything legally and nothing you do will make you legal in Poland: you must leave and stay out for 90 days. Of course, if you overstay and then are not lucky at the border, you will need to stay out for a lot longer than 90 days.