delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/09/07:23:14

From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: SIGSEGV
Date: 9 Sep 1999 08:39:15 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 48
Message-ID: <7r7rnj$gs7$2@antares.lu.erisoft.se>
References: <37d738ad DOT 581052 AT news DOT telepac DOT pt>
NNTP-Posting-Host: propus-144.lu.erisoft.se
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

aperes (ajps AT mail DOT telepac DOT pt) wrote:
: Why this program receives SIGSEGV?

[Klippa, klapp, kluppit.]

: int main(void)
: {
:  ......
:
: Load_Sound(..............);

Perhaps you mean Sound_Load?

: .......
:
: return 0;
: }
:
:
: int Sound_Load(char *filename, ssound_ptr the_sound, int translate)
: {
:   ......
:   ......
:   int *selector;
         ^^^^^^^^
Uninitialised pointer.

:   ..........
:
:   if(_dos_open(filename, _O_RDONLY, &sound_handle)) {          OK
:      printf("file not found");
:      return 1;
:   }
:
:   size_of_file = filelength(sound_handle);
: tmp_ptr = s_ptr = 
: (unsigned char*)__dpmi_allocate_dos_memory((size_of_file+15) >> 4,
: selector);     OK

Here you pass a pointer pointing to anywhere. Expect weird behaviour.


Keep in mind that I'm not an expert on low level DOZE programming.


Right,

							MartinS

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019