Skip to content

Linux GETTID syscall problem on OpenWrt #98

@aaaaalbert

Description

@aaaaalbert

I saw this exception running RepyV2 code in a vessel on Guilherme Martin's WNDR3800 OpenWrt router. My program calls getresources(). Then linux_api.py tries to read the current task's CPU consumption, but the _get_current_thread_id() call returns -1. This leads get_current_thread_cpu_time() into a non-existing dir, crashing the Repy program.

========================================
Running program: easy-loop.r2py
Arguments: []
========================================

---
Uncaught exception!

---
Following is a full traceback, and a user traceback.
The user traceback excludes non-user modules. The most recent call is displayed last.

Full debugging traceback:
  "repyV2/repy.py", line 177, in execute_namespace_until_completion
  "/mnt/seattle/seattle_repy/repyV2/virtual_namespace.py", line 117, in evaluate
  "/mnt/seattle/seattle_repy/repyV2/safe.py", line 588, in safe_run
  "easy-loop.r2py", line 3, in <module>
  "/mnt/seattle/seattle_repy/repyV2/nonportable.py", line 319, in get_resources
  "/mnt/seattle/seattle_repy/repyV2/linux_api.py", line 227, in get_current_thread_cpu_time
  "/mnt/seattle/seattle_repy/repyV2/linux_api.py", line 100, in _process_stat_file

User traceback:
  "easy-loop.r2py", line 3, in <module>
  "/mnt/seattle/seattle_repy/repyV2/linux_api.py", line 227, in get_current_thread_cpu_time
  "/mnt/seattle/seattle_repy/repyV2/linux_api.py", line 100, in _process_stat_file

Exception (with type 'exceptions.IOError'): [Errno 2] No such file or directory: '/proc/5652/task/-1/stat'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions