Shouldn't polrootsmod(f,p) for a prime p and f%p==0 simply return vector(p,i,Mod(i-1,p)) instead of the error?
Say, the roots of 13*x = 0 modulo 13 are given by all the residues modulo 13.
This would reduce the amount of special cases to consider (in my codes at least).
? polrootsmod(13*x,13)
*** at top-level: polrootsmod(13*x,13)
*** ^--------------------
*** polrootsmod: zero polynomial in FpX_roots.
*** Break loop: type 'break' to go back to GP prompt
Regards,
Max