#1 sounds like a plumbing vent stack. This allows toxic gases to vent from the sewer pipes in the home, to the atmosphere. It appears that you are describing a leaking flashing (roof boot) on the roof. This is a collar and flange assembly that is lowered over the top of the stack and integrated into the roofing material. It can be lead, although in these parts it wouldn't be unless the roof is a century old. Modern versions typically have a rubber collar and tin or plastic flange. Yours simply needs to be replaced.
#2 is a bit of a mystery. All the evidence points to it being a vent for a bathroom fan, except for the fact that the pipe appears to be far more substantial than what would typically be. Typically this would be a thin sheetmetal "stovepipe". If it's a bath fan it will be obvious if you look, feel and listen to the open end while a helper runs the fan. You could even have them spray some scented bath spray into fan to see if the fragrance travels up the pipe. If it turns out to be a bath fan vent, you would need to get it vented to the exterior, for obvious reasons. This could involve a vent cap cut though the roof, or sending the exhaust out a side wall or soffit. Be sure to run this vent in either sheetmetal or flexible metal ducting. It must also be insulated to prevent condensation. OTOH, it may be just another sewer vent stack that some lazy bastard decided to end in the attic. This is real dangerous, as it could fill the attic with sewer gas. As you are inspecting the open end of the pipe, have the helper flush toilets and run water in sinks to see if you hear draining water, or smell sewer gas. If this is an unfinished vent stack, you can cap it with a "studor valve" or air admittance valve. This is a cap that will let air into the stack, but prevent sewer gas from escaping.