Coder Social home page Coder Social logo

uz.exe hangs instead of exiting about orangec HOT 3 CLOSED

ladsoft avatar ladsoft commented on June 14, 2024
uz.exe hangs instead of exiting

from orangec.

Comments (3)

LADSoft avatar LADSoft commented on June 14, 2024

Hi Alexey!

Thanks for your elaborate feedback. I will look at UZ.C to fix the
'double free' and to see if I can clean up some of the warnings. I
agree UZ.C isn't a happy piece of code, some of the mess is from
contributors sigh although I probably should have payed more attention
to it when that was done.

The rest of the repository is a little cleaner... I spent november and
part of december compiling the tool chain with four or five different
compilers including CLANG and cleaned up a lot of issues as you suggest
as possible :) A lot of it was fluff, but the compilations did
highlight some outright bugs as well. I didn't think to screen UZ.C
however...

David

Alexey Frunze wrote:

Cause: duplicated fclose(FFzipfile) in unzip().

Problem exists in 3 different files named uz.c.

Repro: compile uz.c for Windows with Smaller C then try to unzip a
small text file on Windows 7 x64. Sometimes it uz.exe would exit, but
sometimes it would hang after unzipping.

What happens under the hood:
exit(), which runs after main(), calls fclose(stdout), which calls
free() to free stdout's buffer and ultimately kernel32::HeapFree()
hangs because of the memory corruption previously caused by a
double-free bug with 2 calls to fclose(FFzipfile).

Side note: uz.c is horrible. It compiles with lots of warnings with gcc.

One of the things you may find in the warnings is this nice line of code:

| for (i ==0 ; i < len; i++)
|

Note == instead of =.

I haven't tried anything else from the repository, but I think it
might be a good idea to clean up the code a little bit everywhere and
maybe try compiling it using different compilers to catch bad stuff.


Reply to this email directly or view it on GitHub
#4.

from orangec.

alexfru avatar alexfru commented on June 14, 2024

I haven't reviewed all the changes, but src/uz/uz.c isn't hanging anymore. I guess, you could close the issue.

from orangec.

LADSoft avatar LADSoft commented on June 14, 2024

yeah i ran it through clang and restructured some code, should be a little better. Thanks again!

from orangec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.