Comments (6)
Hey, could you try making this change to File_Close
in File+.c
:
void File_Close(var self) {
FileData* fd = cast(self, File);
fclose(fd->f);
fd->f = NULL;
}
And see if it fixes it.
Thanks.
from cello.
It didn't help - the same result.
from cello.
Perhaps you could also try this change to File_Delete
in File+.c
var File_Delete(var self) {
FileData* fd = cast(self, File);
if (fd->f != NULL and tell(self) != -1) { close(self); }
return self;
}
If that still doesn't work I'll wait till I can get to a Ubuntu machine and recreate the result.
from cello.
It helps from this one. But now we've got new SIGSEGV:
(gdb) where
#0 0x00007ffff7806475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff78096f0 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff784032b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff7849b76 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007ffff784cbe3 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x00007ffff784e990 in malloc () from /lib/x86_64-linux-gnu/libc.so.6
#6 0x00007ffff783b40b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#7 0x00000000004036f5 in File_Open (self=0x7fffffffe110, filename=0x4255b7 "test.txt", access=0x42400c "w") at src/File+.c:39
#8 0x00000000004084b1 in open (self=0x7fffffffe110, name=0x4255b7 "test.txt", access=0x42400c "w") at src/Prelude+.c:354
#9 0x000000000041ddaa in test_file_read () at tests/data.c:1359
#10 0x0000000000420ee4 in pt_run () at tests/ptest.c:225
#11 0x00000000004212fa in main (argc=1, argv=0x7fffffffe688) at tests/test.c:14
Previous one:
---------------------------
(gdb) where
#0 0x00007ffff7806475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff78096f0 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff784032b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff7849b76 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007ffff784e8ac in free () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x00007ffff783aacd in fclose () from /lib/x86_64-linux-gnu/libc.so.6
#6 0x00000000004037b8 in File_Close (self=0x8e7eb0) at src/File+.c:51
#7 0x0000000000408518 in close (self=0x8e7eb0) at src/Prelude+.c:360
#8 0x00000000004035f5 in File_Delete (self=0x8e7eb0) at src/File+.c:26
#9 0x0000000000406f48 in delete (self=0x8e7eb0) at src/Prelude+.c:82
#10 0x000000000041dd4c in test_file_create () at tests/data.c:1347
#11 0x0000000000420ec8 in pt_run () at tests/ptest.c:225
#12 0x00000000004212de in main (argc=1, argv=0x7fffffffe698) at tests/test.c:14
from cello.
It is now dying in test_file_read, but that doesn't mean it's still not due to corruption from the deletes in test_file_create. I'm on fedora 16 and gcc 4.7.2. Inspecting with GDB.
from cello.
Had a bit of an inspection and I think Assignment and Copying are just too messy in implementation for File objects. Unless someone has a need for them later this can be considered a fix for now.
from cello.
Related Issues (20)
- Unexpected GC behavior with Tuple HOT 5
- Make install should use "install --mode=..." instead of "cp" HOT 2
- make install doesn't install the dynamic library
- How do one "extends" a type? HOT 3
- error: cast to pointer from integer of different size HOT 2
- pop semantics? HOT 3
- Append Char HOT 2
- MacOS: __dyld section not supported HOT 1
- Abstracting a scripting language's internal value types using Cello HOT 1
- Feature request : Lua->Cello transpiler
- Missing Git tag for 2.1.0 release HOT 2
- Can I make a wrapper for other languages?
- Add vcpkg installation instructions
- Question about Array
- Doesn't work with Emscripten HOT 2
- is the project alive? can I use it in my product? who develops forks based on Cello? HOT 3
- Moving objects between threads HOT 1
- Failed to compile on GCC 8.1.0
- Can you do a comparison to Nim and Nelua?
- new release? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cello.