New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault in SparseArrayLookup #283
Comments
@gcasa Is this the right way to file this, or should I move this to a different repo or to |
Do you have a reduced test case (ideally linking nothing but the runtime)? It looks as if it may be trying to send a message in +load to a class that is not yet loaded. |
I think I might have forgotten to link something. I don't have a minimal test case -- as I said, I have no idea where this came from. |
I looked and it seems like I have linked everything. |
Is the order of the +load messages defined? It doesn't occur in the libs-opal testcases, so if this is the reason for the segfault, then the load message order is different. |
@davidchisnall I believe this is the problem... + (void)load
{
[CGImageDestination registerDestinationClass: self];
} |
I changed those to |
Sending a message to a superclass in +load should be fine. Sending one to any other class that鈥檚 defined in the same library should also be fine. I wonder if somehow the selector for the message being sent is not resolved. That could result in an out of bounds access in the uninitialised stable. |
I have changed
@davidchisnall Might this be related? The abort appears in pthreads in |
Does Apple objc4 work on Linux? If it does, it might be possible to test on objc4 to see if the issue is in libobjc2. |
@davidchisnall How can I compile libobjc2 with debug symbols included? |
I passed |
I'm kinda busy, but here's my last GDB session if anyone wants to take a look:
|
@davidchisnall The issue appears to be that the isa of CAAction is 0x0, which is not a valid protocol version. I don't know why it ended up this way. |
What is the -fobjc-runtime= flag that you鈥檙e passing to clang? |
@davidchisnall
|
I can try switching to the newly released v2.2.1 |
I'm building like: export CC=clang-14
export CXX=clang++-14
export CXXFLAGS="-std=c++11"
export RUNTIME_VERSION=gnustep-2.1
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export LD=/usr/bin/ld.gold
export LDFLAGS="-fuse-ld=/usr/bin/ld.gold -L/usr/local/lib"
rm -Rf build
mkdir build && cd build
cmake ../ \
-DCMAKE_C_COMPILER=${CC} \
-DCMAKE_CXX_COMPILER=${CXX} \
-DCMAKE_ASM_COMPILER=${CC} \
-DCMAKE_LINKER=${LD} \
-DUSE_GOLD_LINKER=YES \
-DCMAKE_MODULE_LINKER_FLAGS="${LDFLAGS}" \
-DTESTS=OFF \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1
cmake --build .
sudo -E make install
sudo ldconfig |
The issue still appears in v2.2.1. |
clang 14 is pretty old, but should be fine. There are a few fixes for the v2 ABI after that, but I think they matter only on Windows. I wonder if the +load is somehow being called before we've loaded the |
@davidchisnall Is there anything that I should run in
I think this issue is unrelated to the
|
It runs into |
@davidchisnall Are you available to look at this more or not? Should I post this to |
I鈥檓 completely confused by this. It looks as if your binary contains things that shouldn鈥檛 be possible. |
Hello 馃憢, I have encountered a segfault in
SparseArrayLookup
during the initialization of my port of the application GitY. Here is the backtrace from GDB:Interestingly, I have not encountered this when running any of the libs-opal tests, such as
images
. I have confirmed with GDB thatimages
calls+[CGImageDestinationTIFF load]
without segfaulting. Therefore, I don't know in which component this came from.The Objective-C components that are linked to by
GitY
are:It's possible that one of those has messed something up in their
+load
methods, but I'm not exactly sure. If needed, I can send you binaries of my GNUstep installation, compilelibobjc2
with different flags, peek around in GDB, or whatever else would be needed.The text was updated successfully, but these errors were encountered: