尝试使用 python jaydeebe api 时出现 SIGBUS 错误

问题描述 投票:0回答:1

我编写了一个小函数,使用 jaydeebe api/module/library 在 python 中创建 jdbc 连接。我已经在我的个人笔记本电脑(Windows 环境)上测试了它,它成功创建了连接对象。 当我将代码移至另一台 macOS 环境笔记本电脑并尝试执行相同操作时,我遇到了此错误。无论如何,这是我认为重要的所有信息,如果您认为这可以提供更多见解,请随时索取更多信息。

代码:

conn = jaydebeapi.connect(
            properties['driverName'],
            properties['url'],
            [properties['username'], properties['password']],
            driver
        )
logger.info("Connection created successfully")

错误:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0x0000000106f02b18, pid=35834, tid=0x0000000000000103
#
# JRE version:  (8.0_431) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.431-b10 mixed mode bsd-aarch64 compressed oops)
# Problematic frame:
# V  [libjvm.dylib+0x23ab18]  CodeHeap::allocate(unsigned long, bool)+0xe8
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/abhinav/Workspace/hs_err_pid35834.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
python java postgresql jdbc
1个回答
0
投票

好吧,通过尝试在 Windows 环境中重新运行相同的内容找到了答案。问题是

driver
变量指向错误的位置。当在 Windows 环境中运行时,它清楚地指出了变量指向错误位置的错误,而在 macOS 中,它给出了 SIGBUS 错误,这确实很难理解(至少对我来说)。

© www.soinside.com 2019 - 2024. All rights reserved.