coredump using another user

Basically, I'm trying to do a stack shellcode, and I have 2 users: root and user1. I'm trying to exploit root, and I'm using coredump to get the buffer address, but I get the error access denied because only user1 has permission for core. How do I use core to exploit root?

I tried doing this:

p = process(path , cwd = workingdir, setuid=True)
p.setuid = 100
p.corefile

where 100 is the uid of user1 but it says corefile pid does not match

Basically, I need to be user1 to access the corefile, but use that to exploit root