Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glibc import error #44

Closed
movingname opened this issue Jan 31, 2015 · 4 comments
Closed

glibc import error #44

movingname opened this issue Jan 31, 2015 · 4 comments

Comments

@movingname
Copy link

Hello,

I am trying to import glibc 2.17 using joern 0.3.1. However, I got the error message attached below. Could you please help me to resolve this? Thank you!

Some additional info:

  • The command I use: java -jar joern.jar ..\glibc
  • I am using neo4j 2.1.6 on Windows 8.
  • I have imported some other c programs (e.g. libexif 0.6.20) and they work fine.

Error output:

...
E:\Vulns\glibc_joern..\glibc\wctype\wctype.h
E:\Vulns\glibc_joern..\glibc\wctype\wctype_l.c
Exception in thread "main" org.neo4j.kernel.impl.nioneo.store.UnderlyingStorageException: Unable to close store .joernIn
dex\neostore.propertystore.db.strings
at org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.close(CommonAbstractStore.java:743)
at org.neo4j.kernel.impl.nioneo.store.PropertyStore.closeStorage(PropertyStore.java:125)
at org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.close(CommonAbstractStore.java:695)
at org.neo4j.kernel.impl.nioneo.store.NeoStore.closeStorage(NeoStore.java:279)
at org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.close(CommonAbstractStore.java:695)
at org.neo4j.unsafe.batchinsert.BatchInserterImpl.shutdown(BatchInserterImpl.java:800)
at neo4j.batchInserter.Neo4JBatchInserter.closeDatabase(Unknown Source)
at outputModules.neo4j.Neo4JIndexer.shutdownDatabase(Unknown Source)
at tools.index.Indexer.shutdown(Unknown Source)
at tools.index.IndexMain.walkCodebase(Unknown Source)
at tools.index.IndexMain.main(Unknown Source)
Caused by: java.io.IOException: The requested operation cannot be performed on a file with a user-mapped section open
at sun.nio.ch.FileDispatcherImpl.truncate0(Native Method)
at sun.nio.ch.FileDispatcherImpl.truncate(Unknown Source)
at sun.nio.ch.FileChannelImpl.truncate(Unknown Source)
at org.neo4j.kernel.impl.nioneo.store.StoreFileChannel.truncate(StoreFileChannel.java:98)
at org.neo4j.kernel.impl.nioneo.store.StoreFileChannel.truncate(StoreFileChannel.java:28)
at org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore$1.perform(CommonAbstractStore.java:725)
at org.neo4j.kernel.impl.util.FileUtils.windowsSafeIOOperation(FileUtils.java:367)
at org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.close(CommonAbstractStore.java:715)
... 10 more

@fabsx00
Copy link
Member

fabsx00 commented Jan 31, 2015

Hi,
so, I've just tested importing glibc-2.17 on a linux system and it worked fine, so I am figuring it is something specific to your setup.

My first guess would have been that your disk is simply full, but the database is only about 500MB in size., so that's probably not it. The second thing which comes to mind: I have not tested joern on Windows yet. Backslashes in path-names should not be a problem, but who knows, maybe they are.

Can you try (a) placing the glibc-directory in the joern-directory so you can just run 'java -jar ./bin/joern glibc-2.7' and (b) using a full pathname to specify where the code is?

Hope that helps. Let me know if it doesn't.
Fabian

@movingname
Copy link
Author

Hi Fabian,

Thank you very much for your reply. After seeing your reply and reexamining the error message, I think it might be related to Neo4j and Windows. So I found the following post:

jexp/batch-import#16

Basically, it suggests to have use_memory_mapped_buffers=false

So I went to joern-0.3.1\src\neo4j\batchInserter\ConfigurationGenerator.java and did the change.

Now it works.

There is another tiny issue. By observing the output of joern during importing, I found some functions cannot be properly parsed, for example:

E:\Vulns\glibc_joern..\glibc\sysdeps\ieee754\ldbl
Error parsing function __ieee754_acoshl. skipping.

Is it a known issue to you? Thank you!

Mingyi

@fabsx00
Copy link
Member

fabsx00 commented Jan 31, 2015

Hi Mingyi,

yes, that's just the fuzzy parser telling you that it is skipping one of the functions because it had trouble parsing it, typically due to weird preprocessor directives. In some cases, it may be possible to change the grammar to fix this, it depends on exactly what caused the problems.

I'm closing this for now. Let me know if you have any more questions.

@fabsx00 fabsx00 closed this as completed Jan 31, 2015
@movingname
Copy link
Author

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants