Opened 7 years ago

Closed 6 years ago

#9804 closed defect (user disappeared)

_set_argv on FreeBSD corrupts the environment

Reported by: philip Owned by: atagar
Priority: Medium Milestone:
Component: Archived/Stem Version:
Severity: Keywords: freebsd arm environment corrupt efault
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


I've not had much time to debug this, but I figured I'd file a ticket so it doesn't get lost. If I find time to debug further, I'll update this ticket.

Observed on stem aee7de8, with arm 853bf8b

On FreeBSD, arm will break in many ways because _set_argv clobbers the environment:

  • os.putenv(LANG...) will fail because the environment is corrupt and Python will stop with EFAULT
  • If you manage to get past that, every system() call will fail because of unexpected input on stderr (sh: environment corrupt; missing value for [sic])

At first guess, the check for > _MAX_NAME_LEN in get_process_name() is probably incorrect.

Child Tickets

Change History (2)

comment:1 Changed 7 years ago by atagar

Huh, that's curious. The easy solution would to make set_process_name() or _set_argv() a no-op when on freebsd. That said, actually fixing it is certainly preferable of course.

I don't have a freebsd system so I'll defer to whatever patch you think is appropriate.

comment:2 Changed 6 years ago by atagar

Resolution: user disappeared
Status: newclosed

No reply so I'm gonna resolve this. Feel free to reopen if you'd like to discuss this further. Again I don't have freebsd, so I defer to folks that do for this sort of functionality.

Note: See TracTickets for help on using tickets.