| Summary: | arm: ld terminated with signal 11 | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | gil cattaneo <puntogil> | ||||
| Component: | binutils | Assignee: | Nick Clifton <nickc> | ||||
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | rawhide | CC: | jakub, nickc, puntogil | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | arm | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | sqlite-jdbc-3.15.1-2.fc26 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2016-11-10 12:23:02 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
|
Description
gil cattaneo
2016-11-08 11:12:09 UTC
Hi Gil, I cannot reproduce this using sqlite-jdbc-3.15.1-1.fc26 and 2.27-10.fc26 on an armv7hl machine running rawhide. Do you have any suggestions for what I should try ? Cheers Nick (In reply to Nick Clifton from comment #1) > Hi Gil, > > I cannot reproduce this using sqlite-jdbc-3.15.1-1.fc26 and 2.27-10.fc26 > on an armv7hl machine running rawhide. Do you have any suggestions for what > I should try ? > > Cheers > Nick No sorry. i need to rebuild sqlite-jdbc-3.15.1 because libsqlitejdbc.so is broken. And if you can't reproduce is a bit weird .... Maybe https://kojipkgs.fedoraproject.org//work/tasks/5386/16325386/root.log could help Launched a new build Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=16356158 [exec] make[1]: Leaving directory '/builddir/build/BUILD/sqlite-jdbc-3.15.1'
[exec] collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
[exec] compilation terminated.
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65539 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65538 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65536 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65539 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65539 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65538 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65536 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65538 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65539 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65538 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65536 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65539 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65538 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65536 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65539 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65539 >= 4717 for section `.strtab'
[exec] /usr/bin/ld: target/sqlite-3.15.1-Linux-arm/NativeDB.o: invalid string offset 65539 >= 4717 for section `.strtab'
[exec] Result: 2
[INFO] Executed tasks
from http://koji.fedoraproject.org/koji/taskinfo?taskID=16356165
Hi Gil, OK - I can now reproduce the problem, but I am still stuck. It seems that the build system is running several tasks at the same time, and I cannot find the command line that is causing the linker failure. The gcc command just prior to the seg-fault message in the build.log executes without any problems and neither the strip nor copy commands use the linker. Is there any way I can persuade the build system to operate sequentially, and maybe be a bit more verbose about what it is doing ? Cheers Nick i wrote this makefile (...):
CXX=gcc
STRIP=strip
SRCDIR=src/main/java/org/sqlite/core
JSRCDIR=src/main/java
BUILD=target
known_os_archs :=
#OSINFO_CLASS:=org.sqlite.OSInfo
OSINFO_CLASS:=org.sqlite.util.OSInfo
OSINFO_PROG:=$(shell $(JAVAC) )
LIBNAME:=libsqlitejdbc.so
OS_NAME:=$(shell $(JAVA_HOME)/bin/java -cp lib $(OSINFO_CLASS) --os)
OS_ARCH:=$(shell $(JAVA_HOME)/bin/java -cp lib $(OSINFO_CLASS) --arch)
NATIVE_DIR=src/main/resources/org/sqlite/native/$(OS_NAME)/$(OS_ARCH)
NATIVE_TARGET_DIR:=$(BUILD)/classes/org/sqlite/native/$(OS_NAME)/$(OS_ARCH)
ODIR=$(BUILD)/$(OS_NAME)-$(OS_ARCH)
IGEN=$(ODIR)
JCLASSESDIR=$(ODIR)
SQLITE_OUT:=$(ODIR)
INCLUDE=-I$(SQLITE_OUT) -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
_OBJ_STD = NativeDB.o
OBJ_STD = $(patsubst %,$(ODIR)/%,$(_OBJ_STD))
_JAVA = $(shell find $(JSRCDIR) -name "*.java" -print)
.PHONY: clean native
build: $(ODIR)/$(LIBNAME)
$(ODIR)/$(LIBNAME): $(OBJ_STD)
$(CXX) -shared -fPIC -static-libgcc -lsqlite3 $(CFLAGS) $(LDFLAGS) -o $@ $^
$(STRIP) $@
$(BUILD)/$(OS_NAME)-$(OS_ARCH)/%.class: javafiles-list
mkdir -p $(BUILD)/$(OS_NAME)-$(OS_ARCH)
$(JAVA_HOME)/bin/javac -d $(BUILD)/$(OS_NAME)-$(OS_ARCH) @javafiles-list
javafiles-list: $(_JAVA)
echo $^ > javafiles-list
$(ODIR)/%.o: $(SRCDIR)/%.c $(IGEN)/NativeDB.h
mkdir -p $(ODIR)
$(CXX) $(CFLAGS) $(LDFLAGS) $(INCLUDE) -fPIC -lsqlite3 -c -o $@ $<
$(IGEN)/NativeDB.h: $(BUILD)/$(OS_NAME)-$(OS_ARCH)/%.class
mkdir -p $(IGEN)
$(JAVA_HOME)/bin/javah -o $(IGEN)/NativeDB.h -classpath $(BUILD)/$(OS_NAME)-$(OS_ARCH) \
org.sqlite.core.NativeDB
native: $(OSINFO_PROG) $(ODIR)/$(LIBNAME)
@mkdir -p $(NATIVE_DIR)
cp $< $(NATIVE_DIR)/$(LIBNAME)
OSINFO_PROG:
$(JAVA_HOME)/bin/javac src/main/java/org/sqlite/util/OSInfo.java -d lib
clean:
-rm javafiles-list
-rm -Rf $(BUILD)
but still i dont know how fix OS_NAME and OS_ARCH during build time.
for now pass these value with:
# Used for build JNI library
cp -p src/main/java/org/sqlite/util/OSInfo.java lib/org/sqlite/
sed -i "s|package org.sqlite.util;|package org.sqlite;|" lib/org/sqlite/OSInfo.java
%javac $(find lib -name "*.java")
%global OSNAME $(%java -cp lib org.sqlite.OSInfo --os)
%global OSARCH $(%java -cp lib org.sqlite.OSInfo --arch)
cp -p %SOURCE1 Makefile
CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ;
LDFLAGS="${LDFLAGS:-%__global_ldflags}"; export LDFLAGS;
make %{?_smp_mflags} JAVA_HOME=%{_jvmdir}/java native OS_NAME=%OSNAME OS_ARCH=%OSARCH
but i still never tested on koji builders
Created attachment 1219029 [details] Makefile With lastest sqlite-jdbc-Makefile draw (attached) Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=16374700 seem work fine, but need to check the compiler flags (gcc) # Build JNI library %pom_add_plugin org.apache.maven.plugins:maven-antrun-plugin:1.7 . ' <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.8.0</version> </dependency> </dependencies> <executions> <execution> <id>compile</id> <phase>process-classes</phase> <configuration> <target> <javac destdir="lib" srcdir="lib" source="1.6" target="1.6" debug="on" classpathref="maven.plugin.classpath"> <include name="**/OSInfo.java"/> </javac> <exec executable="make"> <arg line="%{?_smp_mflags} JAVA_HOME=%{_jvmdir}/java JAVA=%{_jvmdir}/java/bin/java JAVAC=%{_jvmdir}/java/bin/javac JAVAH=%{_jvmdir}/java/bin/javah native"/> </exec> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions>' %mvn_file org.xerial:%{name} %{name} %build cp -p %SOURCE1 Makefile # Used for build JNI library cp -p src/main/java/org/sqlite/util/OSInfo.java lib/org/sqlite/ sed -i "s|package org.sqlite.util;|package org.sqlite;|" lib/org/sqlite/OSInfo.java %ifarch %{arm} opts='-f' %endif CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; LDFLAGS="${LDFLAGS:-%__global_ldflags}"; export LDFLAGS; %mvn_build $opts -- -Dmaven.test.failure.ignore=true This appears to be a problem with the makefile being used to build the
libsqlitejdbc.so library. Running a parallel make results in the
error reported, but running a sequential make does not. Hence I am
currently of the opinion that this is not actually a bug in the
linker, but rather a bug in the sqlite-jdbc build system.
As a suggested fix try adding "-j 1" to the make command line, like this:
diff --git a/sqlite-jdbc.spec b/sqlite-jdbc.spec
index 9e045f4..414e7ce 100644
--- a/sqlite-jdbc.spec
+++ b/sqlite-jdbc.spec
@@ -124,6 +124,7 @@ sed -i '/SQLiteDataSourceTest/d' src/test/java/org/sqlite/AllTests.java
</javac>
<exec executable="make">
<arg line="%{?_smp_mflags}
+ -j 1
JAVA_HOME=%{_jvmdir}/java
JAVA=%{_jvmdir}/java/bin/java
JAVAC=%{_jvmdir}/java/bin/javac
Thanks for your help! Solved using native task, as you said, "to avoid to run multiple, conflicting, operations at the same time" Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=16383709 |