Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Heap corruption when printing, if importing pytorch *before* julia

Đang mở
#499 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
julia, macos, python, pytorch
Lĩnh vực
api, backend

Hướng nghiên cứu

Tái hiện ví dụ tối thiểu trên macOS với hai thứ tự import, sau đó bắt đầu trong julia/core.py, xung quanh Julia.eval, _call và check_exception. Truy vết lỗi EEXIST của pipe_open đã được báo cáo và so sánh hành vi khi PyTorch được import trước; hoàn tất nghĩa là ví dụ không còn làm hỏng heap hoặc abort nữa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I have no idea what this very strange issue comes from. It could be a combination of my specific torch version (tested 1.11-1.13, still occurs), specific operating system (macOS), specific python version (3.8.9) combined with my specific julia version (1.7.2).

Here's a minimal example:

import torch
from julia import Pkg
Pkg.add("StatsBase")

The output is:

Python(61891,0x100598580) malloc: *** error for object 0xffffffff00000000: pointer being freed was not allocated
Python(61891,0x100598580) malloc: *** set a breakpoint in malloc_error_break to debug

signal (6): Abort trap: 6
in expression starting at none:0
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 11431809 (Pool: 11423282; Big: 8527); GC: 14
[1]    61891 abort      ~/venvs/main/bin/ipython

However, I can make this go away with:

from julia import Pkg
import torch
Pkg.add("StatsBase")

This works fine.

I see this more helpful error when I run this code in a debugger:

File ~/venvs/main/lib/python3.8/site-packages/julia/core.py:621, in Julia.eval(self, src)
    619 if src is None:
    620     return None
--> 621 ans = self._call(src)
    622 if not ans:
    623     return None

File ~/venvs/main/lib/python3.8/site-packages/julia/core.py:549, in Julia._call(self, src)
    547 # logger.debug("_call(%s)", src)
    548 ans = self.api.jl_eval_string(src.encode('utf-8'))
--> 549 self.check_exception(src)
    551 return ans

File ~/venvs/main/lib/python3.8/site-packages/julia/core.py:603, in Julia.check_exception(self, src)
    601 else:
    602     exception = sprint(showerror, self._as_pyobj(res))
--> 603 raise JuliaError(u'Exception \'{}\' occurred while calling julia code:\n{}'
    604                  .format(exception, src))

JuliaError: Exception 'IOError: pipe_open: file already exists (EEXIST)' occurred while calling julia code:

So it seems like perhaps pytorch is taking over one of the pipes for printing from Python?

Ngôn ngữ chính
Python
Star
893
Fork
101
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của JuliaPy/pyjulia

Tất cả issue của JuliaPy/pyjulia

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.